From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=192.198.163.12 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail; t=1793932211; b=Gd0Qt5+KLkQESp+g6rgF3ED7ucggZJSwI/cw/7NNVO2LcvQQQXTfcywghOushQ0pvqYm EpKGC537wB6YvuigeFzHZdphjxYddUxS+v1XWenXzzpgGx6dd+MNwbHd2bwL1S77Pfz/D LThLj8BTApK+BSEvoxFW5IrOvcOkhCqkUy4aT8YrPNqN74mevk8lErtILQjOdjykS/zDJ H0tbFIectQGGENfWJQpJ3l3S0tkeknhQkQpxve4qC+l8QqMl2qAaDFHOGhN8rIFDJTmFZ 0ZrMGf/sPMoJOfjM4h0nChkbY6G/iZANNBeVzzjghvod9qEvyVU3rOIFRXAvfl71nGw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793932211; 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=KdtR85JzjNqyKejxAMjXKSZ9WEjSDk5bm7R1NYn6XM4=; b=yhzhg/msNY2dRtGAjIeoOpQu9Jz2UotTJn4fC2LsxLZXAkzRHfQTIVzPq/8NtoGufQqM RAtCh3rj0dTMBRsKBSagm3AKyrlg6312EGpTYwTk01dK4TCKBuZ1+q5YfEGiW9fIqUrCu sNYmsZPxE8SSjJjp/IdpasCG4B0qYe8eO9IPIKdd3SEEnjTwBLk7ert5D5Mcrb99VWKSC nxQSW5Zw44faC8WMoAhfiaXTeVSzSSIjgh9uxa8dS6hC/ftx7SJyhiHx3ye6oRwNSltJo hLeppSLcdxK3KDd4UDoWDMvgTwPS3u7cuC1cK4UX4deRXd0fCS6lpfIeW1cibyrjD2w== 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="oCdz/kgQ"; arc=fail smtp.remote-ip=192.198.163.12 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (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 0AA51606A326 for ; Fri, 6 Nov 2026 02:30:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0AA51606A326 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=oCdz/kgQ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1793932210; x=1825468210; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=kaeMUF51ToU415C+Pvc+NFsyeJTr1pdTsR9Zt71H5yc=; b=oCdz/kgQjqaY7NpLpHaXtUa/jm5D7Z5q8wRRJpYzKHJbDNbyZe60J/KN hsU/XFCiu2dE0h0f+Nu5UxEmQ5gBFpn16VzYWuSPKRlIPDju6MFyaeyPp sq0pGafub2ZxwOiuHXhD871VEfYKufBBygjrZ1oRHiWXs9BlkGIPXrfES glhobvSIo9pWlrJSL+Mqjr9soqBX0AZ8U2cUx9tz1ZqZOMftCR8gYq+HR 7VQc0EFIfVVZ9a96BaRypmQJ0C0LgxdBuua/JalpGQBFd7KHFxoCQ6rai D1Y8ThReH20xJBEJmQhxKBOrD1c5yOoczJXlC1SX3Ulj8Eo5nNBBbOCnf Q==; X-CSE-ConnectionGUID: 1T/vKRlXQOWRyElpmWCQrA== X-CSE-MsgGUID: 1wyhbR43QV+kdd2moaS0Mg== X-IronPort-AV: E=McAfee;i="6800,10657,11957"; a="2645599" X-IronPort-AV: E=Sophos;i="6.27,197,1787036400"; d="scan'208";a="2645599" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Nov 2026 18:30:09 -0800 X-CSE-ConnectionGUID: qyTjkWQnQES/5XQ+fKbrWQ== X-CSE-MsgGUID: jEWwxn08Sd6gOSnT6Y1fsw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,197,1787036400"; d="scan'208";a="7072715" Received: from fmsmsx902.amr.corp.intel.com ([10.18.126.91]) by orviesa005.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Nov 2026 18:30:09 -0800 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.56; Thu, 5 Nov 2026 18:30:08 -0800 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.56 via Frontend Transport; Thu, 5 Nov 2026 18:30:08 -0800 Received: from BN8PR05CU002.outbound.protection.outlook.com (52.101.57.36) 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.56; Thu, 5 Nov 2026 18:30:08 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xybYjdYZD09rYwJLUBkcVXW5IwJXB/6kBi0HNEzmc8IRT1grFBODKuenW/eGiz829KayHikhSRsEwiIn+tySALpySExD9JqnNAhbGaIRQfNE8DyDyltpy8deTdFGy/Qs7hsiwFljmhh3asVccwH86ngZZAfafaBizreZo1naHyIvaZ9YYgszx+1wyydSqoYuguYlewYPyq2JVuycaOqYfd4xAZXGZqyH6h+zlfCdDXbsG1kAcX6JwD08KvNQ4JaZxNxS3dTJuM/y5v4dZGDABDzmo4pQ3Ocn2MUV3Tn8q+bX72HVk1tRaO+tkMmBYVObbLJ5HHTvAziKs+ZZGcOmLw== 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=2pq2hNE3VJt3Ik6bm9rg/6HMOwNrcCZh5dUk60gwJXY=; b=ovZOKOJJVgGzVEu0DhKRC0Ve9PE+6Ca7N0tsxhAtLqJ8Fd1iOdvloOAgJy4e1xJvqnoWbZ6who7NPXZu1tSAKNIBO/+f8U3OhwzmE+G/iQlf9A6i4/z1IWbqsLIR5qqpIclCEugX6LTV5bzCa8pNtE7Ce2kGeMTVN9AmD4dJyVVD9CrGdWtp0Dg5Xmv+56gHHZkGZz0I3ReKqaT5qtTIqP3v/Kk3b1IuI3j2aUzjTFQjX+IaLUsKYegM9XeVElNBW5rKXep086IN4uAd+0oj4veHk00ws0kcNQhJJUoh5/3jmJ6TH+N6LYxERjEUv5rKRFj4edjUf1WkK++gws7ztQ== 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 MW3PR11MB4684.namprd11.prod.outlook.com (2603:10b6:303:5d::14) by LV1PR11MB8844.namprd11.prod.outlook.com (2603:10b6:408:2b4::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.592.10; Fri, 6 Nov 2026 02:30:05 +0000 Received: from MW3PR11MB4684.namprd11.prod.outlook.com ([fe80::2f5a:96ce:f7e4:c315]) by MW3PR11MB4684.namprd11.prod.outlook.com ([fe80::2f5a:96ce:f7e4:c315%7]) with mapi id 15.21.0569.011; Fri, 6 Nov 2026 02:30:04 +0000 Date: Thu, 5 Nov 2026 18:30:01 -0800 From: Niranjana Vishwanathapura To: Matthew Brost 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 02/33] drm/ttm/pool: Add ttm_pool_page_order_nodma() helper Message-ID: References: <20260711025619.2540575-1-matthew.brost@intel.com> <20260711025619.2540575-3-matthew.brost@intel.com> Content-Type: text/plain; charset="iso-8859-1"; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260711025619.2540575-3-matthew.brost@intel.com> X-ClientProxiedBy: SJ0PR03CA0192.namprd03.prod.outlook.com (2603:10b6:a03:2ef::17) To MW3PR11MB4684.namprd11.prod.outlook.com (2603:10b6:303:5d::14) 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: MW3PR11MB4684:EE_|LV1PR11MB8844:EE_ X-MS-Office365-Filtering-Correlation-Id: cee41f52-e71f-4b40-d94c-08df3baddd2c 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|366016|7416014|376014|23010399003|1800799024|18002099003|22082099003|6133799003|10067099003|4143699003|11063799006|261026140227099003|261026121527099003|261028144727099003|261102123227099003|261009221727099003|261009223327099003|261022105027099003|56012099006|261009223027099003|261102130727099003|261009220027099003|261009221227099003|261022075727099003|261021123027099003|261021121427099003; X-Microsoft-Antispam-Message-Info: ocmz50cCY8wfP6qG7fGTvHUIniyMIXQkRNRekICTZY5yUwSarKqApZMf2t6yaSsBxRxnQ+PPAk4Vq9/1bQIop/289bYPs6dA0CGKIo7n8J18Su8/f4/P9MMSGfklAw6fyiHftRDyIXtc2+r6/SoKWTznwmjFI3chB9JKc0rTcpVZ3qOpGUd2JJ+gExCEBZswisGbLuyJSNWVco2E4puhRVEJaOZEtbyIZ49Rbae8Vrs1dqdZn1DEuOxzp5miNVFeoLat1w7VdBkgn56B4+GJTSLCtp62uzvBDG6mwAV6gY0y4aERuHJRFNL3EzSxABvndRI4YwNpswW5syBbhlQ3bSJg/iVZR7ZSAXgLU8jv0gzBr6i25/KeYYlCHkmVFa0Zk1ZE5XGW5DSx6hN33KKcmVOf6i6cwNckY1CddMEDKL0rYWhWSpYcUEk/U4YE8+kEA8d9R2chvR2K4Nui8xLCdVuzOoZe6OtjgDnrq5djskYQuhB9RIrF9nhRZG1hduekzzHkcchRwPiqMaru9+kUgKWoTQl7aUOcQZs6BvJOnlDIDSkQPRXUf1wr5BcA+gAYAUu9yeyRP0B/y0UdBhfp3QQhDTgk1phQUMmpBQxuX083RdSvNFcnoNhCiv3GpiRCaKrIZj8/2YGRLHwA8JixniCH5fdD506E5OMfRrV5Hdw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW3PR11MB4684.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(7416014)(376014)(23010399003)(1800799024)(18002099003)(22082099003)(6133799003)(10067099003)(4143699003)(11063799006)(261026140227099003)(261026121527099003)(261028144727099003)(261102123227099003)(261009221727099003)(261009223327099003)(261022105027099003)(56012099006)(261009223027099003)(261102130727099003)(261009220027099003)(261009221227099003)(261022075727099003)(261021123027099003)(261021121427099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?CrE+rN/V4xHw5/aLjdxDFytHRJVSY4TcPB2RJXOduZSQgGTkDBiatDZNF+?= =?iso-8859-1?Q?/I9sI4aeWHcgbA9iqjy5uUzsUMO2gVno7HJR6AaLjPDvOGV9Duer33jrf+?= =?iso-8859-1?Q?xToL3fhGaw5lwxKcT1lJQtHSjtdJYWquhmVaaCeODTNSfPjDnpM5rZhOnG?= =?iso-8859-1?Q?VmpVxdRuapJutf7T3KxPV212F8H0xHNwmOvd/w1YN3ySF6Fo6ELYQqoNoI?= =?iso-8859-1?Q?Unx61MEzvZ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pNsyoGwLgVYWimvUjAoJNVzjk0Vy3HDI2oIA5L/W66Are0iBLaWWsYE7jGGS7vefGTDK1AKiFEAarF56QbdXZMoJgKCP6j6CxgVGed+lifLuZ2qqlMCvT5UCirbXVCQo6ApFJPj96gog0ZosIBYZ19+QY5SpmB5WD6nsRQ== X-MS-Exchange-CrossTenant-Network-Message-Id: cee41f52-e71f-4b40-d94c-08df3baddd2c X-MS-Exchange-CrossTenant-AuthSource: MW3PR11MB4684.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2026 02:30:04.8340 (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: YbTMtqOxzle6lmKF2wDfYGvySyquWu4vM5xKuyG8WKAVs1OZPortU10wU//U+3GebFFFmqeNTfM38WNB08P1MaWr8SgvJj2dDEgppqbjRk5freSW7G7HkShlUSxvU56l X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV1PR11MB8844 X-OriginatorOrg: intel.com On Fri, Jul 10, 2026 at 07:55:48PM -0700, Matthew Brost wrote: >TTM records the allocation order of a multi-order page in page->private at >allocation time. For pools that do not use dma_alloc the order is stored >directly, while dma_alloc pools store a struct ttm_pool_dma pointer there >instead. Drivers that do their own DMA mapping (e.g. Xe) need the per-page >order to walk a populated ttm_tt one chunk at a time, but cannot rely on >folio_order(): TTM allocates high-order pages with alloc_pages_node() >without __GFP_COMP, so they are not compound and folio_order() always >returns 0. > >Expose ttm_pool_page_order_nodma(), a thin wrapper that returns the order >recorded in page->private. It is only valid for pages from a pool that does >not use dma_alloc; whether a TTM device uses dma_alloc is fixed at ttm >device init time, so callers know from their device configuration that this >helper applies. Use it from the existing internal ttm_pool_page_order() to >keep a single source of truth. > >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-opus-4.8 >Signed-off-by: Matthew Brost >--- > drivers/gpu/drm/ttm/ttm_pool.c | 25 ++++++++++++++++++++++++- > include/drm/ttm/ttm_pool.h | 2 ++ > 2 files changed, 26 insertions(+), 1 deletion(-) > >diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c >index ab242ad4339e..5b7d7f5ae53d 100644 >--- a/drivers/gpu/drm/ttm/ttm_pool.c >+++ b/drivers/gpu/drm/ttm/ttm_pool.c >@@ -461,6 +461,29 @@ static unsigned int ttm_pool_shrink(int nid, unsigned long num_to_free) > return num_pages; > } > >+/** >+ * ttm_pool_page_order_nodma() - Allocation order of a non-dma_alloc TTM page >+ * @p: The page to query. >+ * >+ * Return the allocation order that the TTM pool allocator recorded in >+ * @p->private at allocation time. This only works for pages that were >+ * allocated from a pool which does *not* use dma_alloc (i.e. pages backed by >+ * alloc_pages_node()), where TTM stores the order directly in page->private. >+ * >+ * For dma_alloc pools, page->private instead holds a struct ttm_pool_dma >+ * pointer and this helper must not be used. Whether a TTM device uses >+ * dma_alloc is fixed at ttm device init time, so callers are expected to know >+ * from their TTM device configuration that their pages are not dma_alloc >+ * backed before using this helper. >+ * >+ * Return: The allocation order of the page. >+ */ >+unsigned int ttm_pool_page_order_nodma(struct page *p) >+{ >+ return p->private; >+} >+EXPORT_SYMBOL(ttm_pool_page_order_nodma); NIT...make page pointer const? LGTM. Reviewed-by: Niranjana Vishwanathapura >+ > /* Return the allocation order based for a page */ > static unsigned int ttm_pool_page_order(struct ttm_pool *pool, struct page *p) > { >@@ -470,7 +493,7 @@ static unsigned int ttm_pool_page_order(struct ttm_pool *pool, struct page *p) > return dma->vaddr & ~PAGE_MASK; > } > >- return p->private; >+ return ttm_pool_page_order_nodma(p); > } > > /* >diff --git a/include/drm/ttm/ttm_pool.h b/include/drm/ttm/ttm_pool.h >index 26ee592e1994..753203980e2c 100644 >--- a/include/drm/ttm/ttm_pool.h >+++ b/include/drm/ttm/ttm_pool.h >@@ -94,6 +94,8 @@ long ttm_pool_backup(struct ttm_pool *pool, struct ttm_tt *ttm, > int ttm_pool_restore_and_alloc(struct ttm_pool *pool, struct ttm_tt *tt, > const struct ttm_operation_ctx *ctx); > >+unsigned int ttm_pool_page_order_nodma(struct page *p); >+ > int ttm_pool_mgr_init(unsigned long num_pages); > void ttm_pool_mgr_fini(void); > >-- >2.34.1 >