From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5180BC79F80 for ; Fri, 4 Sep 2026 04:11:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0966710F804; Fri, 4 Sep 2026 04:11:40 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="h2BH0yLE"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id CCEA610F804 for ; Fri, 4 Sep 2026 04:11:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1788495098; x=1820031098; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=J1PMY+HhoJ89oGSSgKlzubwNsJB6ATEg8AjsuywuKIQ=; b=h2BH0yLE3A/yznZEV6B1d7OW9doj0Cb7BYXc5VNuEK7hGKpOEOQDvsrl ZOiKmz+gBAC6T4uSShg0rzCP6+yDmeaQZU9LXRU7LBa7xNGUJ/e/Nbpx4 sXzI7a1Lt7IhqmtTqiGT4NijMGJLjfv4nhnyqb/hRa2kisaOK3uDkz776 6vY8oV+mJknlF7f6AWUiZxNmK2SeCCPGs3qkYWyUAq3Q8bPX48kLEk1a/ PaCWG0NiAyQhlffcT8zCfpUZFMJqkATtZmX00ijITd58RbwQTxm59yMoG Li+0WpQ9Ue2jg73fXgu9z0FX9kL+BzpANh9Rr//Ktz5u2TboUKILba4Fp A==; X-CSE-ConnectionGUID: SotD4PINR6+p/sKamZ2TWA== X-CSE-MsgGUID: StcBhUbWSeOucBhfE4L01A== X-IronPort-AV: E=McAfee;i="6800,10657,11895"; a="91504704" X-IronPort-AV: E=Sophos;i="6.25,260,1779174000"; d="scan'208";a="91504704" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2026 21:11:38 -0700 X-CSE-ConnectionGUID: YyZfRasWSPOZgfHhtAHTHQ== X-CSE-MsgGUID: S7cMTi6SQACShqF8irLzaA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,260,1779174000"; d="scan'208";a="274066256" Received: from fmsmsx902.amr.corp.intel.com ([10.18.126.91]) by orviesa005.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2026 21:11:38 -0700 Received: from FMSMSX901.amr.corp.intel.com (10.18.126.90) by fmsmsx902.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.46; Thu, 3 Sep 2026 21:11:37 -0700 Received: from fmsedg903.ED.cps.intel.com (10.1.192.145) by FMSMSX901.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.46 via Frontend Transport; Thu, 3 Sep 2026 21:11:37 -0700 Received: from BYAPR05CU005.outbound.protection.outlook.com (52.101.85.63) by edgegateway.intel.com (192.55.55.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.46; Thu, 3 Sep 2026 21:11:37 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=onkDODU1ROl068GNaQTl51ku1aeouSRRxMaZEQ1In76/60WizqdNbdMkwt9j7J63Azg0vSqXAwrIOZmvtREWOQc4QFACFpcL/rXeWt4Dsb4OzCRh7R27NDUDVecLHHMhpc+IKG9CpDv2RtlI/qoaw68/J6c5E2LYwVo583wZnhy/3WHW+Bj626cxSSh5YjpOwrQU3Z7fKPQ1SnRS2GjmzsDe2Xit+bddCX7ww+y6//eMFfiFfgKrJcqbnArpKIyhWZjkhTEA4CBmK2NdjD8Y9wwWyO4008ujU0LV6vN7bvjWXv9ZnTh+s/2YSldhK4k7Ibpp5c57C5wVDZPOxmUklA== 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=/P1uDo2x6OFdSSSMRG62KWNX9Jxg5FM9OAkEXVpDo/I=; b=PqPiej8hqbFcyKE7w2iWtuuWIxO+wUY2jskZTpNPCn8UGBNOYyp38JIJ2HO7n97O0xP+ZvKPe+Sgp+cMrDeIr/6CqF2doA859DqK6FIQ8/aRR0C0jmll/b+Wao5DwpzwapSh8b9gzX1IZGFStH4y7aqTO5FaQcTz9/I/nbGrHRzzYwJDjZed02DDGQHuwEj2ASexFUDu6eE+H3EWONqq7aGE8tKuK9lA4NmM/QqEXnf+bXvPHVQw+Q+Yk/hqH+hlmuaOev2Qm6O+Gra+6OOBNy0MN2TgIPa/7Nnn5oRxa3Rp/ERsDFXCneMwwO+ozYsaYKV8XNYqzeggzng982DAig== 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: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH7PR11MB6522.namprd11.prod.outlook.com (2603:10b6:510:212::12) by DS0PR11MB7927.namprd11.prod.outlook.com (2603:10b6:8:fd::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.382.10; Fri, 4 Sep 2026 04:11:34 +0000 Received: from PH7PR11MB6522.namprd11.prod.outlook.com ([fe80::e0c5:6cd8:6e67:dc0c]) by PH7PR11MB6522.namprd11.prod.outlook.com ([fe80::e0c5:6cd8:6e67:dc0c%4]) with mapi id 15.21.0360.008; Fri, 4 Sep 2026 04:11:34 +0000 Date: Thu, 3 Sep 2026 21:11:32 -0700 From: Matthew Brost To: CC: Subject: Re: [PATCH v5 20/25] drm/xe: Add ULLS migration job support to migration layer Message-ID: References: <20260904022207.3490018-1-matthew.brost@intel.com> <20260904022207.3490018-21-matthew.brost@intel.com> <20260904024440.206631F000E9@smtp.kernel.org> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260904024440.206631F000E9@smtp.kernel.org> X-ClientProxiedBy: MW4PR03CA0320.namprd03.prod.outlook.com (2603:10b6:303:dd::25) To PH7PR11MB6522.namprd11.prod.outlook.com (2603:10b6:510:212::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR11MB6522:EE_|DS0PR11MB7927:EE_ X-MS-Office365-Filtering-Correlation-Id: 095e1f5f-ab68-4b3c-f990-08df0a3a9b99 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|23010399003|1800799024|366016|6133799003|11063799006|56012099006|4143699003|10067099003|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: DA+2Vvt9QvaI6XNGcMe3Prh8U0tm95rstXpjA/8GqiyuMXit9ULW0ePY4gGWX9AYdUcBqRIFp0zBi6lAmBEwFNyfNuGCvtpC7NPluo/jVWl+C6tKwIHk15qKpQ3Pq21U0+gim5g4Rx6HxG3os1g8RV7lqw7pYrXGRnfDu2JYOpPMOLEG4uCaroyCF4gRl59581gzXy+MdWhzPjYLlhJQmgTAQREq50XX8dGaUlKPGo5jW/hK+VQzVDbnXy96f+vSf9Pphz/R+JHxaVt8SwUe18WHKtSgGxBdhbEURfSX2rN1iY0cpChvKwkltua387g84CbF7rLVWS6Pcz7vZKv39JPsl73YTv2Yy5YcuofVMROT12D/hgaKNE9q49zWpiS04U75Upm1Yx0ORqTQV0mWs2iHALGUE9ZdhVf6HVTilxmbTnroN7NNea86WnCXqDWtltcqIQO6MVj3A2HTYP2cvZvnhiqXSrdbzIcoUlCoqI4CH5YOe2nSwzHc5AB+ynZIAeXZPlf7rgLtX5JWZK6Vbg1VwsmycEY7HPGiT2LPUl7xWswHakSAReARB9SmvE+cli+ioo3oYrq11sqak/Eq1iGz30eMDDvrOowlU0xMmJI= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR11MB6522.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(23010399003)(1800799024)(366016)(6133799003)(11063799006)(56012099006)(4143699003)(10067099003)(22082099003)(18002099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?2Ubg6P3tQ4rYm7btHPWKlL+XPB2aL+rsJX2hPygfIiutnvzXtxzEbkJPWD?= =?iso-8859-1?Q?A3eFwh8nMcJSy1vSWTpXnhFLI1ZTZEizFx2qiYwbV/tbtWJHlVElLt1xw2?= =?iso-8859-1?Q?kMLmbxe2+rDlgrUbnu9yEW5GK9g0y8+N8veL/5KluytASbUKlaD3AJ+5fI?= =?iso-8859-1?Q?r2qgvQr/CIdvwIEPBwQ0Ouc85xpVuAUcB5xVssUYgDv5KgAv/npFtmPxss?= =?iso-8859-1?Q?dHe3/ZckPryf7qHGFT2v28bdj+TYHcTWIG+XWN+XddmEzW1pmq/Vjz99Cf?= =?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bNXufi0fjoXxse6quxMrhZYkFcsKG+Xaw5erEfmBuTmOzGLMnyOaegyT6MCO2zXszdK0InpSJxUuMoP/QJsun6BIXgqjInzkFMTexD3w== X-MS-Exchange-CrossTenant-Network-Message-Id: 095e1f5f-ab68-4b3c-f990-08df0a3a9b99 X-MS-Exchange-CrossTenant-AuthSource: PH7PR11MB6522.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2026 04:11:34.6114 (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: YHGYS1Bg5L6sotfgfOZm2bo3kncqc73lspssQ4tb8gcFL+w64qKzHYVSAp3+Ajp8O5vyc1J5pDHK4ROBsws6yQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7927 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-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" On Fri, Sep 04, 2026 at 02:44:39AM +0000, sashiko-bot@kernel.org wrote: > Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider: > - [High] ULLS_EXIT_JIFFIES evaluates to 0 on HZ=100 configurations, causing a tight spin loop. > - [High] Deadlock caused by synchronous dma_fence_wait while holding reclaim-tainted job_mutex. > - [Medium] Asynchronous runtime PM put used during device teardown path. > -- > > commit 1b246ef0dc00023e2aba23868ed86c7ff7c9257a > Author: Matthew Brost > > drm/xe: Add ULLS migration job support to migration layer > > Add function to enter ULLS mode for migration job and delayed worker to > exit (power saving). ULLS mode expected to entered upon page fault or > SVM prefetch. ULLS mode exit delay is currently set to 5ms. > > Link: https://patch.msgid.link/20260228013501.106680-21-matthew.brost@intel.com > > > diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c > > index 471ae5741836e..588e1c9085f31 100644 > > --- a/drivers/gpu/drm/xe/xe_migrate.c > > +++ b/drivers/gpu/drm/xe/xe_migrate.c > > [ ... ] > > > @@ -77,6 +80,14 @@ struct xe_migrate { > > struct dma_fence *fence; > > /** @min_chunk_size: For dgfx, Minimum chunk size */ > > u64 min_chunk_size; > > + /** @ulls: ULLS support */ > > + struct { > > + /** @ulls.enabled: ULLS is enabled */ > > + bool enabled; > > +#define ULLS_EXIT_JIFFIES (HZ / 200) /* 5ms */ > > [Severity: High] > Does this calculation truncate to 0 when HZ=100? > > If HZ < 200, ULLS_EXIT_JIFFIES evaluates to 0. When xe_migrate_ulls_exit > executes while the queue is not idle, it reschedules itself with a delay > of 0. This results in an immediate re-execution of the worker, creating a > tight spin loop and causing a soft lockup with 100% CPU utilization until > the queue becomes idle. > Also right. Should be: ((5 * HZ) / MSEC_PER_SEC) Matt > > + /** @ulls.exit_work: ULLS exit worker */ > > + struct delayed_work exit_work; > > + } ulls; > > }; > > > > #define MAX_PREEMPTDISABLE_TRANSFER SZ_8M /* Around 1ms. */ > > @@ -98,6 +109,16 @@ struct xe_migrate { > > static void xe_migrate_fini(void *arg) > > { > > struct xe_migrate *m = arg; > > + struct xe_device *xe = tile_to_xe(m->tile); > > + > > + disable_delayed_work_sync(&m->ulls.exit_work); > > + mutex_lock(&m->job_mutex); > > + if (m->ulls.enabled) { > > + xe_force_wake_put(gt_to_fw(m->q->hwe->gt), m->q->hwe->domain); > > + xe_pm_runtime_put(xe); > > [Severity: Medium] > Will this asynchronous put call in the teardown path be canceled by the > subsequent PM disable? > > xe_migrate_fini acts as the devm cleanup action. It calls xe_pm_runtime_put > which queues an asynchronous suspend. However, during driver teardown, > pm_runtime_disable will cancel this pending async work before it executes, > leaving the hardware incorrectly in an active power state. > > Should this be a synchronous pm_runtime_put_sync instead? > > > + m->ulls.enabled = false; > > + } > > + mutex_unlock(&m->job_mutex); > > > > xe_vm_lock(m->q->vm, false); > > xe_bo_unpin(m->pt_bo); > > [ ... ] > > > +static void xe_migrate_ulls_exit(struct work_struct *work) > > +{ > > + struct xe_migrate *m = container_of(work, struct xe_migrate, > > + ulls.exit_work.work); > > [ ... ] > > > + mutex_lock(&m->job_mutex); > > + > > + if (!xe_exec_queue_is_idle(m->q, 1)) > > + goto unlock_exit; > > + > > + xe_sched_job_get(job); > > + xe_sched_job_arm(job); > > + job->is_ulls = true; > > + job->is_ulls_last = true; > > + fence = dma_fence_get(&job->drm.s_fence->finished); > > + xe_sched_job_push(job); > > + > > + /* Serialize force wake put */ > > + dma_fence_wait(fence, false); > > [Severity: High] > Does waiting on this dma-fence while holding the reclaim-tainted job_mutex > create a deadlock? > > m->job_mutex is explicitly annotated as being part of the memory reclaim path > via fs_reclaim_acquire/release in xe_migrate_init. By synchronously > waiting on a dma-fence with dma_fence_wait while holding this mutex, a > circular dependency is created with the memory allocator. > > If the system is under memory pressure and triggers reclaim while signaling > the fence, or if a GPU reset (which must allocate memory) is needed to signal > the fence, the reclaim path will attempt to acquire job_mutex and block > forever. > > > + dma_fence_put(fence); > > + > > + m->ulls.enabled = false; > > +unlock_exit: > > -- > Sashiko AI review · https://sashiko.dev/#/patchset/20260904022207.3490018-1-matthew.brost@intel.com?part=20