From patchwork Tue Dec 12 10:09:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "He, Hongbo" X-Patchwork-Id: 10106577 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 EC0866032B for ; Tue, 12 Dec 2017 10:09:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E078D29B71 for ; Tue, 12 Dec 2017 10:09:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D542329B74; Tue, 12 Dec 2017 10:09:20 +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=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 35D7E29B71 for ; Tue, 12 Dec 2017 10:09:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CAD5289E5F; Tue, 12 Dec 2017 10:09:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0059.outbound.protection.outlook.com [104.47.38.59]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5EC5989E15; Tue, 12 Dec 2017 10:09: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=9yVG3NRUs/YJwj6hnNC5hrV2sHJBHp5ModpnWHNnXvw=; b=AOsgGiYR+AgCNlzpVwN/6UzGFehY7z9bDeM+lssEuB/InDW5GgfMEwIOkHZdwIKwUs5TKPs/zX57pCM+yf0O0JXZUKz49c0gh2ZIh8xLLIUWwfmLdSm4S44ExWVjhbc1mKRTx2t/bJOdjKtDNpIuAkD1pljNRT/muUnlXI4yxDQ= Received: from MWHPR1201MB0127.namprd12.prod.outlook.com (10.174.98.142) by BLUPR12MB0449.namprd12.prod.outlook.com (10.162.92.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Tue, 12 Dec 2017 10:09:14 +0000 Received: from MWHPR1201MB0127.namprd12.prod.outlook.com ([10.174.98.142]) by MWHPR1201MB0127.namprd12.prod.outlook.com ([10.174.98.142]) with mapi id 15.20.0302.014; Tue, 12 Dec 2017 10:09:12 +0000 From: "He, Roger" To: "Liu, Monk" , "amd-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" Subject: RE: [PATCH 1/7] drm/ttm:fix incorrect calculate on shrink_pages Thread-Topic: [PATCH 1/7] drm/ttm:fix incorrect calculate on shrink_pages Thread-Index: AQHTcy9PCioJ4tAWxkuaGmP27P9WP6M/e9tA Date: Tue, 12 Dec 2017 10:09:11 +0000 Message-ID: References: <1513072005-3477-1-git-send-email-Monk.Liu@amd.com> In-Reply-To: <1513072005-3477-1-git-send-email-Monk.Liu@amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Hongbo.He@amd.com; x-originating-ip: [116.228.147.241] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BLUPR12MB0449; 20:F01L5v65q9vBCjhTK8oe7u8r6Z4zvnpYip9YsC2EyzIYukU7UUvwl6MWNaW3zuOivQMLv9mrm7aArGApJytp0U1YT4WgKLid/TfH2ev1IZ2Eg2JeVRdy59VTyBuKLey3syKe8hYfuVkDSHDT3IcuA/3elEqs4i9+fNs668VYcDcsCgC3jptUXmrQQjV6tKai0bnE/XcK2J0uOFUZ2081h9sKrwLHKmlOqdqNOy57K3UVUcsVMNWD+Tx4WwqUB8QU x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10009020)(7966004)(376002)(346002)(39860400002)(366004)(13464003)(199004)(189003)(305945005)(8676002)(77096006)(81156014)(68736007)(102836003)(8936002)(76176011)(3846002)(508600001)(6306002)(55016002)(9686003)(966005)(53546010)(72206003)(14454004)(97736004)(4326008)(2906002)(6116002)(86362001)(450100002)(2201001)(3280700002)(6436002)(7696005)(59450400001)(3660700001)(25786009)(105586002)(6246003)(106356001)(66066001)(99286004)(2501003)(33656002)(316002)(7736002)(74316002)(81166006)(2900100001)(2950100002)(6506006)(5660300001)(110136005)(53936002)(229853002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR12MB0449; H:MWHPR1201MB0127.namprd12.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; x-ms-office365-filtering-correlation-id: 1b896286-873f-4cfb-eb02-08d5414864a7 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603307); SRVR:BLUPR12MB0449; x-ms-traffictypediagnostic: BLUPR12MB0449: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(767451399110)(217544274631240); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3231023)(3002001)(6055026)(6041248)(20161123564025)(201703131423075)(201703011903075)(201702281528075)(201703061421075)(20161123560025)(20161123558100)(20161123555025)(20161123562025)(6072148)(201708071742011); SRVR:BLUPR12MB0449; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BLUPR12MB0449; x-forefront-prvs: 051900244E received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1b896286-873f-4cfb-eb02-08d5414864a7 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Dec 2017 10:09:11.9971 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR12MB0449 Cc: "Liu, Monk" 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 Reviewed-by: Roger He Thanks Roger(Hongbo.He) -----Original Message----- From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf Of Monk Liu Sent: Tuesday, December 12, 2017 5:47 PM To: amd-gfx@lists.freedesktop.org Cc: Liu, Monk Subject: [PATCH 1/7] drm/ttm:fix incorrect calculate on shrink_pages shrink_pages is in unit of Order after ttm_page_pool_free, but it is used by nr_free in next round so need change it into native page unit Change-Id: I33b77ac1616e24b1b881eee54c3bd7342cfa9ab8 Signed-off-by: Monk Liu --- drivers/gpu/drm/ttm/ttm_page_alloc.c | 1 + 1 file changed, 1 insertion(+) -- 2.7.4 _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index 44343a2..71945cc 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c @@ -455,6 +455,7 @@ ttm_pool_shrink_scan(struct shrinker *shrink, struct shrink_control *sc) freed += (nr_free_pool - shrink_pages) << pool->order; if (freed >= sc->nr_to_scan) break; + shrink_pages <<= pool->order; } mutex_unlock(&lock); return freed;