From patchwork Tue Nov 21 09:32:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "He, Hongbo" X-Patchwork-Id: 10067849 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D0BB0602B7 for ; Tue, 21 Nov 2017 09:33:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C423628C55 for ; Tue, 21 Nov 2017 09:33:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B90DE28C86; Tue, 21 Nov 2017 09:33:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7C04128C55 for ; Tue, 21 Nov 2017 09:33:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DB7796E39F; Tue, 21 Nov 2017 09:33:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0089.outbound.protection.outlook.com [104.47.34.89]) by gabe.freedesktop.org (Postfix) with ESMTPS id A9ED16E39C; Tue, 21 Nov 2017 09:33:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=xoxNhYAF61Be2D5M5qetLMqhAikZ0xolv/T5OxuMeNQ=; b=DkIRsEvJbGZAE46H2c50m9RXBNykWGXb6ZccG+UhVneV3ItjMlcn3R/CDOuOB2cYiAZtaoDUs8Sc4WxHhHMNCmW34a3wlFRmdoCySKOTsd9Yltm4Ljp78ZbiX+fW7j4k6FwKHdyKeqWVqKhBnjFvTJFsnpN363xYfNXxZk8jNnU= Received: from BN6PR1201CA0015.namprd12.prod.outlook.com (10.174.238.25) by BN6PR1201MB0052.namprd12.prod.outlook.com (10.174.114.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Tue, 21 Nov 2017 09:33:15 +0000 Received: from CO1NAM03FT021.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::201) by BN6PR1201CA0015.outlook.office365.com (2603:10b6:405:4c::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.239.5 via Frontend Transport; Tue, 21 Nov 2017 09:33:15 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by CO1NAM03FT021.mail.protection.outlook.com (10.152.80.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.239.4 via Frontend Transport; Tue, 21 Nov 2017 09:33:15 +0000 Received: from roger-build-server.amd.com (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.361.1; Tue, 21 Nov 2017 03:33:13 -0600 From: Roger He To: , Subject: [PATCH 2/4] drm/ttm: use NUM_PAGES_TO_ALLOC always Date: Tue, 21 Nov 2017 17:32:20 +0800 Message-ID: <1511256742-5601-3-git-send-email-Hongbo.He@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511256742-5601-1-git-send-email-Hongbo.He@amd.com> References: <1511256742-5601-1-git-send-email-Hongbo.He@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(39860400002)(2980300002)(428002)(189002)(199003)(2950100002)(450100002)(77096006)(6666003)(4326008)(53936002)(53416004)(50226002)(86362001)(575784001)(316002)(16586007)(189998001)(8676002)(48376002)(105586002)(110136005)(50466002)(81156014)(106466001)(81166006)(305945005)(104016004)(478600001)(68736007)(97736004)(356003)(2906002)(5003940100001)(47776003)(72206003)(50986999)(76176999)(101416001)(8936002)(36756003)(5660300001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR1201MB0052; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT021; 1:P5EMxFv9xdNEd0dFDSKn8FNuuldIIGzqbYW/q4BRrcYhY1tM8GKcOD5vEI8HVMCFE/BpzwzM/nDkZnXaWQNLDeJxJ2g6/yWXO+Avo+Z2hBjyDL41jT6a1ZyefM5vpQMA X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4b936ada-5f9b-4daa-ea94-08d530c2e42a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199); SRVR:BN6PR1201MB0052; X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB0052; 3:mm3lVmwO/vGSpC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e0hhI/pWw9yhGuCUgmz295HBzFZwXPlMsXu0p3E4YNGDnK1tgEilKfbVmiXBxCmtH9/r8j8Yag8JrT/5qz56dwgJvd51mbW63mrh3/x7PyRTZzecY/vqFdKTl+Nfk0HF8EanVMDBuDBJw36kOdnMfQwQd3pj5/gDWtiIZNVQBD6E5zvYMVowDDK0ztxIxI+hehuIhTSv2vd3m79R2bi+Z7x2q0bRJPN5MmuPumM/0TX7DnehpZILHqPsjuGR48K9JXFKfg3nsVe7TByWZBXXgmrMyYV+CC+MVOETRGRMovaJKAE7WsIx2JvqdNuItSOTko8IYmTP2X6cwT1cBwVmS1Vb2roB4IG1eiwD5/bODwQWTq7SIz62heur7yX7PuCaZQVjUG+Lwwqk9Mj5gX5tbzl4dLQ1OEfQQnC10j+xvKocSA91GJ5t51cOgAvmOcYVCHcmO+9JUIPJeG6w2Q3Wb5vgWmm X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3231022)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93003095)(6055026)(6041248)(20161123562025)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR1201MB0052; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR1201MB0052; X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB0052; 4:iESklDYXyIgM6CRa7WNkI8jiBe7qh4bgjX+Qg0b5t+l0ZvF5n6hpaAfm3f4mxD9u0nYIkWNXV8brbCF3H+RHuvl1ytva9oc1p7S7WTJ91umEwmXH5sJxDXLkUJBCU5F2TGLKrJq5W9OauolQj5sRavxnSN+oN2FAjbHSAaMV1DF7qil9KuLtrCjXY5sjCQpwVzAennhQqfdBk0MUD7TCY2NlUB1kCi4tbDYbyd9nfidghdDf7q1KeUlEp8UZAyK6NQiOBjekp6/FEX4DXfEbjbojNm7zxMN3M9afv9sD7nd5OleZHGwkBHGkZ1b7YR5f X-Forefront-PRVS: 049897979A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR1201MB0052; 23:n/4Ts6qTQ+wwvPxDKHl1otKRhGzjnGpBSTp53Fy?= =?us-ascii?Q?1zNloXodPvl2lqFx4FCGvc9RKo4GpRKv5NO+FYkNgV1PIgKMf8KVu20ksDd7?= =?us-ascii?Q?HaxHq0K7cFfsCleEuCAP/+r720hfHZlgG0SDj3lM9lrpxY6U4rxmAYSEyV2M?= =?us-ascii?Q?uluAhfvf/iPBMpXq8fCj5cNvMZ2Rtb1QZcojpbD1/Q2PuCSz8ypPbtzKa21E?= =?us-ascii?Q?FKdVZ8g5imB9N/0wvAtz5bQT9Lcv6rQkjXxTAHDW4E0hPh7d00vEU0hkbfEa?= =?us-ascii?Q?f82ob7wYDqU0FuX982fEdxVvGrmYFpm5NDFWeDK0flwPYnIhCR96SEjekhE+?= =?us-ascii?Q?fi2sZgWiamt9+dGi5hPcixOCn8vZBE/vr2664RSyZph01ZyhUPMSBeMcVfs0?= =?us-ascii?Q?q8Z7sxItUUCclsbZOBJYff5FlszK5lf0MHkV4l4Pmpazarr9mqoqxV6S77sp?= =?us-ascii?Q?gdKpZWoKCE5g/sPxqEzFRooCZ1dd3VLmGZUrIIq8Lk/Hjt9cR3TzrvJDmYOK?= =?us-ascii?Q?zOc3kBzCLV9oLlXD3wNeVQyKSCaVAjIjZpaJzWnYifFWkk0mL8rzYep7Bny5?= =?us-ascii?Q?fw8/m/tsQigg5RI3eabDSgtkVgX5v98CfjvdFeXGWKO9mfNTSvranvbTty6c?= =?us-ascii?Q?SOvWvafo9CPRP+7cQz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+Z8YpIZmUNX3FnY88yrOco2kE=; 24:ShSIwgjmfKHR3h6j3ZZ6Wj9Ab/Xdz4+3rkOunSajn/OfkSdNUz9yjeaXn7x6ggyXyzFxhRlR3dvGhDdv0Myo8ZRXkpxtbtHh79D4oh+tQYI=; 7:fqPzOfi/vL9UWASoO61h4+qh89I4Efmz5bWMnis91Vq6Wr7RbHTrKa1aQ8DAfxAfdWoO4L+ZM1htGTcc0SrK00lyM3/86QWHSIlcKBPoOuMr8PVB8ZKE1HdpyAf9y05+pix9vBlq0zgmZq5/wuGxALyLrTbgf8fBwugvPnVijxUEQjYeF2bdp9MqIzHRen0S17S0niQnfRGI/RnpEk/f/StVU2aHvb8zLkHUT75i4KYEYBb955Xt2KezrUXCRjpQ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB0052; 20:KPEV79ziMGwz6vu53OnHDST4IY2tPZ8Zw3n9J8Nijb68uzlbz35IA0EWDu6ZMcP0v76Abqa+gAt6DxmwPddAirbCVilh5E87D+3Eo7JtF5DG+P/E3BRQR9+xdxKZuFBeMH9B6kiNe+t9G5gA4xa9tMXub4IXAmj05x6fokPHXgNYfhXfA6hu6OK/9gExonU02ES1shRV3VN4WTQ+kTmxPG+qUlgq0TQbimRb0oAw4u3nsvGLHEgicyEa8eGmlNy7 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2017 09:33:15.0880 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4b936ada-5f9b-4daa-ea94-08d530c2e42a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1201MB0052 Cc: Roger He X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Change-Id: Ide96a1ccad9bb44b0bb0d80e123c2d810ba618ed Signed-off-by: Roger He Reviewed-by: Christian König --- drivers/gpu/drm/ttm/ttm_page_alloc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index 2b83c52..27b2402 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c @@ -520,8 +520,7 @@ static int ttm_alloc_new_pages(struct list_head *pages, gfp_t gfp_flags, int r = 0; unsigned i, j, cpages; unsigned npages = 1 << order; - unsigned max_cpages = min(count, - (unsigned)(PAGE_SIZE/sizeof(struct page *))); + unsigned max_cpages = min(count, (unsigned)NUM_PAGES_TO_ALLOC); /* allocate array for page caching change */ caching_array = kmalloc(max_cpages*sizeof(struct page *), GFP_KERNEL);