From patchwork Tue Jan 16 19:50:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 10168015 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 0ED84603B5 for ; Tue, 16 Jan 2018 19:50:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0314B237A5 for ; Tue, 16 Jan 2018 19:50:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E943D26253; Tue, 16 Jan 2018 19:50:27 +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 0CCAC237A5 for ; Tue, 16 Jan 2018 19:50:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3BA4E6E2AC; Tue, 16 Jan 2018 19:50:24 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0063.outbound.protection.outlook.com [104.47.42.63]) by gabe.freedesktop.org (Postfix) with ESMTPS id 47CB76E2AC; Tue, 16 Jan 2018 19:50:23 +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=dOirC83ioaYN2n7kcL/ZmDL39q7LZskmMuoQSFiCZug=; b=eWzb60LUEfAUUhq6apiMtp5bWHjkFMWutN03XxiJK4vJuJxUMQDNF0F6/vELOx07+9Wq5FnZlv8fAZPM1Xvp7qvG8Bsbca0Y3GPRssb3TaciXH3UXjA2vaYUHjcvFiPmPe29NQB2MegVvLnRc0mHidYkuaTsvjdacxigUkp4EUs= Received: from MWHPR12CA0053.namprd12.prod.outlook.com (10.175.47.143) by CY4PR12MB1446.namprd12.prod.outlook.com (10.172.71.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Tue, 16 Jan 2018 19:50:21 +0000 Received: from BY2NAM03FT043.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::208) by MWHPR12CA0053.outlook.office365.com (2603:10b6:300:103::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.407.7 via Frontend Transport; Tue, 16 Jan 2018 19:50:21 +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 BY2NAM03FT043.mail.protection.outlook.com (10.152.85.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.345.19 via Frontend Transport; Tue, 16 Jan 2018 19:50:21 +0000 Received: from agrodzovsky-All-Series.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.361.1; Tue, 16 Jan 2018 13:50:20 -0600 From: Andrey Grodzovsky To: , , , Subject: [PATCH v3] drm/amdgpu: Use new TTM flag to avoid OOM triggering. Date: Tue, 16 Jan 2018 14:50:11 -0500 Message-ID: <1516132211-32035-1-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <4a3881f0-a656-e1fa-ad93-cfb7e24bbd9e@amd.com> References: <4a3881f0-a656-e1fa-ad93-cfb7e24bbd9e@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)(396003)(376002)(39860400002)(346002)(39380400002)(2980300002)(428003)(199004)(189003)(305945005)(97736004)(54906003)(6666003)(110136005)(356003)(8676002)(81166006)(2950100002)(6636002)(81156014)(2201001)(316002)(5660300001)(86362001)(77096006)(50226002)(8936002)(68736007)(53936002)(106466001)(478600001)(104016004)(2906002)(36756003)(72206003)(53416004)(48376002)(105586002)(4326008)(450100002)(50466002)(7696005)(76176011)(47776003)(51416003)(16586007)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1446; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM03FT043; 1:Q8qcmCBKHxXytI5CRCfdesVjEcS0YrTO1N8qJzNV3GjooXvsqjTp27XKT1Dqy2pdaEUI3wogrAJoecYNU7JMhB88M+UTozioGozjIFF4SSyizJI+ySk0tj9lrVikuw5k X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fb74261d-6763-4686-05c0-08d55d1a608a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603307)(7153060); SRVR:CY4PR12MB1446; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1446; 3: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cQXdL3+S/Ig++CYL52S7pzEkbZB9JuARWkDoszSMn+kGfDF3OsTVFlCxbfjjF+vHKOKDJxD6ZxUGZaDHKiq5zeYEpVk9HnIXynPIcSXzT0D7+wYg5DgXNT64ucVINxQhHqwgEYgdSOQmLwuWZ+Cotml1wia+6uV1mzCvWF6JIMrIV/K9WYAx66+Yj8FWiOTdOfakI2AiVnnythv9bsUhwgCDd4idiHbWrZqxHK8bMZuq2fpzWMLuE/Mkmxw8ULEC4LZyGE4GKaB8iTb7dZH7mh9tebodYlemiH7tkO+pHruV/mQnwfQI4UwWadiQeRs5mFfUlsKDwr31mTTCawSA7RS4lKNXiBbj9OUCO61h+UjNmFl50UmrLODHKKorl5kE4vVuiU3Jc2yT1KjrriA6/n9cuYPoJQ2Gm5jUhP4Os7CcpNRApjJ827tHg+Af+XJOjGUZmUb X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(3002001)(3231023)(944501161)(10201501046)(93006095)(93003095)(6055026)(6041268)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123562045)(6072148)(201708071742011); SRVR:CY4PR12MB1446; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR12MB1446; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1446; 4:Yq3rW9KaPwHhU3vyd2Jo7lArH9FIAwaLXtdoFKno+uWwizIRGVDxAlAYagCkoacU1JnUzFWFsHAyGEJwqPCylsZSTBvzoy1/y5dq1shpkh1VV5l/vlBZHZeV7I3j7+JXt0xnLi/7YnyFsi3SuKojVhSPOt0PC5PEkUiOeUxh5JC709FB9D6AuaMLKm2EIF9GzCVKuGXSRInCnjrDWuinMWGsEGdPgGHuIi9BqbZa8my3X/GuuPNL0gAypDJHusByK4QfNh/XOy5XhaUxmFvWLwwJJv5Wh0tUdRrCraWA46hoiayIQqz/WPRGZbHAn9yn X-Forefront-PRVS: 0554B1F54F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR12MB1446; 23:+Ok9M/NAS+5GgqQHeCe971SF2oJYVw1g23DHOxKNh?= =?us-ascii?Q?gPSbtN9pAlvkDi0O+qtt3t1+2VZU8yWbahGPuL2u/tN+B8vuHcO0VVMOThxk?= =?us-ascii?Q?/9HoHZDd95bPM2z02PXrlM4cPt+yHSZ43YUmWF7V8D5cIAsZfDaPnIzBRNCA?= =?us-ascii?Q?K0yLhjum6UTXJLgb9au1BbrgxK5IqrUvRjQAa440RlkI0glCYz4X5CbiqMKv?= =?us-ascii?Q?RLtFZSnVLZj6SlleIHun2v6/hFhRtieuzso/QjSJlRlf+on4rPmoYFg1LWL4?= =?us-ascii?Q?36P2gAxCp5gSvklBOUriG31FfbcKTT5O+LCdEF+gK/0NciAmKS6vKHMzwKB4?= =?us-ascii?Q?50CQWUk+TMWdxBy3pxS9Q1dMKiLBiMJJo5/PY104WJ9tcMm5yueU11/8sK5M?= =?us-ascii?Q?UxJZdOo0vs8QuNE/giyJHpC5o4T6jyBqcemGsf5RWoKwLkTrU2Vjn5r+zjf/?= =?us-ascii?Q?kQ+o2s529fyR7JsOIz91z+21Y6xDIknvs/LejXZS7u+YY/0a5qLKJjfqYW7k?= =?us-ascii?Q?iwuKTEDofhiVgXdgRFPfwiU+O9N5XsWG6gFT57vYpsh1NmSu5XsLgEqyUQqm?= =?us-ascii?Q?nG+1BIugpGGJgHOgcGejgd2fNpbP4lcT/Fe9SoMFGMK7Lm9L1NQ5vOO9vC7Q?= =?us-ascii?Q?ymTu9UuueGSNH0V0pbaJJtdoBnq/F+Zh1+UAP/t1CyhuMwqcDpl/LG+s5rbQ?= =?us-ascii?Q?YCMbZ58enEj/ITpcjlEydwHC365eNeJs9zqSy0yGeMtsJ5T51LJvOeCuOGHg?= =?us-ascii?Q?4aLoyVlqzSqQNN6LvMLs/WY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ua+5UwPcBGfqYp0PgCQQ7TU72A=; 7:DT9w4XOFmbqtBUwMjbBYL0C+iJUyOLJUb8dD6fXStxJ0fQoPtlHPY5ZHeyrRKf+maaBPxJgj0hGm+Zdv+knEI9KYzcXV7JctYoQUS7QF3wykhvLhTn8VcEp4/eNYqf1PDDkT9eC+Ca2cdZKPN1Rs26FSV4KJlEQijixPl+WMW+n2iBq+M9psjJgII9/DHArVh1v+rx32FbG3B8sXfEZ6trt41PRRbe6oaFu0SFbJSitTn86e4lE2fD0B0H3FNlhq SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1446; 20:YYrR4PEHoFhJeqf7YIZ0aodTmYmHPuNIKQ6CyR+7eKh8vbaCvaDV2JPVjNqRieYiD6sQOmbsJHNaJT18AAicmwf0mXkqP69+3aBZ7M2dnx3iNkTwQ67BssNDr7jOYhfUae8FrGI/ruhja27WxhFGDJmtOEoDO3xSlYP7gnKnVzfgz9EzR4BrkJ8VUNnGSRBDGtcBLNUjl/HoOI0SaB5M1Mui69rmiOs+HAl08lv4e/s4FGvAPRXjk0TmasaP5K3c X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2018 19:50:21.1421 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fb74261d-6763-4686-05c0-08d55d1a608a 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: CY4PR12MB1446 Cc: Hongbo.He@amd.com 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 Avoid OOM on syatem pages allocations. v2: Remove modeprobe parameter, make this behaviour the only option. v3: Move setting no_retry flag into amdgpu_ttm_init. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 290cdf0..d32f482 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -1387,6 +1387,10 @@ int amdgpu_ttm_init(struct amdgpu_device *adev) return r; } adev->mman.initialized = true; + + /* We opt to avoid OOM on system pages allocations */ + adev->mman.bdev.no_retry = true; + r = ttm_bo_init_mm(&adev->mman.bdev, TTM_PL_VRAM, adev->gmc.real_vram_size >> PAGE_SHIFT); if (r) {