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 D5006C9830D for ; Fri, 25 Sep 2026 06:55:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 703C410EA01; Fri, 25 Sep 2026 06:55:37 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="ZTCC3g7e"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 297CF10E586 for ; Fri, 25 Sep 2026 06:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1790319336; x=1821855336; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=kGBBHUwCbIOtOA4O8lZmGdl/ZU30rW/SdYwkD8QVfgk=; b=ZTCC3g7eHzl8SsBWGxUJ7QqtEIbDyE7mtoDQ3vNZS/jRSvWqT2gKYMVW UNifQzufwW0ukSLr1ZDPtAHT8FGJxeSQ2owI0QruByXaLKQe1Fr1voQgj kTyPxPdk8cka9Rh7D4idiBtTAyvbBw516iYdrL8+BDEYv4IYRty0Fb59e lwClR7VJVvcTyN3MYV1LAgVtWhzB1i6nb+CaSoHotn9yJeYpsqi+NvWH6 8iBjHe6YdcQlTVEHh9EfporGbpmh1O1rucfMO9pX4I6nJRLSZh1Lye0xF tXwqnvnSCNjiVFOTf4T66Z17vtflypyfb5Y2y0Fx4kxYyz3ftHAeBIPwG A==; X-CSE-ConnectionGUID: jPHoYSBTTmmUdpmEBz+fVA== X-CSE-MsgGUID: tpPOnc53QmWhM8ObAC3DeA== X-IronPort-AV: E=McAfee;i="6800,10657,11915"; a="91205908" X-IronPort-AV: E=Sophos;i="6.27,122,1787036400"; d="scan'208";a="91205908" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2026 23:55:35 -0700 X-CSE-ConnectionGUID: zni4QfPbS2CLrTC9eFg21A== X-CSE-MsgGUID: ULr3p4UbSf6XslS2ZkfNfA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,122,1787036400"; d="scan'208";a="274354374" Received: from orsmsx903.amr.corp.intel.com ([10.22.229.25]) by orviesa009.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2026 23:55:35 -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.46; Thu, 24 Sep 2026 23:55:34 -0700 Received: from ORSEDG902.ED.cps.intel.com (10.7.248.12) 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.46 via Frontend Transport; Thu, 24 Sep 2026 23:55:34 -0700 Received: from DM5PR21CU001.outbound.protection.outlook.com (52.101.62.4) 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.46; Thu, 24 Sep 2026 23:55:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pBEvpaQeayttq/0aUf8N68+r3mGHfJgjfZNZk9Ds42d2HAMd5bxZqV+4YqxPIM2J9u0/87cSQLBWOQPY75u//tz/YmunkglToOv5GnNdVS4wOBCUEO4d2R08ASLTtKyfzK0NPXqIR3crxcmOWxjQ9a/XN08qCdjhjDQR0zmP6A2P8aKDvgqj1hk3FP91rKIgo8u6gxp0RxugTplI0hdN1noGJjpk+M0VE9APRtSD3O8kzwnG/2h8QCHdC6q5gVc0INJqC1fYqxB4kGN/6xPF5Aw99MY9Dfn9XlYenIsbkIzNjaQkCOa4AtCtiEsPgv/IqbYCIBVIH52DbZjKv6Eykw== 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=hEFDpsMQcMdGc38ZpMrjxB3rDanYI6NneZGx16G9jfM=; b=KKSK6grAvIozP2fQV3gi3XJgiGXAKyAonDBBN4qNT32SMZ1/iTKk48Dd5vsuaYEdei1cUJcrGyQuGh9Q4shtZ6x6CPFE4YK/B7biLswnqnPgZ8is/XnIC4kwfCrGy/BYqyb43AnNBWZptfja6VtflbdQAzjzff9QCmAv4Txy+t93/b7rFwAmxl1fexiwa/uVUOdUG9imytWzsiF8YibhCW+G7dzWvY7dXoZUonnNkdFNeTKoJMtRlIFMU1Bgb6/Dt1egw0btmjvQVIOhncRiVCz+jYEyZls4rlxcO3J+zb6Ti5FWDC0n0/u7AdPFry3No9cAV//alffDdJxzFrIQ4A== 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 BL1PR11MB5255.namprd11.prod.outlook.com (2603:10b6:208:31a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.451.18; Fri, 25 Sep 2026 06:54:31 +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.0451.014; Fri, 25 Sep 2026 06:54:30 +0000 Date: Thu, 24 Sep 2026 23:54:28 -0700 From: Matthew Brost To: CC: Subject: Re: [PATCH v7 13/24] drm/xe: Enable CPU binds for jobs Message-ID: References: <20260925045320.1325860-1-matthew.brost@intel.com> <20260925045320.1325860-14-matthew.brost@intel.com> <20260925060326.27F9A1F000FF@smtp.kernel.org> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260925060326.27F9A1F000FF@smtp.kernel.org> X-ClientProxiedBy: SJ0PR03CA0069.namprd03.prod.outlook.com (2603:10b6:a03:331::14) To CO1PR11MB4787.namprd11.prod.outlook.com (2603:10b6:303:95::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PR11MB4787:EE_|BL1PR11MB5255:EE_ X-MS-Office365-Filtering-Correlation-Id: 4a566e0a-83c2-41fc-3f1f-08df1ad1d918 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|366016|23010399003|6133799003|10067099003|22082099003|18002099003|56012099006|11063799006|4143699003; X-Microsoft-Antispam-Message-Info: 7VEWFCtZ0htU8SQdFYxVpRhex7N8SXMtfqm9yAeVhU43gz3f7WnQ/JcctuBL+KmusDZHtrsd1MHJxKwqbqeGDlbauB4UJUH8qKEqUUnqxpSIs5rXjH1tSKwKX+LQOz34wDkAlrYeuk+CVMnI6cX4lYGRbb/B/RtBG/0F2CnE3jMRGLQGsLAA80d33o/ELIRuCAQj0YQFYzjWIdRvLM4NCtucAnoIrpsxLibgtAqNZGuep20vOPlw95h4qrTYzifMvsMPUqDPj0IMsbdhcY6gaHdMlPm9bU1I5dYVcxVTjIugXJYO0D5pHSdejtrtk2/mTYJWHmEZpn7mTzNmEdkxDPZSIdAXU+AXTaMFjx0gFDeTMZ4R91XwuWOJOHjRthNoeIVtGWG7Buooxr9/9pt5AZxJ0uHx9mAZWST5fEX13YuqFjnfRBaLTXMhruLKiDG7lCkbkuZbaHhAjgCLeLLtIAahIvDX08r48ALEXKEFCeNJ3SmvXVoGZ62+oqGsn8CSRFXwz7Rfy8JDfGPrBXqBcDTgaeJ5+Id/n3lHFfXf3grry39pd8T724rLU+dOQsBjltiFCZUfzuDgGd12nPCmIPX6L8YRbDfSOsX9eYsEhj0= 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)(376014)(1800799024)(366016)(23010399003)(6133799003)(10067099003)(22082099003)(18002099003)(56012099006)(11063799006)(4143699003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?97iLyEwSREL6fl2U+dX94ddxzuVTSJDJOcdkoTRYpfmqAeqpT0MfQDYZOT?= =?iso-8859-1?Q?9yJ3qudPIu3zYErAiYTxnM0bPNtGK2ciwmPuWH8ZQHDrI2UBUZ/tnlDOqM?= =?iso-8859-1?Q?Np+pWy7p4zl4YhJWx1z0Pfe8mpwZ35aLtiAxcy13y4y9I3sb3XJEY0qvos?= =?iso-8859-1?Q?xodFaaRwqm4bidbL83qYMYwD0eSYnsnb7p3KfdfSAYBNqUxPTbl7msihOn?= =?iso-8859-1?Q?3nYJMXB5pBf3FZ+kcE/9cU382VIJynjx5FqilwdkeXvAxGhin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2aXgPpQqK0Eu7gjWIquo2r3l+wMY5UqPdSgDi3z3MW5CWDZh53WAUVBf+FA6uoZW1qyqb4s9ozmJU/6Gz9cK8H+sJBsTMgP/0niK31jpeEzOYY5DJm2XvBpkZew== X-MS-Exchange-CrossTenant-Network-Message-Id: 4a566e0a-83c2-41fc-3f1f-08df1ad1d918 X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4787.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2026 06:54:30.3975 (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: QCn7YryLtVyPOJKnwsuWeJvwoxXb/6B+RJ7n+PA/Hc600ZL9DYMHgOmU/QUkWaB3pLy9kj/y955JRrangjAyYg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5255 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 25, 2026 at 06:03:25AM +0000, sashiko-bot@kernel.org wrote: > Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: > - [High] drm/xe: memory leak of pt_job_ops and dma_fence when PT jobs are canceled > - [High] drm/xe: GPU hang and memory leak due to missing CPU bind support in Execlist backend > -- > > commit 6471c15e2149c2517458e891e7dceef8c5573f97 > Author: Matthew Brost > > drm/xe: Enable CPU binds for jobs > > This commit updates the migration layer to formulate page table jobs that > issue CPU binds in the submission backend. All code related to GPU-based > binding is removed to lower latency and avoid PTE migration limits. > > > diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c > > --- a/drivers/gpu/drm/xe/xe_migrate.c > > +++ b/drivers/gpu/drm/xe/xe_migrate.c > [ ... ] > > @@ -1937,162 +1866,18 @@ __xe_migrate_update_pgtables(struct xe_migrate *m, > > { > > const struct xe_migrate_pt_update_ops *ops = pt_update->ops; > > struct xe_tile *tile = m->tile; > > struct xe_sched_job *job; > > struct dma_fence *fence; > > bool is_migrate = is_migrate_queue(m, pt_update_ops->q); > > + int err; > > > > - job = xe_bb_create_migration_job(pt_update_ops->q, bb, > > - xe_migrate_batch_base(m, usm), > > - update_idx); > > + job = xe_sched_job_create(pt_update_ops->q, NULL); > > [Severity: High] > Does the Execlist backend properly handle these new PT jobs? > Execlist backend is dead. Non-issue. > Since xe_sched_job_create() is now called with a NULL batch address, these > jobs rely on backend interception. However, looking at execlist_run_job() in > the Execlist backend: > > drivers/gpu/drm/xe/xe_execlist.c:execlist_run_job() { > ... > q->ring_ops->emit_job(job); > xe_execlist_make_active(exl); > > return job->fence; > } > > If GuC submission is disabled, it appears the backend receives this job and > directly emits it to the ring without an is_pt_job() check. Could this result > in pushing an uninitialized batch address to the hardware, causing a GPU hang > and leaking the pt_job_ops structures? > > > if (IS_ERR(job)) { > > err = PTR_ERR(job); > > - goto err_sa; > > + goto err_out; > > } > > > > - xe_sched_job_add_migrate_flush(job, MI_INVALIDATE_TLB); > > + xe_tile_assert(tile, job->is_pt_job); > > > > if (ops->pre_commit) { > > pt_update->job = job; > > @@ -2103,6 +1888,12 @@ __xe_migrate_update_pgtables(struct xe_migrate *m, > > if (is_migrate) > > mutex_lock(&m->job_mutex); > > > > + job->pt_update[0].vm = pt_update->vops->vm; > > + job->pt_update[0].tile = tile; > > + job->pt_update[0].ops = ops; > > + job->pt_update[0].pt_job_ops = > > + xe_pt_job_ops_get(pt_update_ops->pt_job_ops); > > + > > [Severity: High] > Is there a memory leak if this PT job gets canceled before execution? > Again non-issue - _arm() always equals run_job() call. Non-issue. Matt > We acquire a reference to pt_job_ops here, and xe_sched_job_arm() takes an > extra dma_fence reference. If the job is canceled (for example, from an > execution queue kill or GPU reset), the DRM scheduler calls the free_job > callback which ultimately calls xe_sched_job_destroy(): > > drivers/gpu/drm/xe/xe_sched_job.c:xe_sched_job_destroy() { > ... > xe_sched_job_free_fences(job); > dma_fence_put(job->fence); > drm_sched_job_cleanup(&job->drm); > job_free(job); > } > > Since xe_sched_job_destroy() doesn't check job->is_pt_job, it seems we never > drop the pt_job_ops or the extra dma_fence reference. This would permanently > leak the deferred actions and their associated page table BO references. Does > the job destruction path need updating to clean up canceled PT jobs? > > > xe_sched_job_arm(job); > > fence = dma_fence_get(&job->drm.s_fence->finished); > > xe_sched_job_push(job); > > -- > Sashiko AI review · https://sashiko.dev/#/patchset/20260925045320.1325860-1-matthew.brost@intel.com?part=13