Message ID | 1511329016-552-4-git-send-email-Hongbo.He@amd.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <dri-devel-bounces@lists.freedesktop.org> 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 2EF2B60375 for <patchwork-dri-devel@patchwork.kernel.org>; Wed, 22 Nov 2017 06:11:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20DA829B76 for <patchwork-dri-devel@patchwork.kernel.org>; Wed, 22 Nov 2017 06:11:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 15A8429B75; Wed, 22 Nov 2017 06:11:13 +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 B37F829B74 for <patchwork-dri-devel@patchwork.kernel.org>; Wed, 22 Nov 2017 06:11:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C7A936E02A; Wed, 22 Nov 2017 06:11:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0080.outbound.protection.outlook.com [104.47.33.80]) by gabe.freedesktop.org (Postfix) with ESMTPS id 102CA6E02A for <dri-devel@lists.freedesktop.org>; Wed, 22 Nov 2017 06:11:09 +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=RpozpgA47ulXc9D+mEH6YNz4Q8ad/UdDu4qYhrvoAC4=; b=ikcmF3Re9v1H5JDtly/x03cPF1/041iwGb4A0IMhU1J0NG7wfzGiGcj4rUTXDDc40LFrYpCPzE2/kntTr+4uuJTwMbbUBtXzYSKfeEqBLe3RU0Ujdb2SwDDLk308LGuKSwOTDU7U0t9GYe22f3vQEnBD2hf4ARyBxrRJp+8c1bE= Received: from BN4PR12CA0002.namprd12.prod.outlook.com (10.164.241.12) by CY4PR12MB1270.namprd12.prod.outlook.com (10.168.167.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Wed, 22 Nov 2017 05:38:13 +0000 Received: from CO1NAM03FT031.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::201) by BN4PR12CA0002.outlook.office365.com (2603:10b6:403:2::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.239.5 via Frontend Transport; Wed, 22 Nov 2017 05:38:12 +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 SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT031.mail.protection.outlook.com (10.152.80.171) 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; Wed, 22 Nov 2017 05:38:12 +0000 Received: from roger-build-server.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.361.1; Tue, 21 Nov 2017 23:38:10 -0600 From: Roger He <Hongbo.He@amd.com> To: <amd-gfx@lists.freedesktop.org>, <dri-devel@lists.freedesktop.org> Subject: [PATCH 4/4] drm/ttm: free one in huge pool even shrink request less than one element Date: Wed, 22 Nov 2017 13:36:56 +0800 Message-ID: <1511329016-552-4-git-send-email-Hongbo.He@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511329016-552-1-git-send-email-Hongbo.He@amd.com> References: <1511329016-552-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)(39860400002)(346002)(376002)(2980300002)(428002)(199003)(189002)(8936002)(110136005)(77096006)(86362001)(97736004)(50226002)(5003940100001)(5660300001)(189998001)(47776003)(106466001)(105586002)(6666003)(2950100002)(4326008)(53936002)(48376002)(50466002)(68736007)(72206003)(450100002)(478600001)(305945005)(53416004)(50986999)(2906002)(16586007)(356003)(36756003)(316002)(104016004)(81156014)(81166006)(101416001)(54906003)(8676002)(76176999)(14583001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1270; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT031; 1:otZemK+Lwremt7noPC0f7on1z6T28a0A4qNl0o00ZoadHJnkBmdoRGTmxGqOK+mtGXbT6VlKxAGbdzr2nEojNZroUw8pNlL3kRnOOXo+r+iAvNB46YSI8YLG7xD2TPde X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 205569c2-28df-4e09-6294-08d5316b38b7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600022)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603258); SRVR:CY4PR12MB1270; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1270; 3:eap058FPk1Ixp/tPgaj8rqFtqQNVMY0LKEBa/Xz+siudenpNTJn4Z2pUPWU35ozQrscUURnf3k5kugBncEopJXLwjpp+pM/2eSshrrEoFSEoI5UPYkzMxPeu/e24jDAp9CJeNbsU6QWyLrmMRKx4knd3y1jfy+VbWprbqSQT96Rbzfd/Lvo/aV9pO2iG6vpJiMQ6Yrh2nQa1LSnYLzxke9IW4iw4h/CUr3qFuGA1D5xaW291YuOQonwIUJXebRL2ZQY15GCdB0rT2xMQXaaUYByR4Irme5iEUyvzyrnC/kX0DBlbWBv4NoGpgpjKxjN8y4lgizekee7CKJqFqkvMg3HWXhEFhrCBkQKCTOToImY=; 25:htHRc55o0AyewRqPe88Vis/rPP3CyrA9l++hH/e+jpn5bR5hPD7Pnp3t+0M96hSey6mcYbh894zy6eqkzhTDUOCZq0OlL5faWvDPPd4dxILNGlVqULVIabRPeKCtXC8vGZOm9ZIXNV/KJnMnKenfowJaKL1t+XcejGlK7xEiCqGAUONiE45tz6MNNU8wsoXwiDFSnk1CpDKWKaPJhgF5q7GgNRXSLId8jlQ5CcBHnrmWjG0KPK71ihhnnm3i8+0X54JHo0m2zt4eDibsKqDi8WOv4q5gTEwzsvK01jPC8vnhqHfoE2IlkgR5Td5X7b6ubdIRlRW5Q2asswDa3n2jRw== X-MS-TrafficTypeDiagnostic: CY4PR12MB1270: X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1270; 31:B2EvNxumjjqJ0CgxLF1+XKXJEsuijbDlgorpxL54hVO+6N46vj8FrFs6bZHLKV40O5cc3jun0q5waRtk4YwJ8JUN+a25x0YooR8yiWIj4RJVoJy9ET2VeM2gl9SIFy/X4ce75hvAuZ/sTPfmIjptCp3HhskhDTZkIeJ7c3KzyP/sPssfaDNlqOG5iBS+0UCdXKb5Rj3gaTo3YdFEbxkio/9FbLGjjff2GJmhmV5Dn4g=; 20:lbeNg5VcAdpoPf020nlo5UT5+I91NnDEp+5Fwy96UcbqhErjuyjY7eRjTrLa65h8GkSIelDOk5Y11ilRbNRciQiN5I4+bJEIMbpIE+meSp+9ZL/+p4u3Ksl2Qve9bjpffBTCye1y386d0sfsRTC6QFaTVj8S/upzDi9VoIvV4SoszIrN71n+ybkh/t/Z0h7c1d09H1lKSn+RTGo3PQS3hMCoc1+yd9ZJJmiD/3BTgatw1dLBZ20MsNVSasZAPeh4WAZ8OOcH8vUVStyCM3HGk1a2RnPF5TORyVfljW2TsAkkuXijrz+lnlffGqgSexZsZVgpFPAb1zBiz2K6vUU2ituTg/mii6n0SEb91wEaEdmnZ+KXHy/C3Czy+ZHkSgdNZo6CgO2aezoHTRPl2ZgF7gnb8oIlhLhtFK9w6MgthgPBRcc6GXUnEKLceqkxwS6qygGjgybkgoOs2Uqoz0TNGNe3VlrgRg6A2F59aVt/gGWCrYTS2AUnKemhhmzMh3Ta X-Microsoft-Antispam-PRVS: <CY4PR12MB1270ADF666C100DB9F626B37FD200@CY4PR12MB1270.namprd12.prod.outlook.com> 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)(10201501046)(93006095)(93003095)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123564025)(20161123562025)(20161123560025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR12MB1270; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR12MB1270; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1270; 4:OkYR446XGiaVAe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bTfK2MnxIakdBaUVccNvbIcIS1ATBZAWa1JBlrFfz516dTdftzQOZQZJlwg2ZqJu2haiIM2nuPfeDP1hvcFkC4OmuTjsWoiiohIpTaZlGRl5lMWsl2MAf66mURiXWqQWSFOojQ+s0CMu2jMgMJOD682jRfaYfCx9GwErJ0w=; 24:d4EnMF4hfVxaEwdzdCJWItD/57l2pOvGYzaG2S8OUrK98CyKC+82XBjNmRCcGGrGJO8sDBIed3o8LwVGeVLn6Hfu0xYdKGyfF2E2mu0Pet8=; 7:J5IePLyTCJa2JM/g5hR5GClVGr5u/3cqzhEyWQcnq/Qf/oCwpWD0yuydiu6In4ihs3a+sEBFr1Blx87p4jbH1OY11Vyos3vstztAE8C/5n287tC+Zvd2rWlpiWC20sZKzsgGK1WF9NfBrLtiw5eY898UI27AzoM2Hvcb/QB7ObRGokfc9AcTltSZn8Nmqn/FV+UY2QUEi9d2hgmccSLQivdVTaqpviTw1Xu4+/6B10SOJ9XEzycrFMr9m89O8M+C SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1270; 20:UyNwNQxaDgAdDJ7S+bh0910yJvanjt40TMVi/QNwtuOS7LzaY+Dss585bLzQkP7T0ZCzWKqqdId3uIbgYvonScv4dEvyC3DRZScdQQeRfAS1e5PawVx91juqtMrVL5MmMkDVOt2h6gj0gXvQDwgrSUy2oxfAxg9fisYrXSoWvbuDLIrt8PqPYfH0wbvu8sTFIuQfcops6oKJC+O2L/2uGBgGRrZE8m+/vJYXe8vb62dCbI/D1+YXtajJoDsbBLsj X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2017 05:38:12.3409 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 205569c2-28df-4e09-6294-08d5316b38b7 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=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1270 Cc: Roger He <Hongbo.He@amd.com>, Christian.Koenig@amd.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development <dri-devel.lists.freedesktop.org> List-Unsubscribe: <https://lists.freedesktop.org/mailman/options/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=unsubscribe> List-Archive: <https://lists.freedesktop.org/archives/dri-devel> List-Post: <mailto:dri-devel@lists.freedesktop.org> List-Help: <mailto:dri-devel-request@lists.freedesktop.org?subject=help> List-Subscribe: <https://lists.freedesktop.org/mailman/listinfo/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" <dri-devel-bounces@lists.freedesktop.org> X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index 37c2f2f..f80fc5b 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c @@ -463,11 +463,13 @@ ttm_pool_shrink_scan(struct shrinker *shrink, struct shrink_control *sc) pool = &_manager->pools[(i + pool_offset)%NUM_POOLS]; /* OK to use static buffer since global mutex is held. */ nr_free_pool = (nr_free >> pool->order); - if (nr_free_pool == 0) - continue; + if (!nr_free_pool && pool->order) + nr_free_pool = 1; shrink_pages = ttm_page_pool_free(pool, nr_free_pool, true); freed += ((nr_free_pool - shrink_pages) << pool->order); + if (freed >= sc->nr_to_scan) + break; } mutex_unlock(&lock); return freed;
Change-Id: Id8bd4d1ecff9f3ab14355e2dbd1c59b9fe824e01 Signed-off-by: Roger He <Hongbo.He@amd.com> --- drivers/gpu/drm/ttm/ttm_page_alloc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)