From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=192.198.163.19 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail; t=1796079160; b=EhvQCqhwHnqHrbX7Vb7T+8fvfrYWytxrQ8cwUduYrVhaxWDJZh7RXnob5s+TQxD0Uw2Y f/Zq4oq5ffpOCNscotMj05Zn9SZsqQA8yuvCPO2KuoAOt7ckosnHOORjoyFiUS2eYj7RU Iv9sslixFAnWOQT/h7lzKmsN642196OV5nyAwyyLpF2sDdFONjK5nyQOycxTwd/1iNFRO 9r1pOrH4TfqkBGzsB0b6xIOwYXdz2spWNsbhOnY+ALEGOyzBRTCTRvvqAxmsfpFWhNnml xHXX7tGKS2MNL43pUa/CYYwGF6gmb457mfd64qtOgMfeZ50dODlgTdOH3ijS+fJlXJA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796079160; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Received:Received: Received:Received:Received:Date:From:To:CC:Subject:Message-ID: References:Content-Type:Content-Disposition:Content-Transfer-Encoding: In-Reply-To:X-ClientProxiedBy:MIME-Version:X-MS-PublicTrafficType: X-MS-TrafficTypeDiagnostic:X-MS-Office365-Filtering-Correlation-Id: X-LD-Processed:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-Exchange-RoutingPolicyChecked: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-CrossTenant-Id:X-MS-Exchange-CrossTenant-MailboxType: X-MS-Exchange-CrossTenant-UserPrincipalName: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg; bh=bYqL840zMsrVo/Du6K5AzDIEXehb7nQ/f4MqZOi/lgU=; b=Jo+LA0qS2iwcrI+wbcAJCSkSqlRC9G5FQys0cDxTqUeaQIN+hpRho+K1KGtBXQlQ6YK5 dVz13Mqmc1WKDtClgMuHvj+uVT8W2t8/zb/K2GZZx43oBuxHyXACSTeIHrxmpVYiQjG3P fFxYMss0YnKQGC0HmRiWI/0TpF1Cu60dOhF7t0aJ4mbmWh35FgXOr6L4qFBO7EZroC/qb 9wXrutbDwqSEqZ6hn24ukzK/DBhtBZ3o9cn7GlI6W7f1LynLONux4sibZh8yKUK47YpyZ +UmRPZmtY3qPq3a9mg1SYLUtpNwV1qcdo0qlzJyncuMO4Z8jwe2EaWSGXOza8bGwmpg== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Eumx5yDd; arc=fail smtp.remote-ip=192.198.163.19 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E2A68606A31A for ; Mon, 30 Nov 2026 22:52:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E2A68606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com 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=Eumx5yDd DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796079160; x=1827615160; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=bYqL840zMsrVo/Du6K5AzDIEXehb7nQ/f4MqZOi/lgU=; b=Eumx5yDdCxL6aSezmopDHvo6gg7ChqnbhSuZovfTGSCWQY++kKkbMd/y aBSI4A1KpkxLdc3M6JRNOebSXM2Lh5qBpjSZw1aDa9aLgP1NVboWK2928 Z2KhgPNXIx7p+GQggvUY/UMk+iZYCgcDtnimunqranpcsr/pjO7ip4+hj Y2GFENLrsOWYB8MLb+fkMREpOO5O/jkxNsX5aDFtXO8SKAAajAkkpmwmx B0Aa7D0oAzQC2kCB2snz3kUfU61SHQm0/isJA7RiEubCHunDDkqX8su8R bbVR+kTTqc5Id9OOu99FO3xcPZRpKKg6gWGd83iX+vwy81ZaLgIeO2QsB w==; X-CSE-ConnectionGUID: iYZ2dl5kQlKGnJvDbTr0Mw== X-CSE-MsgGUID: dyJszkuBSgOMavmyjfLWsQ== X-IronPort-AV: E=McAfee;i="6800,10657,11982"; a="4950568" X-IronPort-AV: E=Sophos;i="6.27,243,1787036400"; d="scan'208";a="4950568" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2026 14:52:39 -0800 X-CSE-ConnectionGUID: 6Iw/x4LSR+q23BCzYp3HIg== X-CSE-MsgGUID: pHcGzV6PR8Kwyzj3Z5RQKQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,243,1787036400"; d="scan'208";a="13556109" Received: from orsmsx903.amr.corp.intel.com ([10.22.229.25]) by fmviesa001.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2026 14:52:39 -0800 Received: from ORSMSX902.amr.corp.intel.com (10.22.229.24) 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.57; Mon, 30 Nov 2026 14:52:38 -0800 Received: from ORSEDG902.ED.cps.intel.com (10.7.248.12) by ORSMSX902.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57 via Frontend Transport; Mon, 30 Nov 2026 14:52:38 -0800 Received: from PH0PR06CU001.outbound.protection.outlook.com (40.107.208.58) by edgegateway.intel.com (134.134.137.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Mon, 30 Nov 2026 14:52:38 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Y/+f5eZmJepqT/NET6ZxTY3tFaTjBbrlAq7x70w27o9vGMlQKaaW1eJLRLKSLzru+1wLcVQ7wUJyc2vBCrTD+VFrITCIGfmgeQSk8hj3OL2+OLJQzD72VFKFfCNNTzYnB6cCHgtWmK4USGEF+gnTFM+uVJwgsFVdbTDlbod6WZVDaxyv7ZdmJJLZNppXBcVQ0eZKW5cQHZSGDt6f4MP3se4lanmwzua/LVHmpHYSgfrADo5tXmGEieYWAqGjwN/5tkEsa2fuZi0UMlIH+GsLMrdVucWdMinlSzpK2h7JtcpBJIHx6KMFAvcAUIxcshYEndrQmkVVgy5INA+q1bhQ+Q== 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=2yNJYijgEXMjAHfqZAKvWyhTNzHlLzp7MAFsVL9oJP8=; b=J5bDJiIz6UgG3CowhUlrUk4CLyPVPoVhqmuXhyPG3M3IANHZsedEPh5C2EbUX4lThG91jxSPwF9KtGI1jbPRbmHm7Y6NFs1GJyAwM3nde80Hd7Aw9inlX/hdbEKNLhv0grBCk9hVM7/EwzpI2B1AiGwLMrCOStA++EsMx1pbseQKVCmg1Q5jGc3fMVXw+Yi5K0Xa8crqeUupL93vz7IgKDuSN+SQLmNLRmOhbowr7uvx1HejInNuBwQSxL0NWhtYRB/Dq/NHfP16NA8G2KevGMQRLDIwa1Mx77PYh+MBq0qxwFP8ppe6d+I7b1NoqIuPH+sCG831FCoB0Ze35JMqHQ== 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 SJ2PR11MB8348.namprd11.prod.outlook.com (2603:10b6:a03:53a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.13; Mon, 30 Nov 2026 22:52:34 +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.0662.012; Mon, 30 Nov 2026 22:52:34 +0000 Date: Mon, 30 Nov 2026 14:52:31 -0800 From: Matthew Brost To: Niranjana Vishwanathapura CC: , , Carlos Santa , Ryan Neph , Christian Koenig , Huang Rui , Matthew Auld , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , , Thomas =?iso-8859-1?Q?Hellstr=F6m?= Subject: Re: [PATCH v3 22/33] drm/xe: Add Kconfig.profile options for BO defrag configuration Message-ID: References: <20260711025619.2540575-1-matthew.brost@intel.com> <20260711025619.2540575-23-matthew.brost@intel.com> Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: BY3PR03CA0023.namprd03.prod.outlook.com (2603:10b6:a03:39a::28) To CO1PR11MB4787.namprd11.prod.outlook.com (2603:10b6:303:95::23) X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PR11MB4787:EE_|SJ2PR11MB8348:EE_ X-MS-Office365-Filtering-Correlation-Id: 8c9f69da-7c1b-4e38-c20a-08df4f349f6b X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|23010399003|7416014|376014|56012099006|10067099003|260925022911599003|260925021311599003|260925021911599003|261026121527099003|261022075727099003|261028144727099003|261022105027099003|261021123027099003|261021121427099003|261026140227099003|261102123227099003|261009220027099003|261009221727099003|261009221227099003|261009223027099003|261009223327099003|18002099003|22082099003|4143699003|5023799004|11063799006|6133799003; X-Microsoft-Antispam-Message-Info: ael44Vi/M25LryR0WrkshOp7SA63yef55/0wzyNsUKsgjvwf59+Vm8G9+vgAkHax8N00lnpB8MHoc7MrYBBef7cJFKt2P6ND9HYz9d6Sei3gVoFdNfl4ieMIyvDtF8PmXcfZk5K/Q21T2jDEL5hrgklCkRCjBBBWSa7VwNE2gZga/pXeZjYDB3zcv42WXePsZK8SsHrqvWi5BXG/Yx/QSTyMD58Xm+YSzZbvwrOjwIZEYn8TQIsOSkH6aBr/IW865XupfhuVPmy7oehyqaLznlwBe9GbalZuOQ30IZQHcmWNEg0XD6jiWIUbkCnrmlZeenAJEhjNDOBNvEHS4GsSIreGMeHJUWa7W5zkliummt14ornKA5mWZVuURbDmU86bCB6fKBm9K5rDa77TB8b+8oPfC3bA3CvMOTuXIMzjfBMIe5K5qILEtfR9FUzusriS8vBy9yyCXH/rZoWDbJUbCjoZdnesk5Ra1RhpS3BsZu1kvxVG4nnNyEpYX3a1DUTrApQa9CGQr7rh7jiCG5XOKZ6ZCLpCtMm6pwWZ7+R5V/DmAOABUz+sABdVAuhBQeJNzCIQm4STnxsU3olxzr8C/2MaXt+ux1NvQPoLiExbdzruw3Yvqo1Suu9mlI8NB9ezdhl/MO/bUNFpbs1xcxU2e88YTesutRxSdG77pN+aGFk= 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)(1800799024)(366016)(23010399003)(7416014)(376014)(56012099006)(10067099003)(260925022911599003)(260925021311599003)(260925021911599003)(261026121527099003)(261022075727099003)(261028144727099003)(261022105027099003)(261021123027099003)(261021121427099003)(261026140227099003)(261102123227099003)(261009220027099003)(261009221727099003)(261009221227099003)(261009223027099003)(261009223327099003)(18002099003)(22082099003)(4143699003)(5023799004)(11063799006)(6133799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?luISux0OKj92fEU/FpQ5XxZmQL2st81J5DFTZohcKsU+DL/J+ck5wul6WB?= =?iso-8859-1?Q?aQWSXD/vfSJTeZnYPCTr7j4b1dIQP392N9A9OoPz3cS/Hsgk1S9QTh3qFB?= =?iso-8859-1?Q?jYxC1HDJS4ayeWe1/vrAlFroTy23Lu/FIfYd1iTuImTk1sB+NxQ5aF0bgy?= =?iso-8859-1?Q?Vmv4pv974/JKWGqKqo+dnoIIWG2wOPaf8bfb/N+IH0Sz1t/HiHiHynP/W0?= =?iso-8859-1?Q?YupX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0f0jn8fIHVWbI6a3AUn/cn8Ho9i7vjhBW6GLuQIJI7FWPfqWq6IB2yBrMIIrHskiWsfQuE1MJ4dKgf4pMNBNMHPMD868WrSd4IWv1D0zYg21loPNVSHLqy7/r+3mRo7Y50fAtokVeq+vqRIZA== X-MS-Exchange-CrossTenant-Network-Message-Id: 8c9f69da-7c1b-4e38-c20a-08df4f349f6b X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4787.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2026 22:52:34.2850 (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: LV3MjA+n16sfQgwSdLUdgtGDuo9aIam0IU04g5IFCS1E4iYHcEkUJqiiNbt2O5t0TtFQQAtIXufZnbNDE6UwBQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR11MB8348 X-OriginatorOrg: intel.com On Mon, Nov 30, 2026 at 02:49:04PM -0800, Niranjana Vishwanathapura wrote: > On Tue, Nov 24, 2026 at 12:25:13PM -0800, Matthew Brost wrote: > > On Sun, Nov 08, 2026 at 05:31:07PM -0800, Niranjana Vishwanathapura wrote: > > > On Fri, Jul 10, 2026 at 07:56:08PM -0700, Matthew Brost wrote: > > > > Add Kconfig.profile options to make XE_BO_DEFRAG_* defines configurable: > > > > - DRM_XE_BO_DEFRAG_RECLAIM_BACKOFF_THRESHOLD: Threshold for TTM reclaim > > > > backoff > > > > - DRM_XE_BO_DEFRAG_SIZE_LIMIT: Maximum number of bytes to defrag per > > > > work run > > > > - DRM_XE_BO_DEFRAG_INTERVAL_MS: Default delay before defrag worker runs > > > > - DRM_XE_BO_DEFRAG_INTERVAL_MAX_MS: Upper bound for defrag worker > > > > interval > > > > > > > > > > Assisted-by: LLM > > > > > > NIT...Would runtime knobs be useful than these compile time knobs? > > > > > > > Yes, I think these will need to be made into runtime knobs. We'd still > > have Kconfig for default though. > > > > > > Update xe_bo.c to use these Kconfig options as defaults via #ifdef > > > > guards, maintaining backward compatibility with hardcoded values when > > > > not configured. > > > > > > > > Additionally, disable defrag completely when XE_BO_DEFRAG_SIZE_LIMIT is > > > > set less than 2M by returning early from xe_bo_defrag_update() (and > > > > xe_bo_defrag_remove()) so BOs are never added to the defrag list or the > > > > worker kicked; xe_bo_defrag_add() and xe_bo_defrag_schedule() assert the > > > > limit is at least 2M. > > > > > > > > Cc: Carlos Santa > > > > Cc: Ryan Neph > > > > Cc: Christian Koenig > > > > Cc: Huang Rui > > > > Cc: Matthew Auld > > > > Cc: Maarten Lankhorst > > > > Cc: Maxime Ripard > > > > Cc: Thomas Zimmermann > > > > Cc: David Airlie > > > > Cc: Simona Vetter > > > > Cc: dri-devel@lists.freedesktop.org > > > > Cc: linux-kernel@vger.kernel.org > > > > Cc: Thomas Hellström > > > > Assisted-by: GitHub_Copilot:claude-haiku-4.5 > > > > Signed-off-by: Matthew Brost > > > > --- > > > > drivers/gpu/drm/xe/Kconfig.profile | 40 ++++++++++++++++++++++++++++++ > > > > drivers/gpu/drm/xe/xe_bo.c | 26 +++++++++++++++++++ > > > > 2 files changed, 66 insertions(+) > > > > > > > > diff --git a/drivers/gpu/drm/xe/Kconfig.profile b/drivers/gpu/drm/xe/Kconfig.profile > > > > index e07517d120e0..e0aade41f53e 100644 > > > > --- a/drivers/gpu/drm/xe/Kconfig.profile > > > > +++ b/drivers/gpu/drm/xe/Kconfig.profile > > > > @@ -74,3 +74,43 @@ config DRM_XE_ENABLE_SCHEDTIMEOUT_LIMIT > > > > to apply to applicable user. For elevated user, all above MIN > > > > and MAX values will apply when this configuration is enable to > > > > apply limitation. By default limitation is applied. > > > > + > > > > +config DRM_XE_BO_DEFRAG_RECLAIM_BACKOFF_THRESHOLD > > > > + int "BO defrag reclaim backoff threshold" > > > > + default 2 > > > > + range 1 1000 > > > > > > Is the value of 1 intended here? As mentioned in patch 16, this will > > > reinforce the self backoff loop. > > > > > > NIT...Also the max value of the range here and below seems too higher > > > than the default value. Not sure if that is intended. > > > > > > > This is getting dropped. As I mentioned in other patches I'm changing > > this blindly turn off reclaim for all foreground allocations and only > > allow the defragmenter to flip on reclaim. This is the desired behavior > > for all client systems to avoid missing page flips at all costs. > > > > > > + help > > > > + Once this many BOs are tracked on the device defrag list (i.e. were > > > > + backed with a sub-optimal page order), request that the TTM pool backs > > > > + off from aggressive reclaim at the beneficial order during populate, > > > > + so that allocations make forward progress instead of stalling. > > > > + > > > > +config DRM_XE_BO_DEFRAG_SIZE_LIMIT > > > > + int "Maximum bytes to defrag per work run" > > > > + default 33554432 > > > > + range 0 1073741824 > > > > + help > > > > + Maximum number of bytes the defrag worker will process in a single run > > > > + before yielding and rescheduling itself. Set to less than large page > > > > + size (2M) to disable defrag. A defrag move synchronously reallocates > > > > + and re-copies a BO's backing store, which is not free. If a large > > > > + number of BOs become eligible at once, processing them all in one > > > > + worker run would hold things up for a long, unbounded stretch. > > > > + Instead, cap the work done per run and requeue, spreading the defrag > > > > + effort out over time. > > > > + > > > > > > The disable mechanism is confusing (0 to 2MB). May be add a separate runtime > > > knob for enable/disable and change the range here to start from 2MB? > > > > > > > Ok. > > > > > > +config DRM_XE_BO_DEFRAG_INTERVAL_MS > > > > + int "Default delay before defrag worker run (ms)" > > > > + default 25 > > > > + range 1 1000 > > > > + help > > > > + Default delay before (re)running the defrag worker, in milliseconds. > > > > + > > > > +config DRM_XE_BO_DEFRAG_INTERVAL_MAX_MS > > > > + int "Upper bound for defrag worker interval (ms)" > > > > + default 15000 > > > > + range 100 1000000 > > > > > > The range here overlaps with that of DRM_XE_BO_DEFRAG_INTERVAL_MS and it > > > accepts value lower than that of DRM_XE_BO_DEFRAG_INTERVAL_MS. > > > > > > > It does but there isn't a way Kconfig to enforce this. If someone really > > wants to compile with a broken Kconfig, IMO that is a user problem. > > > > Side effect this is, given in patch 20, interval_ms is calculated as, > interval_ms = min(INTERVAL_MS * 2, INTERVAL_MAX_MS), the wrong config > (INTERVAL_MS > INTERVAL_MAX_MS) ends up scheduling the worker sooner > in the first time instead of intended backoff. > > May be we can assert for such wrong configs in defrag_init_early function > as below? > xe_assert(xe, XE_BO_DEFRAG_INTERVAL_MS <= XE_BO_DEFRAG_INTERVAL_MAX_MS) > Actually I think a BUILD_BUG_ON will work - the kernel just won't compile if someone tries a bogus Kconfig. Matt > Niranjana > > > > > + help > > > > + Upper bound for the (exponentially backed off) defrag worker interval, > > > > + in milliseconds, so repeated failures don't push the retry arbitrarily > > > > + far out. 15000 ms = 15 seconds. > > > > diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c > > > > index 073d926ef9ac..0bdd1c920404 100644 > > > > --- a/drivers/gpu/drm/xe/xe_bo.c > > > > +++ b/drivers/gpu/drm/xe/xe_bo.c > > > > @@ -49,7 +49,11 @@ > > > > * aggressive reclaim at the beneficial order during populate, so that > > > > * allocations make forward progress instead of stalling. > > > > */ > > > > +#ifdef CONFIG_DRM_XE_BO_DEFRAG_RECLAIM_BACKOFF_THRESHOLD > > > > +#define XE_BO_DEFRAG_RECLAIM_BACKOFF_THRESHOLD CONFIG_DRM_XE_BO_DEFRAG_RECLAIM_BACKOFF_THRESHOLD > > > > +#else > > > > #define XE_BO_DEFRAG_RECLAIM_BACKOFF_THRESHOLD 2 > > > > +#endif > > > > > > > > > > Looks like The 'ifdef's are redundent here as the config params without any > > > dependency take the default value and hence will always turn out to be true. > > > > > > > This is existing style for everything in Kconfig.profile > > > > e.g. Look at xe_hw_engine.h > > > > > > /* > > > > * Maximum number of bytes of newly (re)allocated backing the defrag worker will > > > > @@ -65,17 +69,31 @@ > > > > * Only pages a move truly reallocates are charged; pages harvested from the old > > > > * backing are free, so an object larger than the budget is upgraded in > > > > * budget-sized slices across runs. > > > > + * > > > > + * Set to 0 to disable defrag completely. > > > > */ > > > > +#ifdef CONFIG_DRM_XE_BO_DEFRAG_SIZE_LIMIT > > > > +#define XE_BO_DEFRAG_SIZE_LIMIT CONFIG_DRM_XE_BO_DEFRAG_SIZE_LIMIT > > > > +#else > > > > #define XE_BO_DEFRAG_SIZE_LIMIT SZ_32M > > > > +#endif > > > > > > > > /* Default delay before (re)running the defrag worker, in milliseconds. */ > > > > +#ifdef CONFIG_DRM_XE_BO_DEFRAG_INTERVAL_MS > > > > +#define XE_BO_DEFRAG_INTERVAL_MS CONFIG_DRM_XE_BO_DEFRAG_INTERVAL_MS > > > > +#else > > > > #define XE_BO_DEFRAG_INTERVAL_MS 25 > > > > +#endif > > > > > > > > /* > > > > * Upper bound for the (exponentially backed off) defrag worker interval, in > > > > * milliseconds, so repeated failures don't push the retry arbitrarily far out. > > > > */ > > > > +#ifdef CONFIG_DRM_XE_BO_DEFRAG_INTERVAL_MAX_MS > > > > +#define XE_BO_DEFRAG_INTERVAL_MAX_MS CONFIG_DRM_XE_BO_DEFRAG_INTERVAL_MAX_MS > > > > +#else > > > > #define XE_BO_DEFRAG_INTERVAL_MAX_MS 15000 /* 15 seconds */ > > > > +#endif > > > > > > > > static void xe_bo_defrag_worker(struct work_struct *w); > > > > static void xe_place_from_ttm_type(u32 mem_type, struct ttm_place *place); > > > > @@ -1126,6 +1144,7 @@ int xe_bo_defrag_init(struct xe_device *xe) > > > > > > > > static void xe_bo_defrag_schedule(struct xe_device *xe) > > > > { > > > > + xe_assert(xe, XE_BO_DEFRAG_SIZE_LIMIT >= SZ_2M); > > > > schedule_delayed_work(&xe->mem.defrag.worker, > > > > msecs_to_jiffies(xe->mem.defrag.interval_ms)); > > > > } > > > > @@ -1152,6 +1171,7 @@ static void xe_bo_defrag_add(struct xe_bo *bo) > > > > > > > > xe_bo_assert_held(bo); > > > > xe_assert(xe, xe_bo_needs_defrag(bo)); > > > > + xe_assert(xe, XE_BO_DEFRAG_SIZE_LIMIT >= SZ_2M); > > > > > > xe_bo_defrag_init_early and xe_bo_defrag_init still runs if defrag is > > > disabled which can be avoided. > > > > > > > I'd rather not special case the init functions as they are harmless to > > run. Also if we switch runtime control of the defragmenter, you'd always > > have to call the init. > > > > Matt > > > > > Niranjana > > > > > > > > > > > scoped_guard(spinlock, &xe->mem.defrag.lock) { > > > > if (list_empty(&bo->defrag_link)) { > > > > @@ -1185,6 +1205,9 @@ static void xe_bo_defrag_remove(struct xe_bo *bo) > > > > { > > > > xe_bo_assert_held(bo); > > > > > > > > + if (XE_BO_DEFRAG_SIZE_LIMIT < SZ_2M) > > > > + return; > > > > + > > > > if (list_empty(&bo->defrag_link)) > > > > return; > > > > > > > > @@ -1204,6 +1227,9 @@ static void xe_bo_defrag_update(struct xe_bo *bo) > > > > { > > > > xe_bo_assert_held(bo); > > > > > > > > + if (XE_BO_DEFRAG_SIZE_LIMIT < SZ_2M) > > > > + return; > > > > + > > > > if (xe_bo_needs_defrag(bo)) > > > > xe_bo_defrag_add(bo); > > > > else > > > > -- > > > > 2.34.1 > > > >