From patchwork Fri Feb 2 07:22:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "He, Hongbo" X-Patchwork-Id: 10196335 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 89F30603D7 for ; Fri, 2 Feb 2018 07:24:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71DD728DF4 for ; Fri, 2 Feb 2018 07:24:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6639C28E09; Fri, 2 Feb 2018 07:24:16 +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 01C9928DF4 for ; Fri, 2 Feb 2018 07:24:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 354566EFAD; Fri, 2 Feb 2018 07:24:15 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0048.outbound.protection.outlook.com [104.47.32.48]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2CFC26EFAD for ; Fri, 2 Feb 2018 07:24:13 +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=VMra6je/7uReOWuwlDQjpzAdExvHxeSveRiOgjzTthg=; b=Cs7yzN7Crm1g2ULjyWBEGonIQt9LS6XfOzlUwpHTste8hpeC0GePGwwdmTcfzpt4oYs7zyiYjZMosg5sLwjDDQ2KZdww+NazRBXDv631a2UL7SAp0Ho9DKRgGiKUDDDyiF3VAeTwE5nUZtZmhETy5Fnp4+ig5TeTQPwNGacUoRI= Received: from CY1PR12CA0081.namprd12.prod.outlook.com (10.163.230.49) by DM5PR12MB1451.namprd12.prod.outlook.com (10.172.38.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Fri, 2 Feb 2018 07:24:12 +0000 Received: from DM3NAM03FT015.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::200) by CY1PR12CA0081.outlook.office365.com (2a01:111:e400:c42b::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.464.11 via Frontend Transport; Fri, 2 Feb 2018 07:24: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 SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT015.mail.protection.outlook.com (10.152.82.195) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.464.13 via Frontend Transport; Fri, 2 Feb 2018 07:24:11 +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; Fri, 2 Feb 2018 01:24:09 -0600 From: Roger He To: Subject: [PATCH 5/5] drm/ttm: keep original behavior except bo device with flag no_retry Date: Fri, 2 Feb 2018 15:22:25 +0800 Message-ID: <1517556145-23505-5-git-send-email-Hongbo.He@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517556145-23505-1-git-send-email-Hongbo.He@amd.com> References: <1517556145-23505-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)(376002)(346002)(396003)(39860400002)(39380400002)(2980300002)(428003)(189003)(199004)(316002)(86362001)(6666003)(356003)(53416004)(59450400001)(105586002)(4326008)(7696005)(51416003)(76176011)(48376002)(36756003)(50466002)(106466001)(336011)(186003)(81166006)(26005)(81156014)(68736007)(97736004)(77096007)(2351001)(72206003)(2906002)(8676002)(478600001)(53936002)(54906003)(47776003)(104016004)(6916009)(16586007)(50226002)(5660300001)(305945005)(8936002)(2950100002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1451; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT015; 1:W2kF8Rqqef2zvHOW/+KbGqP+hioC1CnLg1IJRU+GYhgqchHRK6TAHfA8rEpGhUm2SUSSo7G4voNFyI4Lgk4VsaCe0AE7x1eqGtXuAnAYUu2ksiX6VQSaoySDK4m2IwKY X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5be41fff-ea1f-4d0c-34a1-08d56a0df4d9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:DM5PR12MB1451; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12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PPEChKjrAG6xCvswnzIdH2draPMBBLzuKo177//dLvxh8wfqJAQnrpkdW2P5itX0jIjQKTwnmsH8Ne3MRg2joKx6rmkWZFmfOot5T1OIzc3vhkUBevBiImmlkCsM44Y8eVZUzJzD7YX7RQ7V1WLbzMMlBr/9aydj0aXsGlb77SR/lYMz8HNKGZdry1g4uUYJXgojlVxeKwGN+49GWx4nyqYPH47BaOEAYJji+ow/TH+Hjo/yfQ/3jCXN2JzdhirJScUITDYxU04N2MzOkWRqtWYXW8N/3u+HvvsibjwveYVmDaEwE4AfxM59oFkyOjlyVflA20odNxhEJfIPrrhkzWKDKbAET0zAYzexsszDT1TANwA9adIIUgIM9gIUBG7KqXX//qRTDlKIWVZ0+AEJvEfNAfVMKg0T+fX9L/okokGHXlyQevPKxG/W0LxiPl4S1Ajof4ZKA X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231101)(2400082)(944501161)(93006095)(93003095)(6055026)(6041288)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:DM5PR12MB1451; BCL:0; PCL:0; RULEID:; SRVR:DM5PR12MB1451; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1451; 4:rvX6ui+il7uaQMvxELiAcggTLaJr/KsCQ5XhLGr8htiH/rc9f0nJ/5FDanAQ7jO6E3NXPFcjJlk15sDXEvrJoeJ/xIj7CcjxZWv7GG6PWL0SneHEfb642QyPkeaEjM0B4uXBMx3qf3nzZYGGva6q3lpIjAukVe8/gUJr64nxyuU7pTBjlUFapk3id1+wud3wSn+uFWXoIZD7jCbvjaAwg09bcB37YcU/intgasE3rxnW3iWRbBWgVN4U3diyP2LthlBv5+MdJcX4OlwPQ4M63Q3Z7F+5mRpW4vhrbo2AbxHoAmhnVSYRLENgLVrEr9Zz X-Forefront-PRVS: 05715BE7FD X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR12MB1451; 23:6UzUWTZ3CCcOAi8bz8e4oXy94XyTnxca5XPpas0sA?= =?us-ascii?Q?ER3YPSTxOGyEv1BtUdpIsiGNKGi0qXXIH3JPdX0tt+Cj8T6gYnhbSyhHIHQC?= =?us-ascii?Q?p0B73sUV2GD8fT7loOtKlQZSNTD0APxqdq5bfmcctsY0scePQlqrg9M6lI0f?= =?us-ascii?Q?EwXS3D4Eceg/mKTQWhgJ+o4tRL826UE8XoGS+qt2RDUr8nRAR50RJoFTulZz?= =?us-ascii?Q?1SKqNVWJ8IrwZ63mx3j/AnZw/QNhYHLdDxlTdZ0jgHras2/C+fEsJCaGB9CP?= =?us-ascii?Q?U7ML3qybApJrhcKKfl/m/jXdX7lEp+9L0o/62SPGWmLbANCZr2nmk/8yDAgm?= =?us-ascii?Q?lUN7u6EomFbA0RPd5enQCb7+XVQ7al0lVmhWB/jNDmP0BAmqqOFR+CZVGY7Z?= =?us-ascii?Q?nsMP4Dnz4xnDv4O59UBwDrOipd8EsRUKHRFDRsqOgJarndmRoDkuhDSszPdF?= =?us-ascii?Q?j+Vxg6jkQg3NKlzhQPq9d9tzcttvQ6OwReNMbgPOD/O2oNG0ShyOuvhxkpmq?= =?us-ascii?Q?94IYC3WCupAM/yynSY5WEJlAZ8hswlTzF13SO3h0+cpcSrOM6Nx4GxhoBPCj?= =?us-ascii?Q?X6QJqjSF6+Xy1TGQIpnU+A69WKztpAQCMwBua0fIknahOeiVyBalcEtFdqeC?= =?us-ascii?Q?ns4O5LUomumAAyy3CuwuqBx/M054mDo/f3kDfmCiK/PHMfFuAzBc3h8rgbz7?= =?us-ascii?Q?9nTXx4Pke1VyP6eNbyM+ezzR7Zso/sGDfshu4B6+4RiDNAorb7EsLGa5BvmQ?= =?us-ascii?Q?OY7iq8i59dUSzpAN/gJw5MHErFX/jSQlFg20Zxfmnt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0uW+5yRNCQ1b+bKc/uC5ex8QRODXJUL8ftk=; 7:tpW4O3ea1wEO0p6g/qYCwN1gZJ1Iv8q0p4hAjN28dGv8PWV8TtpgakrHGuPxoHsdg3icmxT02wKOZ+vYSTDDCbCZ84LmuqJEvXDrSMFtjSnHU7uqoFrqo8AZZwq6sGXGfaK9TZ6BI1cXl5KNePY1v7NLHpZGXFn8z85MN7uZWH1CagkIScmY0SqkqAp7qLdfTYRtGrw9SSlvs19mtw0CDZr2vdEfyjGwJeLHt526dXidr+/fafwUMb63h6f2P/2s SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1451; 20:bYfxotbf0PnmVt9Vyir+rUTazJnJaWsIMBilfqBMcpoOH4yfhMBGUqN1+UXYiZvVueRm2V+UP7sPMICbnZaVyIPC6RqpRsLXKiF1eEodXBSu5oIyOWiXUR7JIClK8Xnu6srUvYtECkDpUmWlWrP/Twg6FHBQo9xjiXFN6w9LEgWs/+zCLMWKKd7YLg9WOTkg0zhyoNLW1+Oz1DqhdjB/1rIyvq5S6jgTVOS7fLHFD9gFjQcA3HK38HkOmsHITsiy X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2018 07:24:11.3881 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5be41fff-ea1f-4d0c-34a1-08d56a0df4d9 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: DM5PR12MB1451 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Roger He , Christian.Koenig@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Roger He --- drivers/gpu/drm/ttm/ttm_memory.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_memory.c b/drivers/gpu/drm/ttm/ttm_memory.c index 875e5b8..25e1ce0 100644 --- a/drivers/gpu/drm/ttm/ttm_memory.c +++ b/drivers/gpu/drm/ttm/ttm_memory.c @@ -503,8 +503,11 @@ static int ttm_mem_global_reserve(struct ttm_mem_global *glob, limit = (capable(CAP_SYS_ADMIN)) ? zone->emer_mem : zone->max_mem; - total_used_mem = zone->used_mem + swap_glob_mem; - limit += glob->max_swap_mem; + total_used_mem = zone->used_mem; + if (glob->bdev && glob->bdev->no_retry) { + total_used_mem += swap_glob_mem; + limit += glob->max_swap_mem; + } if (total_used_mem > limit) goto out_unlock; }