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 54178C9830D for ; Fri, 25 Sep 2026 07:21:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CD88310F8C1; Fri, 25 Sep 2026 07:21:30 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="P5Zduff+"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 074868825B for ; Fri, 25 Sep 2026 07:21:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1790320890; x=1821856890; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=sohamIqBHK3KE4b/8DCWHND0C019BW59Ka8EdxU9YZw=; b=P5Zduff+yxrT9Qc6c5bt6c+m1iFAD54ueptDJmzS0vzo0ezO4hlf6KGh XU6BNtHM6pJ9BrOd4ARVNoWWHd2Do8KkGdFiO/NInzN6PlL92DVP5Ejyb UIIwJJpG89f0oez+hhaAA6j8u41XINJ8sDMiEm7jOLfxA0xut4wd9Gl+6 EDjusKcF/zGyigqLzBix9cozYc8oT30PrW8s+Zxx9LTKWUtHOplh3g5wA gyosNJWsej/0uJ0EkabpQ1IvzArCLm+96uiLRLLFardi8UsSmiUlzEFV3 Qf+KHkZME3sYyKLmfYUfyEKoTa0umUSts1qVMONkElznx2aQa8xvJhR9Y Q==; X-CSE-ConnectionGUID: TZiZoaemR0aYt01t8slGpQ== X-CSE-MsgGUID: xQgdVqTBQSa+Mh4Z9rRTNQ== X-IronPort-AV: E=McAfee;i="6800,10657,11915"; a="89871462" X-IronPort-AV: E=Sophos;i="6.27,122,1787036400"; d="scan'208";a="89871462" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2026 00:21:27 -0700 X-CSE-ConnectionGUID: Lc7rb3gLQ9G60//0vowy3g== X-CSE-MsgGUID: wAfUiDx8QieyDfpU9VF++g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,122,1787036400"; d="scan'208";a="312190292" Received: from fmsmsx901.amr.corp.intel.com ([10.18.126.90]) by orviesa001.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2026 00:21:27 -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.46; Fri, 25 Sep 2026 00:21:25 -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.46 via Frontend Transport; Fri, 25 Sep 2026 00:21:25 -0700 Received: from BN1PR04CU002.outbound.protection.outlook.com (52.101.56.5) 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.46; Fri, 25 Sep 2026 00:21:25 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BA8dCFuuqQn/lrVGgqLLAfatjv68Mme8HHs2wJyRUYrztZjR7EupDLrmn+j+lZTm31V+hLgG/xqXTJmbk/bC3O0mxKAjnZYeY50O9ZA8/KNTyPhWPZOWeJxF3rDE3D4VpLAyv2YqOyuBtJNAmauc9wPGV0UZQ+0Q6/L8aKxRaf3x8+vIARH27fR8GhpQ/PoIMCg7+oYsQef6MjEENQ9vXYUoH7guN3cxcPe3yzPbXYYOZEGGK+BSaS8eEMXYKajX4j/An/VMk2mIC/ST4UtpY3Pu6lHCUC7siX4D4yTf2opTXumA57pvYvu4unJeW4z/Up0wmn88sPHwgXYx4/OfNg== 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=xvcNo/30Kw+U2439YSbgHtKzdVCroqA7qnHu2/Ws6rs=; b=L1W+owE3/VmrpDjFxeLsc6uSj6VZwQ/lFm6tnGEGBARHz3msu2YrCRyZdybIIX45tyXPxi+yXYdo4larpZco6JsWRp4/UV+uhQer87bVqv7Iy+pE5XTLY/Wh3775Gb3nxFjhRt5MFo6jrO4SXwqf2NqiiOaKuqUoQOcLbzvyQVk5c6XHN95SUDPd8fToW0OB1OivTMoEA+TK0aCN2l1GLKege603t+7K5DgUdCmLTat1HWw05M4bKwMjbY2hh1UT2oCxuCBPOgcl1/RsHIc0NYZc9l+WxagMATu+wHpyTIE1qhtpMlWPwE0IWvQS0pq3VYAFbiw8TzhkfmQCQnX0SQ== 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 MW4PR11MB6888.namprd11.prod.outlook.com (2603:10b6:303:22d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.451.14; Fri, 25 Sep 2026 07:21:23 +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 07:21:23 +0000 Date: Fri, 25 Sep 2026 00:21:20 -0700 From: Matthew Brost To: CC: Subject: Re: [PATCH v7 17/24] drm/xe: Add device flag to enable PT mirroring across tiles Message-ID: References: <20260925045320.1325860-1-matthew.brost@intel.com> <20260925045320.1325860-18-matthew.brost@intel.com> <20260925062511.4B67A1F000FF@smtp.kernel.org> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260925062511.4B67A1F000FF@smtp.kernel.org> X-ClientProxiedBy: SJ0PR05CA0152.namprd05.prod.outlook.com (2603:10b6:a03:339::7) To CO1PR11MB4787.namprd11.prod.outlook.com (2603:10b6:303:95::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PR11MB4787:EE_|MW4PR11MB6888:EE_ X-MS-Office365-Filtering-Correlation-Id: 70adfa38-11d2-460c-f77d-08df1ad59a53 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|23010399003|1800799024|376014|10067099003|4143699003|56012099006|11063799006|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: 6e9rTRdhR29EclXKoblunyR63OAgOOL8yLj6JlnrmkDQbFOhj0GPJ0U5pTI3WVeLGgqVIOhL0a4VJxGmZFhjLXJoiRDu1P32N5YuLZcejlacpzyFQNqaAZqxAz5hZ350W0CFiE9oPc96VP6fU/8s5ijkpus7l0nINNhH+jgoUNRbIaMWNwdEMOaWwPtS35ek1MlWMFaBH8imsqwwsljg6Ahfx/1w+LNvcKZ4zyG5PIG+UJM7b4EzCrq/02N0x2FkmVbs2sEyYyFTo3PntXGuXMtyNiYujJ6ExaNwVx39OpA8HdKn9wvWC/nr28m9jvCjyXIjv/S6wYHDog8cnuLmvbMN4VQY11ZmN5ELXOuMFgIbNYGY6f52yj4I7A5rz9Whh+zUmlZhrwivNrJ/Nk9Hr9gp6CdmHit1Mv/HlSr1hIANtMqYrTNG0Va946ccmXIGgv0gsMH9CsfS+DnH8vQIeL+qlOrCs6nyiPCjeh7X/tt8AsOZ5Idj1791OZNyCAiF76UX9j3DWnad2tftqP7cz5W+QX9jJNlOSNff5mtLlupdnUKUaTna0WOP8wCk+JVXLT5/u+VaRPfK9jwi9cobYglHoU96YLosSMbX0HRQWfA= 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)(10067099003)(4143699003)(56012099006)(11063799006)(22082099003)(18002099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?KMszENJV3UzXYHsSCLhoN4Q7orobtuxxSBl6qWcvstXVgJRab3S97bGlbB?= =?iso-8859-1?Q?RC9qKNJVWcYbP1TX074OiDS2yKAC7D4B8GQiB/O1ryHBndR9YsrLaxH1/n?= =?iso-8859-1?Q?imh9FvAgSlQN7lrLhXMUvdCHDDeoIY7IYYakr6XIJXsl7NM9ftOxYe+5ay?= =?iso-8859-1?Q?cZ4xNB+rqGLL044zRb/NENyzDQ/q1lPia8f6uJLmyTa4ly7wnFb1vIreIT?= =?iso-8859-1?Q?Dn5pXoVFsPyNNZeLMEzsECETm/UZd1RbBWaA7alTMzN4KHIGTx/BWcyyqQ?= =?iso-8859-1?Q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tHcSwoRvh2XgaCTFs9yMNR43Se4GSKxN56uXwtqo9l+FJbrWt2IzzyrR6+Lh7ooeuRJSikdoh6YxqvQ== X-MS-Exchange-CrossTenant-Network-Message-Id: 70adfa38-11d2-460c-f77d-08df1ad59a53 X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4787.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2026 07:21:23.0202 (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: zW0EpJGj93ZX8tGJBqlKqBHUfnjiHO6h9LdUVL/WUCH8fLAQ5Gjy4zkimShxfOiVTSeGk78UcN8Ry+mSm0z5qw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR11MB6888 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:25:10AM +0000, sashiko-bot@kernel.org wrote: > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: > - [Medium] xe: wasted VRAM and forced cross-tile PT access for migration VMs when PT mirroring is disabled > -- > > commit ec37bcd236de3cdab70b39d0f31888be55640311 > Author: Matthew Brost > > drm/xe: Add device flag to enable PT mirroring across tiles > > This commit introduces a device flag to enable or disable page-table > mirroring across tiles. It defaults to enabled for PVC, aiming to allow > flexibility based on memory bandwidth needs. > > > diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c > > index 0f542f47b9a84..f450e1c6f7500 100644 > > --- a/drivers/gpu/drm/xe/xe_vm.c > > +++ b/drivers/gpu/drm/xe/xe_vm.c > [ ... ] > > @@ -1739,7 +1749,8 @@ struct xe_vm *xe_vm_create(struct xe_device *xe, u32 flags, struct xe_file *xef) > > > > for_each_tile(tile, xe, id) { > > if (flags & XE_VM_FLAG_MIGRATION && > > - tile->id != XE_VM_FLAG_TILE_ID(flags)) > > + tile->id != XE_VM_FLAG_TILE_ID(flags) && > > + (vm->xe->info.has_pt_mirror || id)) > > continue; > > > > vm->pt_root[id] = xe_pt_create(vm, tile, xe->info.vm_max_level, > > [Severity: Medium] > When has_pt_mirror is false, does this logic in xe_vm_create() allocate > page tables that will never be used? > > For normal VMs (where flags & XE_VM_FLAG_MIGRATION is false), the condition > fails and we allocate pt_root[id] for all tiles. However, xe_vm_pt_root() > will unconditionally return pt_root[0] when has_pt_mirror is false, leaving > pt_root[1..N] unused and wasting VRAM. > > Additionally, for a migration VM targeting a secondary tile (e.g., tile 1), > the condition tile->id != 1 && (has_pt_mirror || 0) evaluates to false when > id == 0, causing it to allocate both pt_root[0] and pt_root[1]. > Yes, we over allocate 4k. I'm ok with this. > [ ... ] > > @@ -5074,3 +5085,21 @@ void xe_vm_remove_exec_queue(struct xe_vm *vm, struct xe_exec_queue *q) > > } > > up_write(&vm->exec_queues.lock); > > } > > + > > +/** > > + * xe_vm_pt_root() - Retrieve VM page-table root > > + * @vm: The VM. > > + * @tile_id: Tile ID > > + * > > + * Retrieve VM page-table root for a tile ID, used to abstract if PT mirroring is > > + * enabled across tiles. > > + * > > + * Return: VM page-table root for a tile ID > > + */ > > +struct xe_pt *xe_vm_pt_root(struct xe_vm *vm, u8 tile_id) > > +{ > > + if (vm->xe->info.has_pt_mirror) > > + return vm->pt_root[tile_id]; > > + > > + return vm->pt_root[0]; > > +} > > [Severity: Medium] > Does returning vm->pt_root[0] here in xe_vm_pt_root() when has_pt_mirror > is false force cross-tile VRAM access for migration VMs on secondary tiles? > > As noted above, a migration VM targeting a secondary tile will have its page > tables allocated in pt_root[1]. But since xe_vm_pt_root(vm, 1) will return > pt_root[0], the migration engine on tile 1 will be forced to walk page > tables physically located in tile 0's VRAM. > > Can this cause a performance regression for migration operations on secondary > tiles? > !info.has_pt_mirror means VRAM access across tile is uniform perf or we'd mirror them. Matt > -- > Sashiko AI review · https://sashiko.dev/#/patchset/20260925045320.1325860-1-matthew.brost@intel.com?part=17