From patchwork Tue Feb 6 09:04:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "He, Hongbo" X-Patchwork-Id: 10202511 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 2D0F4601A1 for ; Tue, 6 Feb 2018 09:06:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 247C228938 for ; Tue, 6 Feb 2018 09:06:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 18F7828AC1; Tue, 6 Feb 2018 09:06:34 +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 1A0D028938 for ; Tue, 6 Feb 2018 09:06:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E5CE089D53; Tue, 6 Feb 2018 09:06:31 +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-by2nam03on0082.outbound.protection.outlook.com [104.47.42.82]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5DC9F89D3E; Tue, 6 Feb 2018 09:06:30 +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=5XmmbeicODOeCVXoFSYL0wL5reFXQky6ugShY9EnQx0=; b=Sb/qT6y2K1pu8pFIVR/vcoWOkBnERIMmtaB+e9QXLu18+FxMsOKxg1p4SpwNXZec+dPaK7D72r5ubPVzapbbeA0/yYt/ib+835zKZWp3cpIxIFeaQdnOS6c1dTpNeP/sKla8ZpNkzU0GDf7yzgiUe3drSOtyQNCUGYyvh4OkskQ= Received: from SN1PR12CA0030.namprd12.prod.outlook.com (10.162.96.168) by BN6PR1201MB0052.namprd12.prod.outlook.com (10.174.114.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.485.10; Tue, 6 Feb 2018 09:06:28 +0000 Received: from CO1NAM03FT042.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::209) by SN1PR12CA0030.outlook.office365.com (2a01:111:e400:5174::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.464.11 via Frontend Transport; Tue, 6 Feb 2018 09:06:28 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; shipmail.org; dkim=none (message not signed) header.d=none; shipmail.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 CO1NAM03FT042.mail.protection.outlook.com (10.152.81.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.464.13 via Frontend Transport; Tue, 6 Feb 2018 09:06:27 +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; Tue, 6 Feb 2018 03:06:26 -0600 From: Roger He To: , Subject: [PATCH 4/5] drm/ttm: add bit flag TTM_OPT_FLAG_ALLOW_ALLOC_ANYWAY Date: Tue, 6 Feb 2018 17:04:33 +0800 Message-ID: <1517907874-21248-5-git-send-email-Hongbo.He@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517907874-21248-1-git-send-email-Hongbo.He@amd.com> References: <1517907874-21248-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)(39860400002)(396003)(376002)(346002)(39380400002)(2980300002)(428003)(189003)(199004)(2906002)(76176011)(54906003)(72206003)(316002)(16586007)(53936002)(97736004)(26005)(36756003)(336011)(77096007)(186003)(4326008)(86362001)(575784001)(59450400001)(7696005)(51416003)(5660300001)(47776003)(68736007)(105586002)(478600001)(50466002)(48376002)(2950100002)(6666003)(305945005)(104016004)(356003)(110136005)(106466001)(53416004)(50226002)(81156014)(8676002)(8936002)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR1201MB0052; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT042; 1:sx8GcsIms1FYGoHGWjSnkkmxsXbrq2uAPFrM6ydn/zb5qO+0J0uRtQ01NYvGkkbbyuRsVDcDvEdI18vOUzZa0evxyFLXq/uXBTU5eJn3+4r8Vc/Ar2Ziws423zaKJ0/5 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9c1b4924-2fd2-4ea5-932e-08d56d40e7fe X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060); SRVR:BN6PR1201MB0052; X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB0052; 3:lJ0Gri61pG2xKJu+jWr4M/XE0zSHBabrDiWx4NI//EFX/UkckkRTNDNEzzC+mMjHfisH2yd8kSX3YofQ9ibiriujbgf6DkTWojUvFD0x7KolEgzeOjNhIFnvn7xrob4egGOpglHkp8F8/J59vWveluW4ccRVTtql400DeK2szEuKEBD8Xj/kwqlCkWNfqJn2nZIdl6Zk7HcngpkstugfSggqSIDBAVUXU5MtuyE4gSBTNThJryNsSQJrRI8EzKALdkTW0HLRfUZaU+6Ue4UsQy7uE4xiKiw9/b88dduIDTGwwuW2gPEGAUeH6+tu3vt7ZFqDTswd9dKcluRa3KbJE7/rQfnU0etYG5hb7INcgE8=; 25:xcHjXZ/BP+glHE9L2gksbdXSabOCSZjnDmZZHOoLZ5QLw4NBZfCoH10asYbFLxVi5DTa6XyGYlZ4CkNMNdr4SsL54XA+XOTf6FDj3SR6TvwNTjIdh/FbcLzbERxCwt4KHrpUPliUcCCjpPegteTwZbepkQku+bxpbUMaHMg2x1YlgzfmyMHw6b9y/7SopOf6+sEo/tIgDprJt9cy9Hnb/XW1L33WgtgVIUUWB6Gb9JcoW0GbRo/fALgL3wRNQXtuPBykeGkVDtTbBtI8/vWQ6ZDlPq8ji6VuEGvkHM2D401mv6ee0EOkcLjwhkNcMEDMmdQX8wP+ji77vcvOGHtCPA== X-MS-TrafficTypeDiagnostic: BN6PR1201MB0052: X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB0052; 31:LfjYqpHWvU44IOAPNoP/FP+dU4J83I+7WOlO8i2luRKnadjmdVKawdyDLmAXjDmPog5MxSG60YCDxslnEtho5EcFjdpjbWQaJZu72RXrdshhodr+MOTrsO2WUwkBaNKYt9EGdyFrqQ/Mq8kmyZjZ7wRX9phMRc5X5qLeND/A7P8zrNvwGVMM2bGHjx3BZTGx9xUC4+usPnqSVTn7dlGYAXg3Um05RVwX06bWos3jwCk=; 20:uKFlH99ACwldOvJruCeVVGQ117nfAkELkRD/8m/zBO5bsygdWVcRe8lwiAPEa/+xVFB6lIcEWGS1pu5gDXVUSFtHuj5XgE3sqI0r2MWusyjCOfPDffodGkiqVC02O6Gy1VwQQ/2+vCL4iWBwkKiASmW3FvV9YboihKQwNHoamq4DJXq49707ScZRuU5jSBY1v084/AYYEmZvWS3V22VZgqnHLbQ1OnG+bcrwx+St6QuQ9BPR9KOTCjhdc0DT6Odor0YlLV68FkdSUdYL8shTXsJwE5rKpCCUDBtmsEVO4PdRIWleLV4i9B4+y9YmVdEVHvvETJmo642UnqdMWJuyDlvCxNHwMogJ6qnO5z9LLx4aEbDzzI0+1Y5vfywG17ZYQPs2s2WLgVPOqX4ISa78VnoIeblqC6TmHKRyIJ1mjLKqPDOfYlas1vHbdycW5Hzekj5AcvqPRYO1iIftC8fjUFTdWX3foG21keVv9mwtHpQpl0A9sdlvYMlL6OFQj2oc 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)(93006095)(93003095)(3002001)(3231101)(2400082)(944501161)(10201501046)(6055026)(6041288)(20161123558120)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:BN6PR1201MB0052; BCL:0; PCL:0; RULEID:; SRVR:BN6PR1201MB0052; X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB0052; 4:OpB5pG+FiB6r4TY5iijs2kkb2phdqahB1fF4c3WS0qUfLYJDa/KRhmgb9o17MLsbcqZNFTVmu09oL+2G3oqQIhjkw/3iPgY7bqudN1FUjQz0oNwIp3Puwjz902Onte5ds7FrAnS+uCA7aAN+UqvH+gb40ncUr+gTvMEQM4Rw60t2Mw72fdD/bGOfuJLV3EwQp+uhfIiIK61348co25C8B1xyE6brXKPWQ9QJoGMvD5D3jEtPW8RAVTh4yAef4sid1EnG58jaRSfWBGIWuSXa9/cypoe+LV41VIeMW/W6Tc7Mg+KI/Pa8regqcqKPXMMT X-Forefront-PRVS: 0575F81B58 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR1201MB0052; 23:3RUMJbBN2Q/6L26YTsInQcMHFihIlCDJSohxM7R?= =?us-ascii?Q?cjNMhvx/IRHnvKEIb7O7TLpZx7W0d64f5sHTkqRiXyaaRBYuYv92shjNcEHo?= =?us-ascii?Q?BGZANgtTk4D2lUaubttnQ2yCgFRrQhaGouhYSXaCisxjy6ipa3WXrPsvM883?= =?us-ascii?Q?68MMmcvEiZgUa5ToGxYSCmNIh9JJQZ/cl8fVWo1PdWfMoqh/R1/4WI0SMy/f?= =?us-ascii?Q?vLC+u+yIf0YYZmt87WdRMEUX47XEuvXMLc51noBW6Mh6shm69g7pv/1MQFVz?= =?us-ascii?Q?9P9Ktb6/kfIi5UgVNrmcPiMLgj7kOJL9K+4Bx4xBIdO4DdE/fMxFolZoaA4W?= =?us-ascii?Q?Duru5k8iBAOUfL6ZelLanVvvo/16Ifu88Rcq0jxanx7H820bPg8nAoiiclV2?= =?us-ascii?Q?L7rO70PK06qnLrMXXmvQFDPWaWIEz04iXaZOHpxkCSmPl9oUrJvsa9vX6KfA?= =?us-ascii?Q?XmI7JspFEdCAHdSf2zF8JCx4RH/BXyawtL5rROCLjdDjIyujIsyzng+ii91p?= =?us-ascii?Q?0QrcR/zpNSu7vQfi1KmVq9USOYWzxDmzU1gQ+o4+NXxWzrb61gaiqwBLPE7P?= =?us-ascii?Q?WU+gDgRO3NcLBWeMaJ/Cv9C9pE5rlBfr2ifRKis8+H/m8JsZ8ajxtffTjPDE?= =?us-ascii?Q?z5KIISTMbXcTdjfBa8EppEzOJtULTa540HEplgYZpdcttKVonhqBTm2mk8pT?= =?us-ascii?Q?fSoZhI0uVaZkwtYn7hGkCgz4XkFIirt4Nv3PIYpmbBdV9Kbcq61rvfrZ0hHH?= =?us-ascii?Q?rpSYyE0/3VtgLlaFFQSEdTUdUMakADCsoUU077P5BoGGyq47TfHFNJAoRR/L?= =?us-ascii?Q?eYt4OwnfGQbWqedbZH17mDdbrUL87193kCA8lXgzsiV4ogp+C7Q0HOsL3GEN?= =?us-ascii?Q?0Kk2azFB7s25Nzm7iHd55iYdEJdK3DLyzsKv0GjIksanbT2G/z/VBJmAf8yN?= =?us-ascii?Q?EmqcNxDMDBg0ng3/bxtim+uQ4x2ExlkzNOKADdWr67VVVUI9ylbkhdWbfeWU?= =?us-ascii?Q?yOq3ZFAIGf0VeLe1gNH4eSjlhGJlz6Ehs6ImouxTvjw9HdvXDQlq94m7ditc?= =?us-ascii?Q?GsOl81VajXVmTJGSwq6n0Rb0ZdnZPmKP5I8jpKKSBmMrlTfRaUhQ1Rljc24o?= =?us-ascii?Q?DuqxuFmh8ubk=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB0052; 6:wsaAnXo490TRLLkOa0gySQkI0cx6LLuC6B2zGuH/wT5SboFEx3wERAUGvSaQ/0Gg1SG0O8XZLxFfxE/CDPD9QD4vEsXWe6qJnz1JdrWDYCIzrF4cIcgz6q8reg8/RbF3U7cGFFW9dDDAuEvzgMA9yum4HsVH+Mvs33ZCKiJAI/lm2bhGgXqvLr1pBXHoD6vPTNVbjCNFEjZwshJXDS/vjOkr/Z8XHOXJ/5TmcxvV/gx0+PUTFnfA4i3nJuv8tvQsLkyIXz7/8LOnCyPIljdcZilobld7kA0B2uTkukiKr2zwz3Xgf32b0xGOxms5BDb9ufR1eCKTfxDNExWn4f8WuBxiz/1a0z8hHnyZW9YfSXk=; 5:I5DCgVTZt8PlFHLbZFXq3WJbBQCk41EBhVey16E58sCxkn9+h5Vy38UpEZvA8irX2gSHGQGs2IG3rbhhqGDtJTf3a6WRvldaRFzDPhyo7jpkpYChFHtbaUZyycbj+W/AjRO0WXh5TqdU6XewSqQRm9sYPMHC7ypANxCYjbOrIjc=; 24:xXJF1744XhcWV12rZfzksMetc32hOvgB9XrcQoCT4FToGCRERcOvvqeaGknG4ThcDl1CurDJjYOU5pZx2kKOM30alVjCeidoa7v5VHI7C84=; 7:SM/kjNxOR4lpfwvpf7AMfPMOx5NHlHp1ascpG64WczqzpjIS2vGItkOk/rEaWzhOb8kmrqKSKL0jW3+Wybl5ZIRR6tvAlGtdADav/i75awgNX4GJVa3jy6Mdu6z5tz5KXuZ/oK5nFx1Q9mFbT+hXnhQLBu3aT1o5l4U5wQTQVEStM9YRvH1ZBXlcejCUUFbKRt7cqlt/SjSq6NnlmUy0rcO5fArrIkDv544tT+5ChilIpfcEdYZLIudWZisF7BPa SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB0052; 20:0TiRFdLkh8zKECFWSl2u3W3yZO6OA5BJ5yDG+NwGvuiWFyY3lRmSVfeByXLbrEW/Z/C0oZAzucOKYNtW5YBd+3U7Zg3fp6VTrlJYfbQ0J0hz8C/LO7O6MgfGQsqmlsnBDaKtAKLMGaVe2czmu/2Y3L3Ma5WjO73rXPEoSZvDqc20N4me7eefEgSfYwHs2BYqDi95WkqWW20IcbC+uJRJM9ptUvNzmW6ugOhFmkjCd3QRHaVnjVdhaovqWBY+JK4G X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2018 09:06:27.8473 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9c1b4924-2fd2-4ea5-932e-08d56d40e7fe 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: BN6PR1201MB0052 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_ALLOW_ALLOC_ANYWAY 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 Signed-off-by: Roger He --- drivers/gpu/drm/ttm/ttm_bo_vm.c | 6 ++++-- drivers/gpu/drm/ttm/ttm_memory.c | 25 +++++++++++++++++-------- drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 1 - include/drm/ttm/ttm_bo_api.h | 4 +++- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_bo_vm.c index 716e724..240c462 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_ALLOW_ALLOC_ANYWAY; /* 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 3f00ed8..5e357b4 100644 --- a/drivers/gpu/drm/ttm/ttm_memory.c +++ b/drivers/gpu/drm/ttm/ttm_memory.c @@ -488,9 +488,6 @@ ttm_check_over_swaplimit(struct ttm_mem_global *glob) { bool ret = false; - if (!glob->no_retry) - return ret; - if (get_nr_swap_pages() < FREE_SWAP_SPACE && si_mem_available() < glob->sys_mem_limit) ret = true; @@ -500,17 +497,28 @@ ttm_check_over_swaplimit(struct ttm_mem_global *glob) 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, + bool allow_alloc_anyway) { uint64_t limit; int ret = -ENOMEM; unsigned int i; struct ttm_mem_zone *zone; - if (ttm_check_over_swaplimit(glob)) + if (glob->no_retry && !allow_alloc_anyway + && ttm_check_over_swaplimit(glob)) return ret; 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 (glob->no_retry && allow_alloc_anyway) + goto reserve_direct; + for (i = 0; i < glob->num_zones; ++i) { zone = glob->zones[i]; if (single_zone && zone != single_zone) @@ -523,6 +531,7 @@ static int ttm_mem_global_reserve(struct ttm_mem_global *glob, goto out_unlock; } +reserve_direct: if (reserve) { for (i = 0; i < glob->num_zones; ++i) { zone = glob->zones[i]; @@ -547,10 +556,10 @@ static int ttm_mem_global_alloc_zone(struct ttm_mem_global *glob, struct ttm_operation_ctx *ctx) { int count = TTM_MEMORY_ALLOC_RETRIES; + bool alloc_anyway = ctx->flags & TTM_OPT_FLAG_ALLOW_ALLOC_ANYWAY; - while (unlikely(ttm_mem_global_reserve(glob, - single_zone, - memory, true) + while (unlikely(ttm_mem_global_reserve(glob, single_zone, memory, + true, alloc_anyway) != 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..f7304c5 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, allow alloc anyway */ +#define TTM_OPT_FLAG_ALLOW_ALLOC_ANYWAY 0x2 /** * ttm_bo_reference - reference a struct ttm_buffer_object