From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 991DA606A31C for ; Tue, 20 Oct 2026 16:16:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Zh3xuLy8 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4AD1810E4D3; Tue, 20 Oct 2026 16:16:34 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5F1F610E3AF; Tue, 20 Oct 2026 16:16:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1792512988; x=1824048988; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=akTQdsSJuj+7E3eycT1h3ljK4ElMktlz6W3iM7+iODo=; b=Zh3xuLy8IfqUBCfARmBhmsGe28o1CisE4tHgmctIALkyOQWO7i+0jk81 Mlc2llsp5xzF9Q8wneUflXGl6JykgLcZ2FIQ1h0ncgf+1PPjn16Wu4u/w 2KQ+qz7UuYhj7bxn79IhqcZyDWMcVglsNc6aeQfUeu1ss5DwqHP8wjZDh DsvAn4gZ2UzXeG6PQXQMpKT+AqpJVr41iaJpo0WMJPy2CPEprIPjhRDbh iqkv4LucL57gxz7/Gq5XCnYQmhEpLUINBjPb3L9zW8cHyQmQDyn2h2A4F +JBn29mnA20OLNBvoINSOFdeTfr6UktKWDswLQ8HKQxJqLKR8W1cOcsBM g==; X-CSE-ConnectionGUID: 8TIgIpKTRTqZJsl0FW61OQ== X-CSE-MsgGUID: V5RWQEnPQH6ZkV/85M6rqQ== X-IronPort-AV: E=McAfee;i="6800,10657,11941"; a="1325266" X-IronPort-AV: E=Sophos;i="6.27,168,1787036400"; d="scan'208";a="1325266" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2026 09:16:27 -0700 X-CSE-ConnectionGUID: ps2awJPsQO6xE8leCCEANQ== X-CSE-MsgGUID: 7jFRVjyMTVOCRFMz9x5tIQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,168,1787036400"; d="scan'208";a="3265625" Received: from orsmsx903.amr.corp.intel.com ([10.22.229.25]) by fmviesa006.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2026 09:16:27 -0700 Received: from ORSMSX903.amr.corp.intel.com (10.22.229.25) by ORSMSX903.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.49; Tue, 20 Oct 2026 09:16:26 -0700 Received: from ORSEDG901.ED.cps.intel.com (10.7.248.11) by ORSMSX903.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.49 via Frontend Transport; Tue, 20 Oct 2026 09:16:26 -0700 Received: from CO1PR03CU002.outbound.protection.outlook.com (52.101.46.13) by edgegateway.intel.com (134.134.137.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.49; Tue, 20 Oct 2026 09:16:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KJkI2+pvnG7WvdN/vrntbCohzLZMtdRv+JVMc3x9ve+EELdF0bApkrlYz9Leq306BTijZw2sRR3rN44+zeoJUdjDd6r92eVIGII0crAZ6ovFMAZMTc+nPT33HgWryryCXxNnWr1Ka4XWK9yc9dm643aOGriz23cGuxz4GOtnum4fQsBp0b7MNMy544XD0Dj/Iv2IYi4i46mcsi/uGLLZOUr6FR1tL52120EvkHKn2W0GzO1hv5zYkODc7zClPfM6YL0nhOcJfRRO/8Ct+moriB06e4DLYAJQ26fN38im639t2xbKoS5/L8KHPpy+beypfT4ozhwGpoCLGOxPLLUtnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=E857dvdDT6Xszu7IqeJ7gQr7jmfjo+ctXxqsJtdp/qU=; b=QTmmTMLIkk2Iu7D8wOkziwzldMXvddLZsU6bWlEF0GBRnKl7mIQGVwCVe41pL1v35550IuH1oLtjoVECf++g1Yxa0pvBBJtylnnmcFtKtqTr48QoMkYIzYSiCunQFy3HkEXrCz/Sp7VCx4pZWDuIPh6hwULSyjMe1HKoGxo8YrNG+4vsw8kclMmWMMSPmRPztKD4z+CDBk2wZu0wWpJ3IZumRnQJetmk1F/uGu4YVVFir6MyhZepvj0d+RlQIxN25na6v8Bae3eloSRAtaae6xOjqQYx8wJofcmJCqzchl4ml1VrYZP4jw0SjLoiLV486/j52N99LKe8NhiRVeWNKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from CO1PR11MB4787.namprd11.prod.outlook.com (2603:10b6:303:95::23) by PH8PR11MB9829.namprd11.prod.outlook.com (2603:10b6:510:3c3::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.522.19; Tue, 20 Oct 2026 16:16:24 +0000 Received: from CO1PR11MB4787.namprd11.prod.outlook.com ([fe80::e7eb:a872:53d1:21fd]) by CO1PR11MB4787.namprd11.prod.outlook.com ([fe80::e7eb:a872:53d1:21fd%4]) with mapi id 15.21.0546.012; Tue, 20 Oct 2026 16:16:24 +0000 Date: Tue, 20 Oct 2026 09:16:22 -0700 From: Matthew Brost To: Thomas =?iso-8859-1?Q?Hellstr=F6m?= CC: , Matthew Auld , Rodrigo Vivi , Natalie Vock , Arun Pravin , , Subject: Re: [PATCH] drm/ttm, drm/xe: Don't invoke the OOM killer when evicting VRAM at suspend Message-ID: References: <20261020100504.46684-1-thomas.hellstrom@linux.intel.com> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20261020100504.46684-1-thomas.hellstrom@linux.intel.com> X-ClientProxiedBy: MW4P223CA0004.NAMP223.PROD.OUTLOOK.COM (2603:10b6:303:80::9) To CO1PR11MB4787.namprd11.prod.outlook.com (2603:10b6:303:95::23) X-Archived-By: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PR11MB4787:EE_|PH8PR11MB9829:EE_ X-MS-Office365-Filtering-Correlation-Id: c4b98c7b-d489-4094-b2cd-08df2ec57c40 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|23010399003|1800799024|376014|11063799006|5023799004|261009223027099003|10067099003|56012099006|18002099003|22082099003|6133799003; X-Microsoft-Antispam-Message-Info: vKCe5JIHf+kUb0giKtZH/CPCTolUIyTm01a04VH3gcBI82E7uMBpxglNBMlMZOJ0nlGDRrwKR2zennsxAKKEwolNB1bg6w9Hg2R6HAHIjQayF0wZkUPAmcjzeSHIfQ69eXRMZnWRSG6144lWaytXXMg6VJQcD7qTKbq/EagxXCi6s1Z9okBby6KyhHxle+zebYuBg2fC3psaHzfnQaYKDn62EDWgZ8M7moPLjhLF/azdFcRwPjf1PnOATbRCspqTOITozvXPWvLSYh7IcmLmIw4NHwWTltl23UwJ4Y1NZbnUEWA84nEQSGrqZQbkmXOg9rCOzQYIuTwO+DeTccWbarnnEb57/DenuNCMY/PZ3IaADgA3NcyNt5I6+w0mhTA0DU6uoT2U3lZ6PlpzNk/9rZ84/WN4tx/ANWLH0U/7pNwr7A5UHQsYB2EyHV9VwxSRzcbGWzJ7/xTIUBJCljG/WuzDR0YgPo59sbMGsE60e9D/3ZC7+drhPx1oDHiWpweWCQIzn/Uzy2JP+WbZuB7l1Y/s15jA5QxB/2YDb/kk0tfZQ/XL5g35qfwrmyujdtQ5ki2xdLynVnQTMZk9sIOxSNdSha5ADKMzQAkeFR8ivuv2dgZtzrQDbWlmlOTCj08a X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR11MB4787.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(23010399003)(1800799024)(376014)(11063799006)(5023799004)(261009223027099003)(10067099003)(56012099006)(18002099003)(22082099003)(6133799003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?GIN6/jdLzXTbxERleMEYi4tWvzEJvlzjuFkRNeKFkf8bSTjy8zSxA2hfRW?= =?iso-8859-1?Q?j64rNrwaKHB9sop0OkFHspFpwksr6wKxSLE0zL9PekUy2q7m8SUkw0+mQF?= =?iso-8859-1?Q?mIiulQ+g/9fsBtSuLUtqTvycO3Pen3JbLFtThS8B6n+Y7l4MCej62iS7k4?= =?iso-8859-1?Q?3VzPSINtWx9eUkacWPUBOvJCVBZNUXWRaWsbtoUOchPrT/+so28PK+sE/w?= =?iso-8859-1?Q?tfmCYDfIQ6176lzYBAa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LKRe1fv2mqpYylT4xxQn/pNvotpIH6+suu6OM5elo1SyJ5gdbCCupC9/dI0fmUFmb4wsbPv5C+sDgX4Xx7dOEvDMQUSpW5PjBpExfUEuEECvBjQvWxZSHE9FhbbH4EHdAkWNLaiZBznj9ZyZtKJpSbw== X-MS-Exchange-CrossTenant-Network-Message-Id: c4b98c7b-d489-4094-b2cd-08df2ec57c40 X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4787.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2026 16:16:23.9423 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hG8AQKgJCtXOw6XpOez5nn/vlZkksJJCEVw9WBRkYQ5tMm85IVV7V7rMRUIdzx/1Jo+/Ff2guquAXGa5cL/bzA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR11MB9829 X-OriginatorOrg: intel.com X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Intel-xe" X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Tue, Oct 20, 2026 at 12:05:04PM +0200, Thomas Hellström wrote: > When evicting user BOs from VRAM at suspend time, allocating system > memory for the eviction may currently invoke the OOM killer. Under > memory pressure it is preferable to abort the suspend and return > -ENOMEM rather than killing processes. > > TTM's ttm_resource_manager_evict_all() uses a default operation > context, which doesn't allow the caller to request > __GFP_RETRY_MAYFAIL allocations. Introduce > ttm_resource_manager_evict_all_ctx() taking a caller-supplied > struct ttm_operation_ctx, keeping ttm_resource_manager_evict_all() > as an exported wrapper using a default context so that existing > users are unaffected. Also honor the ctx interruptible setting when > waiting for the eviction fences. > > Use the new function from xe_bo_evict_all_user() with > gfp_retry_mayfail set. > > Note that the PM notifier eviction is best-effort and ignores errors. > Any remaining BOs are evicted again from the .suspend() callback, > where an -ENOMEM might then cause the suspend to be aborted. > > Fixes: c6a4d46ec1d7 ("drm/xe: evict user memory in PM notifier") > Cc: Matthew Auld > Cc: Matthew Brost Reviewed-by: Matthew Brost > Cc: Rodrigo Vivi > Cc: Natalie Vock > Cc: Arun Pravin > Cc: intel-xe@lists.freedesktop.org > Cc: dri-devel@lists.freedesktop.org > Cc: # v6.16+ > Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/work_items/9615 > Assisted-by: LLM > Signed-off-by: Thomas Hellström > --- > drivers/gpu/drm/ttm/ttm_resource.c | 37 +++++++++++++++++++++++------- > drivers/gpu/drm/xe/xe_bo_evict.c | 5 +++- > include/drm/ttm/ttm_resource.h | 5 ++++ > 3 files changed, 38 insertions(+), 9 deletions(-) > > diff --git a/drivers/gpu/drm/ttm/ttm_resource.c b/drivers/gpu/drm/ttm/ttm_resource.c > index 4e6d3d658d85..5296b32a2e92 100644 > --- a/drivers/gpu/drm/ttm/ttm_resource.c > +++ b/drivers/gpu/drm/ttm/ttm_resource.c > @@ -568,24 +568,26 @@ void ttm_resource_manager_init(struct ttm_resource_manager *man, > } > EXPORT_SYMBOL(ttm_resource_manager_init); > > -/* > - * ttm_resource_manager_evict_all > - * > +/** > + * ttm_resource_manager_evict_all_ctx() - Evict all objects from a manager > * @bdev: device to use > * @man: manager to use > + * @ctx: operation context for the eviction > * > * Evict all the objects out of a memory manager until it is empty. > * Part of memory manager cleanup sequence. > + * > + * Return: 0 on success, negative error code on failure. > */ > -int ttm_resource_manager_evict_all(struct ttm_device *bdev, > - struct ttm_resource_manager *man) > +int ttm_resource_manager_evict_all_ctx(struct ttm_device *bdev, > + struct ttm_resource_manager *man, > + struct ttm_operation_ctx *ctx) > { > - struct ttm_operation_ctx ctx = { }; > struct dma_fence *fence; > int ret, i; > > do { > - ret = ttm_bo_evict_first(bdev, man, &ctx); > + ret = ttm_bo_evict_first(bdev, man, ctx); > cond_resched(); > } while (!ret); > > @@ -600,7 +602,7 @@ int ttm_resource_manager_evict_all(struct ttm_device *bdev, > if (fence && !dma_fence_is_signaled(fence)) { > dma_fence_get(fence); > spin_unlock(&man->eviction_lock); > - ret = dma_fence_wait(fence, false); > + ret = dma_fence_wait(fence, ctx->interruptible); > dma_fence_put(fence); > if (ret) > return ret; > @@ -611,6 +613,25 @@ int ttm_resource_manager_evict_all(struct ttm_device *bdev, > > return ret; > } > +EXPORT_SYMBOL(ttm_resource_manager_evict_all_ctx); > + > +/** > + * ttm_resource_manager_evict_all() - Evict all objects from a manager > + * @bdev: device to use > + * @man: manager to use > + * > + * Same as ttm_resource_manager_evict_all_ctx() using a default, > + * non-interruptible operation context. > + * > + * Return: 0 on success, negative error code on failure. > + */ > +int ttm_resource_manager_evict_all(struct ttm_device *bdev, > + struct ttm_resource_manager *man) > +{ > + struct ttm_operation_ctx ctx = { }; > + > + return ttm_resource_manager_evict_all_ctx(bdev, man, &ctx); > +} > EXPORT_SYMBOL(ttm_resource_manager_evict_all); > > /** > diff --git a/drivers/gpu/drm/xe/xe_bo_evict.c b/drivers/gpu/drm/xe/xe_bo_evict.c > index 7661fca7f278..a37316a27573 100644 > --- a/drivers/gpu/drm/xe/xe_bo_evict.c > +++ b/drivers/gpu/drm/xe/xe_bo_evict.c > @@ -114,6 +114,9 @@ void xe_bo_notifier_unprepare_all_pinned(struct xe_device *xe) > */ > int xe_bo_evict_all_user(struct xe_device *xe) > { > + struct ttm_operation_ctx ctx = { > + .gfp_retry_mayfail = true, > + }; > struct ttm_device *bdev = &xe->ttm; > u32 mem_type; > int ret; > @@ -135,7 +138,7 @@ int xe_bo_evict_all_user(struct xe_device *xe) > continue; > > if (man) { > - ret = ttm_resource_manager_evict_all(bdev, man); > + ret = ttm_resource_manager_evict_all_ctx(bdev, man, &ctx); > if (ret) > return ret; > } > diff --git a/include/drm/ttm/ttm_resource.h b/include/drm/ttm/ttm_resource.h > index 714c533622c2..6cf9187a12eb 100644 > --- a/include/drm/ttm/ttm_resource.h > +++ b/include/drm/ttm/ttm_resource.h > @@ -42,6 +42,7 @@ struct dmem_cgroup_device; > struct dmem_cgroup_region; > struct drm_printer; > struct ttm_device; > +struct ttm_operation_ctx; > struct ttm_resource_manager; > struct ttm_resource; > struct ttm_place; > @@ -488,6 +489,10 @@ void ttm_resource_manager_set_dmem_region(struct ttm_resource_manager *man, > int ttm_resource_manager_dmem_reclaim(struct dmem_cgroup_pool_state *pool, > u64 target_bytes, void *priv); > > +int ttm_resource_manager_evict_all_ctx(struct ttm_device *bdev, > + struct ttm_resource_manager *man, > + struct ttm_operation_ctx *ctx); > + > int ttm_resource_manager_evict_all(struct ttm_device *bdev, > struct ttm_resource_manager *man); > > -- > 2.56.0 >