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 623CF606A31A for ; Tue, 27 Oct 2026 19:41:05 +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=B62w8Va7 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2936B10E47D; Tue, 27 Oct 2026 19:41:00 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3454910E493 for ; Tue, 27 Oct 2026 19:40:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1793130054; x=1824666054; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=Cn8ha/UX6geWrjHUs9twB/3QSPHq2S1C5Jjnj2ZYQrc=; b=B62w8Va7X/g+1qlPrPn4iOYsJ5Cm5iwL1M2WFTtHYjZoddX9pZVRK9XQ 6qCMdcKHxREAR3lzbEnFlytf9XDbOyY4vrESiKMrxhOle/grQcvMzYDBG P+xKrm6CR4EecawrCy22fw76Cm03alKFo3T//JzjGJdXZyEKX7+cnuzgH euhmcz1OkrATK76DYIHkXEtLcW/PcYSut9Vpx6U+Q3n8yAn1PQlm5gKb2 tlAcrb83MpYKE/nNlDISnx9d+VZ4UFQIv0EZGmfr6OfuWDEMZNUgAMhJC bKrum6QTeZ9JXK7WfziVNpV0swIOZrTRXSgwK8GL+tjuj+lXh8B/Ccbwx Q==; X-CSE-ConnectionGUID: lQvCX/GFRpu6ZE5L+pYR2g== X-CSE-MsgGUID: p0vJFureRXmzo63xv1UcpQ== X-IronPort-AV: E=McAfee;i="6800,10657,11948"; a="1736038" X-IronPort-AV: E=Sophos;i="6.27,181,1787036400"; d="scan'208";a="1736038" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2026 12:40:53 -0700 X-CSE-ConnectionGUID: gYE/sMQWS4m/5tXwPBM3cg== X-CSE-MsgGUID: GW5z1/+6R4ydBYHq0gAGxw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,181,1787036400"; d="scan'208";a="4587525" Received: from fmsmsx901.amr.corp.intel.com ([10.18.126.90]) by orviesa001.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2026 12:40:54 -0700 Received: from FMSMSX902.amr.corp.intel.com (10.18.126.91) 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.49; Tue, 27 Oct 2026 12:40:53 -0700 Received: from fmsedg902.ED.cps.intel.com (10.1.192.144) 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.49 via Frontend Transport; Tue, 27 Oct 2026 12:40:53 -0700 Received: from SJ2PR03CU001.outbound.protection.outlook.com (52.101.43.15) by edgegateway.intel.com (192.55.55.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.49; Tue, 27 Oct 2026 12:40:52 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=usc+iDu+XuF81PqAUJJEtdZpfafL3ixYN6Setvuqr5X9G8Mk41UbcnC5j6HkQSiMEMIA7pJCBQl/YAL1jWDLDcP0Xeukt1G3cRZ9p1Tj3hwp9zOWFkZpoWvZVwkktHeabPEN5DmKcBAx4VOS28skyHhCQngcIzN4v/HZgPQ3bP5+8tGA225WyVldAUlvV1VWUNWoQFHKYsI8Q4NmbX+P9vrIwG+DG6doLNxHGLQvB/lgq+r0GeChzT4U46LGLj8jMGInZNpPwY54I38WgJTWMfWETTKJeh9krkg3YWpVKCxb1lpQ8Yi1jxZDHdrCb8TOZbE2++uFE1XpFfnCNsz7hw== 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=c9p60OpTQtgX+DsgRHqvKFFcOFlyYLFbqCfR5rU/0Oc=; b=n0sf8zjE3z1Hz39n+WPSRT9EZuzBJYzB3eL2kTuHGnsy0Ai8oUwhpsjxuCvobQovk3cX8Pb6V0suDU5vOtA9fv8G2MSxBM71JiOA8Wo9/2DP99e1l1rFaluZy4XMReS0xnu58LCzAJyG2Q+JUiUgs1H4+zUC4vfBpJ20HYesGe3y0+TKVJ4CSEVIz85WYd6LUM13gcglzKMPamstWc1wq4K2O+p015GifJqEbW6amldOk6Ldz4biPfSpFylSRHObDUN2KKisl6eYSPYUX9KKjuA+Wv0BZC/z+hb3k+1mglz+oRXu+TfOtuTNoMGl6GUztdUwtDkUTUbHW5o9z+ycMA== 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 CH3PR11MB291940.namprd11.prod.outlook.com (2603:10b6:610:366::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.546.22; Tue, 27 Oct 2026 19:40:50 +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.021; Tue, 27 Oct 2026 19:40:50 +0000 Date: Tue, 27 Oct 2026 12:40:48 -0700 From: Matthew Brost To: CC: Subject: Re: [PATCH v4 3/5] drm/xe: Leave the VM bulk move on BO release, not on GEM close Message-ID: References: <20261027183638.1031299-1-matthew.brost@intel.com> <20261027183638.1031299-4-matthew.brost@intel.com> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: MW4PR04CA0340.namprd04.prod.outlook.com (2603:10b6:303:8a::15) 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_|CH3PR11MB291940:EE_ X-MS-Office365-Filtering-Correlation-Id: 60a0c64f-92bd-47bb-0db1-08df346234c4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|366016|23010399003|1800799024|261026121527099003|11063799006|4143699003|56012099006|10067099003|261021123027099003|261021121427099003|261022105027099003|261009221227099003|261009223027099003|261022075727099003|18002099003|22082099003|6133799003|261026140227099003; X-Microsoft-Antispam-Message-Info: DgcAn64lfK3LTLckUe6WXddP8GA9nEN7UEk4xHGP8lj/N/L0UmZjbOXhFS1uX9QKXaiCJkV80VjpF6+a3DYH3+ORY3xONG+X5vMsZRtg6NGSmqeOWgZNm2Hyw08Q28rNNvltjK/VGQoOcHjDQB8sFYKBrsK9EHA4mjh3eSDk9VHTTHLZaciGxYmzygKBcyqPVCdaYW3YTd0ICO8PmXWOtCH9yYdVinHvGkAdsXFy95n6RJHeq8ITGIdCfQVz6DUCXeXrY+u/ziZPth3w5F9zFhxIMFmSSFolyO+PiLjeieIBtP1V4mf7LDn7U9EpyRnBvvSKLcds/VryzkltjUmUFzeMhetd8nDcFNQsdvUeU1XDhomGzFNU2N79QxemhGboO077m7vGLkpq77SKGVbrAbQ32rnMyndOdLapM3AELF/eyUg4x5cNbNMkJbBe0TND9+35Mpmq5tfDproBzJUv6mqCU5X7Lmf0aF8cAi0ntg6eF268rzvAzmT6xlnkJP8l6XIvQ/Nk2oe4fjTRxSZagIWK9MYncfGQ9GoUfUZonUGb2S5OBbbk3zv05N9JI5Hamp5deDRriBzPpgSBVzRgw5ohF4Jf77LeRLHkeXFLbwU= 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)(366016)(23010399003)(1800799024)(261026121527099003)(11063799006)(4143699003)(56012099006)(10067099003)(261021123027099003)(261021121427099003)(261022105027099003)(261009221227099003)(261009223027099003)(261022075727099003)(18002099003)(22082099003)(6133799003)(261026140227099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?Ad/5hAuGublTPo5b1geB8TmI0kzitdlbsB9lEJESWzJBLhGM6YkAqlTA+Q?= =?iso-8859-1?Q?Lma0zZ5V4QkS11/gPrImPhmqJ/UJSpQx1FTaXpFB4wvdmfbzzaSaclF/Tb?= =?iso-8859-1?Q?Sp92H2ARghXoT4Xa2lE/s+FuUHXBaDPxgCe0CABU44LmR3OJWG9mVVpOeY?= =?iso-8859-1?Q?rtcHPr536btgKwEyhALOYI+ywbXWL8FUKngHIkVzIWtxMblHT6wAP7Lu5E?= =?iso-8859-1?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xnMtNfi4kgONGgahHO2NhvtGnTI91/ihaeS1lSd1BaCTRYr7Bqj45MGYrgeuk4Hg37sYuu2FXPMJyP18QPwkaHgu5Osu4PYn3xeCJhfNC87YppipqOpmmTzQbg2w9EWInxzuBKrFSgSknzEKRcTD6w== X-MS-Exchange-CrossTenant-Network-Message-Id: 60a0c64f-92bd-47bb-0db1-08df346234c4 X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4787.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2026 19:40:50.8200 (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: Rzf/GfX1unq1pjr7hf78EVYYU+Q/Z1OlAUiqfj5P/w3WZnEaUrfzFERrAZEZBUbmmgC/xhGKEsluvH78ciTCBQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR11MB291940 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=-11.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 27, 2026 at 12:01:33PM -0700, Matthew Brost wrote: > On Tue, Oct 27, 2026 at 06:47:57PM +0000, sashiko-bot@kernel.org wrote: > > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: > > - [High] drm/xe: bulk_move detach in xe_ttm_bo_release_notify() violates TTM invariants > > -- > > > > commit 5d85520c1e2e507cc032c4248bd48c50a734e710 > > Author: Matthew Brost > > > > drm/xe: Leave the VM bulk move on BO release, not on GEM close > > > > This commit removes xe_gem_object_close() and moves the detachment of a > > VM-private BO from its VM's LRU bulk move into xe_ttm_bo_release_notify() > > so that BOs outliving their GEM handles remain part of the VM bulk move > > until release. > > > > > diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c > > > index 42a6aa1a2e4a0..ba16b260dbcb7 100644 > > > --- a/drivers/gpu/drm/xe/xe_bo.c > > > +++ b/drivers/gpu/drm/xe/xe_bo.c > > > @@ -1869,6 +1869,14 @@ static void xe_ttm_bo_release_notify(struct ttm_buffer_object *ttm_bo) > > > if (!xe_ttm_bo_lock_in_destructor(ttm_bo)) > > > return; > > > > > > + /* > > > + * Leave the VM's bulk move, which is only kept alive by the VM, and > > > + * whose LRU position no longer says anything about a BO on its way > > > + * out. > > > + */ > > > + if (ttm_bo->bulk_move) > > > + ttm_bo_set_bulk_move(ttm_bo, NULL); > > > > [Severity: High] > > Ugh, this is correct - this patch doesn't work but the code prior to > this patch is also incorrect. > > I'm not immediately spoting an obvisous solution, so I will just drop > this patch for now. > So it probably is; - If in xe_gem_object_close if bind count == 0, remove from bulk - If in a bind operation, bind count == 0 and gem handle closed, remove from bulk I will do this part in an independent follow up. Matt > Matt > > > Does detaching from bulk_move in xe_ttm_bo_release_notify() happen too late > > in the TTM teardown sequence? > > > > When the final reference to a VM-private user BO on a non-fault-mode VM is > > dropped via xe_gem_object_free() -> ttm_bo_fini() -> ttm_bo_put() -> > > ttm_bo_release(), ttm_bo_release() checks bo->bulk_move and individualizes > > bo->base.resv before invoking bdev->funcs->release_notify(): > > > > drivers/gpu/drm/ttm/ttm_bo.c:ttm_bo_release() { > > ... > > WARN_ON_ONCE(bo->pin_count); > > WARN_ON_ONCE(bo->bulk_move); > > > > if (!bo->deleted) { > > ret = ttm_bo_individualize_resv(bo); > > if (ret) { > > /* Last resort, if we fail to allocate memory for the > > * fences block for the BO to become idle > > */ > > dma_resv_wait_timeout(bo->base.resv, > > DMA_RESV_USAGE_BOOKKEEP, false, > > 30 * HZ); > > } > > > > if (bdev->funcs->release_notify) > > bdev->funcs->release_notify(bo); > > ... > > } > > > > Because bo->bulk_move is still set upon entering ttm_bo_release(), releasing > > such a BO will immediately trigger WARN_ON_ONCE(bo->bulk_move). > > > > In addition, ttm_bo_individualize_resv() switches bo->base.resv away from > > xe_vm_resv(vm) to &bo->base._resv under bo->bdev->lru_lock and then drops > > lru_lock while the BO's resource is still linked in vm->lru_bulk_move: > > > > drivers/gpu/drm/ttm/ttm_bo.c:ttm_bo_individualize_resv() { > > ... > > spin_lock(&bo->bdev->lru_lock); > > bo->base.resv = &bo->base._resv; > > spin_unlock(&bo->bdev->lru_lock); > > ... > > } > > > > In the window between ttm_bo_individualize_resv() and > > ttm_bo_set_bulk_move(ttm_bo, NULL) in xe_ttm_bo_release_notify(), another > > thread holding xe_vm_resv(vm) can access vm->lru_bulk_move while the dying > > BO is still pos->first or pos->last: > > > > - Calling xe_vm_bump_lru() -> ttm_lru_bulk_move_tail() will fail > > dma_resv_assert_held(pos->first->bo->base.resv) or > > dma_resv_assert_held(pos->last->bo->base.resv) in > > drivers/gpu/drm/ttm/ttm_resource.c: > > > > drivers/gpu/drm/ttm/ttm_resource.c:ttm_lru_bulk_move_tail() { > > ... > > lockdep_assert_held(&pos->first->bo->bdev->lru_lock); > > dma_resv_assert_held(pos->first->bo->base.resv); > > dma_resv_assert_held(pos->last->bo->base.resv); > > ... > > } > > > > - Adding or moving another resource in the same bucket via > > ttm_resource_add_bulk_move() -> ttm_lru_bulk_move_add() will trigger > > WARN_ON(pos->first->bo->base.resv != res->bo->base.resv): > > > > drivers/gpu/drm/ttm/ttm_resource.c:ttm_lru_bulk_move_add() { > > ... > > } else { > > WARN_ON(pos->first->bo->base.resv != res->bo->base.resv); > > ttm_lru_bulk_move_pos_tail(pos, res); > > } > > } > > > > Conversely, if ttm_bo_individualize_resv() fails (for example, if > > dma_resv_copy_fences() returns -ENOMEM), bo->base.resv remains > > xe_vm_resv(vm), while xe_ttm_bo_lock_in_destructor() only trylocks > > &ttm_bo->base._resv. Calling ttm_bo_set_bulk_move(ttm_bo, NULL) in > > xe_ttm_bo_release_notify() will then fail dma_resv_assert_held(bo->base.resv) > > in ttm_bo_set_bulk_move() and ttm_resource_is_swapped(), and mutate > > vm->lru_bulk_move without holding xe_vm_resv(vm). > > > > Should bulk_move be cleared before ttm_bo_release() runs (or before > > ttm_bo_individualize_resv() detaches bo->base.resv from the VM reservation > > object) while holding the VM reservation lock? > > > > -- > > Sashiko AI review · https://sashiko.dev/#/patchset/20261027183638.1031299-1-matthew.brost@intel.com?part=3