From patchwork Fri Feb 9 07:30:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "He, Hongbo" X-Patchwork-Id: 10208347 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 0A91F60245 for ; Fri, 9 Feb 2018 07:30:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA0452973F for ; Fri, 9 Feb 2018 07:30:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CDC3E296F2; Fri, 9 Feb 2018 07:30:32 +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 DD2F2296F2 for ; Fri, 9 Feb 2018 07:30:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7EB4C6E600; Fri, 9 Feb 2018 07:30:30 +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-sn1nam01on0070.outbound.protection.outlook.com [104.47.32.70]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6BB3D6E600 for ; Fri, 9 Feb 2018 07:30:28 +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=1M6e6SmOjycjrl7k4Jro8B/RZrtz5N4MTTE1+xwHuCc=; b=CyBDXOQhOa5hhX0s0KpHCBwRag3eFbWDbF0XDz2dO3S+KgmfErJr4OrQNrdOopn1BLqAE2AuTLaU553y0aG5h6ZGMjiMRHgBkZXI+xXHIRcdM8hRDfnezIgEVM5hjl4GHvxC1fAw0Rlehrexbr4+mDNO7E7UknUSNX24/7Y8dPI= Received: from BN4PR12CA0009.namprd12.prod.outlook.com (2603:10b6:403:2::19) by BN1PR12MB0004.namprd12.prod.outlook.com (2a01:111:e400:52::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.485.10; Fri, 9 Feb 2018 07:30:25 +0000 Received: from DM3NAM03FT056.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::209) by BN4PR12CA0009.outlook.office365.com (2603:10b6:403:2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.485.10 via Frontend Transport; Fri, 9 Feb 2018 07:30:25 +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 DM3NAM03FT056.mail.protection.outlook.com (10.152.83.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.485.12 via Frontend Transport; Fri, 9 Feb 2018 07:30:24 +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, 9 Feb 2018 01:30:23 -0600 From: Roger He To: Subject: [PATCH 1/3] drm/ttm: add bit flag TTM_OPT_FLAG_FORCE_ALLOC Date: Fri, 9 Feb 2018 15:30:17 +0800 Message-ID: <1518161419-27346-1-git-send-email-Hongbo.He@amd.com> X-Mailer: git-send-email 2.7.4 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)(39380400002)(396003)(39860400002)(2980300002)(428003)(199004)(189003)(26005)(106466001)(2351001)(47776003)(7696005)(4326008)(51416003)(575784001)(53936002)(48376002)(86362001)(50466002)(478600001)(68736007)(8676002)(81156014)(97736004)(36756003)(6916009)(59450400001)(50226002)(8936002)(77096007)(81166006)(5660300001)(186003)(2906002)(336011)(305945005)(53416004)(54906003)(104016004)(72206003)(6666003)(316002)(356003)(16586007)(105586002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR12MB0004; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT056; 1:FbU8Zfw3XU4cAbMSnjpt5kUlvkzUCzWKGlEilYW1qadGnp+eoRm9x1GQqH0kbyzBXbY631l8s9t8SIwVCL8CTO/Y2wlovIJWkF0+dfjPb54OVa9WEDKgXGYvjVv/soK6 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7df5e992-5ab6-4178-9756-08d56f8efbf0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060); SRVR:BN1PR12MB0004; X-Microsoft-Exchange-Diagnostics: 1; BN1PR12MB0004; 3:mroEiECVXLultc9uASVWwByjWRlukg/tBucwCDBVkeFCIG2r7noffeVev0D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PhsTBTIH26c1oZ/OaYKi4f9za3Hd5Jn5aTwxQ/dPJe5PbVXV2rLbzHjl1QD8Wj+phSxkkYo71xUJqx4PVqKLKVRYnsTJy3Sq/oQwuNEoUoGCjdv1G4NZvWpkfy0qL9xsMXm+oVEotwz5CbH1FSDoBfx/R00Z7VtUu224CUsfMGySHhWsR3Ehf7E0GF1fBomOTN7EqX/p2Lc6LTnfGDw5HIZIqKi3IyOmmRm8CvrrdOS3UeyXVRXnwixm8VPTAPP4tSkp+Uc8UH8YJIxtCOMIacIMxilMj4tR/MtqjCjDD5rxDCEPh7wtunYJrfMbaC/8D6olpSMa5hyG9NIpLOt0orNG8UrQGO4QSbMcwdkiIhdvaKie+F2o0Z4ZpxpFUwEfJES9DJqnZAm3cl 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)(3002001)(3231101)(2400082)(944501161)(10201501046)(93006095)(93003095)(6055026)(6041288)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:BN1PR12MB0004; BCL:0; PCL:0; RULEID:; SRVR:BN1PR12MB0004; X-Microsoft-Exchange-Diagnostics: 1; BN1PR12MB0004; 4:5qOBnXC4jtItnbxH9aoIbsDbpyAM3caZgN01mho53REpqhvvkSPbeZWZe0uhuTxtQ4x+9yA7wxZHKolwIK/rD8x+hAvzbHcIC0K7t8V+/goXf5TQbE3LyVEtbqLv/Yd6J0e0jdOZhlaO8C8YqffYD5KRPHYtGkZ4+IJnhJogVK+k6o9T9zoZq8SyxCfDFCAnnQwiEf/gL0Hsdwe1ZAj9Oy9Rlw8YRkuMOdrtvGig/RyCGzPEDoDLheozCNvDlJ7ZdxSWstpQNPPcqqWq2r0zz8o+gSfXQHIlznIdCu1/+AX/yzw+qTcYZJ5pRFtOxKiU X-Forefront-PRVS: 057859F9C5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR12MB0004; 23:DtUxA4Z1RvrkoPfcOc7rqEX8gOWrwHsJ05L0i63tF?= =?us-ascii?Q?tiUMAuHchv7gqL1JylhYnRNPVvLcSsHazR8ebhohall8LNPernfdmqO5tVvv?= =?us-ascii?Q?PhGc4d95LB/Y+6c6ECzoHTrorHtuEgBzXVrg6VlvLQFpxks3XvuOZJIjXBrp?= =?us-ascii?Q?1v5XaCJrszhgdiGlzkf0a7YDAzJFcxNTuluubwRiGbnyO073X0z9bcHx7PQX?= =?us-ascii?Q?6p2a+ay57kizSP1KQ9bsjWFaK3B1uBgxzQSgkroRhy0ZeuUr0vdX+2f7ot7n?= =?us-ascii?Q?i+OSlofZVpeltF6n8F9pET6KDtX0Tk10tyHOLH9GVeRvXB1TqJOcAomjKIpr?= =?us-ascii?Q?Lp3OwK4uLXa1V7wWsCrY/6WD7s2FfHyoPMcvqZP2/298qvhxaY479AJhUIn4?= =?us-ascii?Q?bRnqxxgTu4Q7CW1jzd1g40rg39xCUiVLdjuwDrCa5bdWXf8tYnw5fjsDFmrn?= =?us-ascii?Q?VbHdF/VbeWjI+BFA+aJlWdP0mQAv2ln9yv0xzsmdJYKaTqpz5oRXMrgHm873?= =?us-ascii?Q?9ydpssb3SMaAZepyOF/GkwqRjaKooPO/O8H2meVySgx4U19wse9GkNLrHSEQ?= =?us-ascii?Q?5C3eqdYxyrBXiKvRmLxiYc1X3L25cRtP6RMWsbDa8TasYqWHubb9ZdotspmZ?= =?us-ascii?Q?D/GfzJqqco7DxG6KOY2w/4G6M3ILbn9EMj2KqvjJOFTcpCHsOSj3P0bi3pug?= =?us-ascii?Q?d9kXRRNiDmZgNhIHpRdwwNArGSQXXCBknB1eeLvXkbaPxe7ScHcBw34FWAQK?= =?us-ascii?Q?Qo8s3akpGKmdHgqoCxhRZXMMmkWeE+5JA9HqIYIURcW8+VQnRGSPJ3oMLUBF?= =?us-ascii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Q2kBUeTScVgQ9EbsI02oLhu9whlcovPkRp4vI/QgzppWiGrO5D+NJsW9aY6iz1I1U04x0M8eI8GjdA2Wltdgn95vTBBeVCkIWGO+v+eAk8T2smvM2QFyxAvJlKZt7MRH9GB5v55OfxCmL3rAcHRU3ogAIfyNcOiyHfefhaeXxuiq+HlGmOF0Onv+MjwQHTywVPoMrJ2aDBpfAiX5EwAheo3uvf SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN1PR12MB0004; 20:7u1XGq8+gKuO6cFrHqv+lqPRn9yYYmfA73WQgi4DNKoAt3qaaHy+v0BB9vwEpTHkoFrld85yWSHZw0GBT0OKjm2jdjd0KBR/K6DqNUaxeDIIpRfm7k7haciyLLPUVfdwLT/VwF92Zi3k/6KVmReR2wEOLHBfaHNC6rPrtnrryzlkS3fUFsS4a5CRHNOpiD9B2icmyqVCju8jzWlYkhMxQZ+Qu0lVJ3NqkbblL8mRbQgYi/2EL66XibcBVzNYEHnk X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2018 07:30:24.4430 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7df5e992-5ab6-4178-9756-08d56f8efbf0 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: BN1PR12MB0004 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 set TTM_OPT_FLAG_FORCE_ALLOC when we are servicing for page fault routine. for ttm_mem_global_reserve if in page fault routine, allow the gtt pages reservation always. because page fault routing already grabbed system memory and the allowance of this exception is harmless. Otherwise, it will trigger OOM killer. v2: keep original behavior except ttm bo with flag no_retry v3: forward the ttm_operation_ctx to ttm_mem_global_reserve Signed-off-by: Roger He --- drivers/gpu/drm/ttm/ttm_bo_vm.c | 6 ++++-- drivers/gpu/drm/ttm/ttm_memory.c | 18 ++++++++++++++---- drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 1 - include/drm/ttm/ttm_bo_api.h | 4 +++- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_bo_vm.c index 716e724..313398a 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_vm.c +++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c @@ -224,7 +224,7 @@ static int ttm_bo_vm_fault(struct vm_fault *vmf) cvma.vm_page_prot = ttm_io_prot(bo->mem.placement, cvma.vm_page_prot); } else { - struct ttm_operation_ctx ctx = { + struct ttm_operation_ctx ttm_opt_ctx = { .interruptible = false, .no_wait_gpu = false }; @@ -233,8 +233,10 @@ static int ttm_bo_vm_fault(struct vm_fault *vmf) cvma.vm_page_prot = ttm_io_prot(bo->mem.placement, cvma.vm_page_prot); + if (ttm->page_flags & TTM_PAGE_FLAG_NO_RETRY) + ttm_opt_ctx.flags = TTM_OPT_FLAG_FORCE_ALLOC; /* Allocate all page at once, most common usage */ - if (ttm->bdev->driver->ttm_tt_populate(ttm, &ctx)) { + if (ttm->bdev->driver->ttm_tt_populate(ttm, &ttm_opt_ctx)) { ret = VM_FAULT_OOM; goto out_io_unlock; } diff --git a/drivers/gpu/drm/ttm/ttm_memory.c b/drivers/gpu/drm/ttm/ttm_memory.c index aa0c381..154719b 100644 --- a/drivers/gpu/drm/ttm/ttm_memory.c +++ b/drivers/gpu/drm/ttm/ttm_memory.c @@ -471,7 +471,8 @@ EXPORT_SYMBOL(ttm_mem_global_free); static int ttm_mem_global_reserve(struct ttm_mem_global *glob, struct ttm_mem_zone *single_zone, - uint64_t amount, bool reserve) + uint64_t amount, bool reserve, + struct ttm_operation_ctx *ctx) { uint64_t limit; int ret = -ENOMEM; @@ -479,6 +480,15 @@ static int ttm_mem_global_reserve(struct ttm_mem_global *glob, struct ttm_mem_zone *zone; spin_lock(&glob->lock); + /* + * to cover two special cases: + * a. if serving page_fault allow reservation anyway since + * it already allocated system pages. Otherwise it will trigger OOM. + * b. if serving suspend, allow reservation anyway as well. + */ + if (ctx->flags & TTM_OPT_FLAG_FORCE_ALLOC) + goto force_reserve; + for (i = 0; i < glob->num_zones; ++i) { zone = glob->zones[i]; if (single_zone && zone != single_zone) @@ -491,6 +501,7 @@ static int ttm_mem_global_reserve(struct ttm_mem_global *glob, goto out_unlock; } +force_reserve: if (reserve) { for (i = 0; i < glob->num_zones; ++i) { zone = glob->zones[i]; @@ -516,9 +527,8 @@ static int ttm_mem_global_alloc_zone(struct ttm_mem_global *glob, { int count = TTM_MEMORY_ALLOC_RETRIES; - while (unlikely(ttm_mem_global_reserve(glob, - single_zone, - memory, true) + while (unlikely(ttm_mem_global_reserve(glob, single_zone, + memory, true, ctx) != 0)) { if (ctx->no_wait_gpu) return -ENOMEM; diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c index b122f6e..354e0e1 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c @@ -944,7 +944,6 @@ int ttm_dma_populate(struct ttm_dma_tt *ttm_dma, struct device *dev, i = 0; type = ttm_to_type(ttm->page_flags, ttm->caching_state); - #ifdef CONFIG_TRANSPARENT_HUGEPAGE if (ttm->page_flags & TTM_PAGE_FLAG_DMA32) goto skip_huge; diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index 872ff6c..2142639 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h @@ -278,7 +278,9 @@ struct ttm_operation_ctx { }; /* Allow eviction of reserved BOs */ -#define TTM_OPT_FLAG_ALLOW_RES_EVICT 0x1 +#define TTM_OPT_FLAG_ALLOW_RES_EVICT 0x1 +/* when serving page fault or suspend, allow alloc anyway */ +#define TTM_OPT_FLAG_FORCE_ALLOC 0x2 /** * ttm_bo_reference - reference a struct ttm_buffer_object