From patchwork Fri Jan 12 22:28:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 10161829 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 AF1B860327 for ; Fri, 12 Jan 2018 22:28:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F9E32896A for ; Fri, 12 Jan 2018 22:28:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 939E828AE8; Fri, 12 Jan 2018 22:28:59 +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 9BFCA2896A for ; Fri, 12 Jan 2018 22:28:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 617446E580; Fri, 12 Jan 2018 22:28:56 +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-bn3nam01on0041.outbound.protection.outlook.com [104.47.33.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id EA1FD6E571; Fri, 12 Jan 2018 22:28:54 +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=CzMt22dxaqKFeTBD/oWfYTE9nJAgcduZVCLKt0DOSZc=; b=dClwkt/W/lYzK65k0MJ5Yc9mW3FIYQxolftKdJ5/XFGGxZJFtycOi2Hp200HZc3C2+AHT7n710EoHaTaW1TgjrE0SVZ3dJswyKM156v3sPxzPOJViKGAk3cQ76LP2gr3gD1tP0zYBqsDfnZaNaFXVyMP1Vi5Wzf2EIZBmUPP9ag= Received: from DM3PR12CA0095.namprd12.prod.outlook.com (10.161.150.143) by CY4PR12MB1445.namprd12.prod.outlook.com (10.172.71.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Fri, 12 Jan 2018 22:28:52 +0000 Received: from CO1NAM03FT038.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::203) by DM3PR12CA0095.outlook.office365.com (2603:10b6:0:55::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; Fri, 12 Jan 2018 22:28:52 +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 CO1NAM03FT038.mail.protection.outlook.com (10.152.81.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.345.12 via Frontend Transport; Fri, 12 Jan 2018 22:28:52 +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; Fri, 12 Jan 2018 16:28:49 -0600 From: Andrey Grodzovsky To: , Subject: [PATCH 1/2] drm/ttm: Allow page allocations w/o triggering OOM.. Date: Fri, 12 Jan 2018 17:28:37 -0500 Message-ID: <1515796118-18971-1-git-send-email-andrey.grodzovsky@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)(346002)(39380400002)(396003)(39860400002)(376002)(2980300002)(428003)(189003)(199004)(81156014)(478600001)(50466002)(47776003)(54906003)(81166006)(86362001)(59450400001)(97736004)(36756003)(16586007)(110136005)(316002)(53416004)(8676002)(6666003)(450100002)(8936002)(305945005)(48376002)(53936002)(5660300001)(105586002)(51416003)(7696005)(104016004)(77096006)(2906002)(356003)(50226002)(4326008)(72206003)(68736007)(106466001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1445; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT038; 1:7LDlMeA81f0RaOHuTk3XhrM1HLRTUnRRW9d/KJyqGDzbFD97dsaA4coneskajJc3e2PNbLLpuH6BoCVqUvTYq4NGrmnqt8lWnTVpAOMbyPp0bvjU5NCUiLohrk/aJG5Z X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4f523a6e-4795-4bfd-166d-08d55a0bdbf4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020088)(4652020)(5600026)(4604075)(2017052603307)(7153060); SRVR:CY4PR12MB1445; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1445; 3:D7NvhuuBvpQ4+/7YCHW1YWFdZU3ydn7y8CHHoJqU2NV3/bRMiGUTz93VXGCrlj8zDfj+J+UBBrma10PTiq55Jhs5yLSF/PsTWKniP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E2SyxTowcI+JRGzlLbluKM/AzhVvsuanw3++arpDvY+R9g0e3HbtUY4PawufRekNdvTssRZMCYxP7LNrBqZ8JhGm3LG8kGQAfMm//7RbVTYvgGUazftJT/UA/WvKJqthJuPOJeDCXn4qDLnp8aeFEiJ9ga6ANiaTa0lu7Jno/9bYGLurP7N0f7MfsUecPHB12jryarEw4oc+PC5BOKuNk91OfB7hQ5VouYqAJVJ4vUSRW6v/lr5//OJz0u9eZO9mA1tufNgVqVTxWX8hErUqtCP6gP32GVkXvQ841gv3+TnijdUxT9X0akMw7jgwXiIYLQw4T1GOsv/Q2EMnkYDc2d2S6S8nv X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3231023)(944501075)(10201501046)(3002001)(93006095)(93003095)(6055026)(6041268)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:CY4PR12MB1445; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR12MB1445; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1445; 4:WWDJtpl02ZWTABbdI7VrlgPbvKbAmsggaXsNwjYvQcqCc4zQXqgegtLC36sIuzeGRfG9vXqIYLSRs5aTZrshB81Z8+D/uQjUhqxZX3AJ9HvS9s+4Cyv5xudLo6opWiodLdJklyuKNlw2MYwAagFE7qfhhsTguE0qgTF567HFMDie6ts/99WWOLvC0acZhRyesXBefZUrjjmsFA/OiaP+ONJZdPRl09QFO3JGPYgvtVlFPgDse+HWAmKz/jnhpqUHucLjumhNXkTe70Wg0t/BCx+d08Hpz/fpKSPxtFt1woJbBbgI/EVcf8Ldry6CGD1P X-Forefront-PRVS: 0550778858 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR12MB1445; 23:pU+pwrLPKVPV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yVt9L0V/7Ipl0TZSc3Az5OsJrny6yszlWpUIIVBlQgOW+vAKY39Z8P1h7z6pKGzOPSvssw18Ho1YOCR SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1445; 20:tIpAqepMctQgeWR4r4LQ0iuFvkWu11bmnhVxC2ncn2SCXY1mxtATqoklU+M9VbSO6Z38165BFkxhQhyxtPDXBuCxqTV4TvehcYc72OXj+ZswSk/pmoAvwZUHPHHQOq1U826f8g+HB6zhKX/blo/6E/XW6/xGfrYpTRPBrfY4/kRXbDVmWqa01jqdTUA2rDJgBJV4B+NUCxIY6lgStgzaWnllAfiEAzbVtosUAQS29p08FbWF3YMNkWkVG5uy8dH8 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2018 22:28:52.2265 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4f523a6e-4795-4bfd-166d-08d55a0bdbf4 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: CY4PR12MB1445 Cc: 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 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 This to allow drivers to choose to avoid OOM invocation and handle page allocation failures instead. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/ttm/ttm_bo.c | 3 +++ drivers/gpu/drm/ttm/ttm_page_alloc.c | 6 ++++++ drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 3 +++ drivers/gpu/drm/ttm/ttm_tt.c | 13 +++++++++++-- include/drm/ttm/ttm_bo_api.h | 1 + include/drm/ttm/ttm_bo_driver.h | 4 ++++ 6 files changed, 28 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 2eb71ff..f32aab1 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -234,6 +234,9 @@ static int ttm_bo_add_ttm(struct ttm_buffer_object *bo, bool zero_alloc) if (bdev->need_dma32) page_flags |= TTM_PAGE_FLAG_DMA32; + if (bdev->no_retry) + page_flags |= TTM_PAGE_FLAG_NO_RETRY; + switch (bo->type) { case ttm_bo_type_device: if (zero_alloc) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index 0eab24e..f34c843 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c @@ -741,6 +741,9 @@ static int ttm_page_pool_get_pages(struct ttm_page_pool *pool, if (ttm_flags & TTM_PAGE_FLAG_ZERO_ALLOC) gfp_flags |= __GFP_ZERO; + if (ttm_flags & TTM_PAGE_FLAG_NO_RETRY) + gfp_flags |= __GFP_RETRY_MAYFAIL; + /* ttm_alloc_new_pages doesn't reference pool so we can run * multiple requests in parallel. **/ @@ -893,6 +896,9 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags, if (flags & TTM_PAGE_FLAG_ZERO_ALLOC) gfp_flags |= __GFP_ZERO; + if (flags & TTM_PAGE_FLAG_NO_RETRY) + gfp_flags |= __GFP_RETRY_MAYFAIL; + if (flags & TTM_PAGE_FLAG_DMA32) gfp_flags |= GFP_DMA32; else diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c index c7f01a4..6949ef7 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c @@ -920,6 +920,9 @@ static gfp_t ttm_dma_pool_gfp_flags(struct ttm_dma_tt *ttm_dma, bool huge) gfp_flags &= ~__GFP_COMP; } + if (ttm->page_flags & TTM_PAGE_FLAG_NO_RETRY) + gfp_flags |= __GFP_RETRY_MAYFAIL; + return gfp_flags; } diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 5a046a3..9e4d43d 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c @@ -301,7 +301,11 @@ int ttm_tt_swapin(struct ttm_tt *ttm) swap_space = swap_storage->f_mapping; for (i = 0; i < ttm->num_pages; ++i) { - from_page = shmem_read_mapping_page(swap_space, i); + gfp_t gfp_mask = mapping_gfp_mask(swap_space); + + gfp_mask |= (ttm->page_flags & TTM_PAGE_FLAG_NO_RETRY ? __GFP_RETRY_MAYFAIL : 0); + from_page = shmem_read_mapping_page_gfp(swap_space, i, gfp_mask); + if (IS_ERR(from_page)) { ret = PTR_ERR(from_page); goto out_err; @@ -350,10 +354,15 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistent_swap_storage) swap_space = swap_storage->f_mapping; for (i = 0; i < ttm->num_pages; ++i) { + gfp_t gfp_mask = mapping_gfp_mask(swap_space); + + gfp_mask |= (ttm->page_flags & TTM_PAGE_FLAG_NO_RETRY ? __GFP_RETRY_MAYFAIL : 0); + from_page = ttm->pages[i]; if (unlikely(from_page == NULL)) continue; - to_page = shmem_read_mapping_page(swap_space, i); + + to_page = shmem_read_mapping_page_gfp(swap_space, i, gfp_mask); if (IS_ERR(to_page)) { ret = PTR_ERR(to_page); goto out_err; diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index 2cd025c..099f24b 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h @@ -176,6 +176,7 @@ struct ttm_buffer_object { unsigned long num_pages; size_t acc_size; + /** * Members not needing protection. */ diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index 94064b1..9b417eb 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h @@ -86,6 +86,7 @@ struct ttm_backend_func { #define TTM_PAGE_FLAG_ZERO_ALLOC (1 << 6) #define TTM_PAGE_FLAG_DMA32 (1 << 7) #define TTM_PAGE_FLAG_SG (1 << 8) +#define TTM_PAGE_FLAG_NO_RETRY (1 << 9) enum ttm_caching_state { tt_uncached, @@ -556,6 +557,7 @@ struct ttm_bo_global { * @dev_mapping: A pointer to the struct address_space representing the * device address space. * @wq: Work queue structure for the delayed delete workqueue. + * @no_retry: Don't retry allocation if it fails * */ @@ -592,6 +594,8 @@ struct ttm_bo_device { struct delayed_work wq; bool need_dma32; + + bool no_retry; }; /**