From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=192.198.163.8 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail; t=1796272716; b=VkUMhT2QMRnAKuHKVR0S+uozo4yR0LiHIfJ4kZ4z55/U7UkzVjAWhah/pqcTQ150ZLTo wENiUoWlnQu9JfuyK/A7+WwGfV+Iy+n9w7erEY4t9zzFG0uluXpVmiuj+lx+91d4Jdsxa JBc+/vMxEbXJrxfTg7uZtFGSF4d1jDq8EP459BdDaEczmJ7On1W6ylk/tZk6vX3LV5LQc WLNxYzKWpv9h1bnvD9cioeuQYkAR+HfKKDy2M33b4pIl3AmELhTMV8ZRPZiLZ40mYNaSl kE/qFe54kt3w2eaYV7Ma3pvs5/XbKTytsvfwCbXggAgRxswF9uHg4A8hRCGWkcw817A== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796272716; 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=KBhZKC3cl0voACDQkTu1x6cpBCyVxyw6mDB2adMJYQ8=; b=Wd0z4JYmi0R9Ac4CIDeLtp4WymXULLRJz247FJ4d5ybQ98X9F9FW0x5VcRjsEA/RJMeW 7/XBPfMN05B38nwWiY+jfIeBukVeqYEbF7dNv/dO6l+aoDSgU740ld5m3EH376p6BTHUd Qcg4FMIMzowxy2ZIeSELwjwlcrXPKQlO9TjzIGWRZHyQ8Kf3JANsTIgaQGmUTfiu+sIAi MejsRK/oiY1QoDn1BfBC/Y/DZFClUk0ks1n90NuHgZ3dR7TO4maMNWztuBv63s3WKqx74 F8ZaJKUKkeEypnyF1s7iLU1RftNyUODqUiMPV4+J1cfvQgLXqhHkFmoRk5YP8iAm0HA== 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=cpRx7i2x; arc=fail smtp.remote-ip=192.198.163.8 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 3CDE0606A322 for ; Thu, 3 Dec 2026 04:38:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3CDE0606A322 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=cpRx7i2x DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796272715; x=1827808715; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=KBhZKC3cl0voACDQkTu1x6cpBCyVxyw6mDB2adMJYQ8=; b=cpRx7i2xQdloM7WMyns6X6HyPky5tACXZ0F5aIFTpcFu5cP8nLvRZQrx oR4KqEFzSojT7qXreINR1hjgy+eiHMTr6L41zSbGAHK6xEPzfdkUtJZ9b tRzkwxXz+AyrQxbExovTu2Dt9CmnKfyU9N/F1sT/1We1/++Eq3Ck5ETek VK9QGwsjx0Ya3NvKcYJyGJVQPVY6DJ6yA1wPU57Jxfm3pEYmo97gB7Y4Q +pJbbUdYPS+TR8lzfvFnZd/HEt8PUEWxF0/VCIuAvD36EDoBUnu1I9HKt 4EbGYKYyxYTtnMwfN3L5DuA3lgIV152pdrqtsrWEKNEEMnoLKZ5cWYMtN Q==; X-CSE-ConnectionGUID: rAORcwThTUq4LfHhP7k1JQ== X-CSE-MsgGUID: H/MJLRdZSkmhpiycrtAP3w== X-IronPort-AV: E=McAfee;i="6800,10657,11984"; a="5098421" X-IronPort-AV: E=Sophos;i="6.27,247,1787036400"; d="scan'208";a="5098421" Received: from fmviesa011.fm.intel.com ([10.60.135.151]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2026 20:38:28 -0800 X-CSE-ConnectionGUID: 51ehxnllSX2AynXIAjZyIw== X-CSE-MsgGUID: 4KnqLUI4QqSGFFnv10C0SA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,247,1787036400"; d="scan'208";a="15459868" Received: from orsmsx902.amr.corp.intel.com ([10.22.229.24]) by fmviesa011.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2026 20:38:28 -0800 Received: from ORSMSX901.amr.corp.intel.com (10.22.229.23) by ORSMSX902.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Wed, 2 Dec 2026 20:38:27 -0800 Received: from ORSEDG902.ED.cps.intel.com (10.7.248.12) by ORSMSX901.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57 via Frontend Transport; Wed, 2 Dec 2026 20:38:27 -0800 Received: from DM1PR04CU001.outbound.protection.outlook.com (52.101.61.24) 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.57; Wed, 2 Dec 2026 20:38:27 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=B+qSXtg75ZlXL9hLKPi/cIwxnZfcSzMwD9rlkxvmLm49eSPojRtqRdMOP08Bdezqi8+Q39NxmViROcLCaC7eOZHUsJxDrGRNG4mvF1NDQKOBRSjPPC1+QkUHPVi+T1D/DLS4Hu0hY9j6GFgF+IFC6xsBjHcF3+/PnAQhHUjtrF59n54Zbv1KKPJby7djKP1qKudRVHAooqfXZg3l7Bze/KYNMC+/kWlBPB44H0jSR2s6Gn8Y9zpHWDO5z5+MrBJzvBcUExE3C7uS5enEh6vrWQF4B8ms/y5AeNDI6icmQ2elpFAJHR+caYS7YR439pczUPOK9eMaMh3nuwx32S19lQ== 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=FKWIt2NWhiddhdnkldNUNsb9YK2vk7AGtDBjsehL+rg=; b=Damz5pmLrEi4aBNuqAw5pn4QaMn2a9hXyA1Yxei21mKvMiJ/IAEITTkxM+dx0JmtGmBKUp3rf1Dmu4+kKGWIPUJdUIoUnAAH0qxj/lSbk/bWpkkWaguFRRX6CW0htTXBkZdsSswXr26C/Od+CvWd2/phxtMNlMYYi+ybwBFqBQxnYpbObyvq9xr8pXazX9wvi2ZfHi5bY44ydHml++xe5UXhj20YvdKh+AshEJ7Ri5wCUXIEn66nyhN2NuM+hhtDeXkW5QjtjEsh6e0TH2wjB/3EoPIpUmHHCH2GkKvXv+uknArKi4hX7xLU7AfJzwo2C8mKrmlzIMLHWd121UT10g== 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 IA1PR11MB6266.namprd11.prod.outlook.com (2603:10b6:208:3e6::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.11; Thu, 3 Dec 2026 04:38:21 +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.0688.010; Thu, 3 Dec 2026 04:38:21 +0000 Date: Wed, 2 Dec 2026 20:38:19 -0800 From: Niranjana Vishwanathapura To: Matthew Brost CC: , , Carlos Santa , Ryan Neph , Natalie Vock , Arun Pravin , Matthew Auld , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , , Thomas =?iso-8859-1?Q?Hellstr=F6m?= Subject: Re: [PATCH v5 23/36] drm/xe: Preallocate system BO backing outside the dma-resv lock Message-ID: References: <20261202233323.3743190-1-matthew.brost@intel.com> <20261202233323.3743190-24-matthew.brost@intel.com> Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20261202233323.3743190-24-matthew.brost@intel.com> X-ClientProxiedBy: SJ0PR13CA0094.namprd13.prod.outlook.com (2603:10b6:a03:2c5::9) 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_|IA1PR11MB6266:EE_ X-MS-Office365-Filtering-Correlation-Id: 73315416-5646-45df-2ff9-08df50f742a5 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|376014|7416014|23010399003|1800799024|4143699003|22082099003|18002099003|3023799007|11063799006|10067099003|260925021311599003|56012099006|260925022911599003|260925021911599003|261022105027099003|261028144727099003|261022075727099003|261026140227099003|261026121527099003|261021121427099003|261021123027099003|261102124527099003|261102123227099003|261009221227099003|261009223027099003; X-Microsoft-Antispam-Message-Info: oRraqK68KiCC2ExbvaedlKjwG1mzKJzKlH2FW7bkCxEXip+efxmnJ9rQzctahCfDPbCfXi7dEzgepzczzuLwxYeBoMeL7YVNkot5gapWxX3aSMkLQg3CYblI2IxHj3A/m8XF7xAZOOeVo2LI+q9g0wwYQL5ivHfviA2qG0eDpt3NiSO/31yXux3ciV+xu45mMExO39s2h981F/7dVpR4c0cYJwuvc8blRB7yzXIMFsn4ZhdX6NC3kkWovbWkQphAv5peMHJBknfExVjl2MX7iBTjTldM/f6VgBgx78FcqwlAWfegIGwz/IYnO6d9qfRy8L+8sXMdldN9mzvCCdmnAos+CqITw6X1D0mtvKy04df6snzBfPPiUOtO03T/xEXuBstk4kLnyA3EsdUjdTF06aXtT8h3YW/cmSSPpYV3kBwSuGclKFa5K1cdLeD8TZNlfzkHmKsdOod5nxYhwNwPl2s84BNediTZkrsXuM2fzKNKs4qYdx6OnIfzm5Oi4Zjw7UWCSNH1z0VCROZpt3K1V/MIpeOIDBgn2/oFLWRHnjKziPPMC+7lf0HW/zZxrBrSTFJuhbE6P53C0Cd1K/wcNYC3xi5zPwuvJWglBqMu1ofJsGjBDJB0H/eFsxPOJwyp0C/GTcngYGIgXo7XEiQjVeBxX+Ove7WC27dMbJGIJeU= 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)(376014)(7416014)(23010399003)(1800799024)(4143699003)(22082099003)(18002099003)(3023799007)(11063799006)(10067099003)(260925021311599003)(56012099006)(260925022911599003)(260925021911599003)(261022105027099003)(261028144727099003)(261022075727099003)(261026140227099003)(261026121527099003)(261021121427099003)(261021123027099003)(261102124527099003)(261102123227099003)(261009221227099003)(261009223027099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?UgEx2JkG8374mORAslghehXRAtAABFV00ds4VymtJK5pzJVCXskN1rbwgZ?= =?iso-8859-1?Q?UEPoqwLo6hHC1DRAjSrVHgzeMdXWMEJh+RLsXqamU9HLtnKdikND7P2cJK?= =?iso-8859-1?Q?zLKUZ7lYItP30N3xX7M9Ex2gZtv6Q9Hvj2lO/4GG7kwf8Lgfi2956QFKsW?= =?iso-8859-1?Q?WKs+WKRvB/nVyewgmOpl3oiJF7I1UzXYVgcGANYISgZ5pRhnu+JeNgt96F?= =?iso-8859-1?Q?vl0j26A4oKqi6KoACOo/6yrByko6FCo2h/8HErQDxA/rShUYPhe68eAN34?= =?iso-8859-1?Q?tLitcSLzc+kQ3d6R5sTXiTL9/2lM0Ryuipn5rB6FEUMap9uN3kaeEC2HRs?= =?iso-8859-1?Q?FeHQSvykZY302EM+InjwkzXwCETjtOCuJWSNLmE2wyJdzhz8C1xd2qR5Dh?= =?iso-8859-1?Q?l7V/g8gM+8stMKHQw8bZfvFDRFvC+veNkrlFRrZ/PDXuK2nOWZwXjN7Ubu?= =?iso-8859-1?Q?LzRfCX/vQapF5Z3si8r2HaazOWIrbrJAgreJSJfpSt3IWGf1upL4tex0vm?= =?iso-8859-1?Q?ab+AggJ7+1lVI5mzMnKdpDGJeClOcqHQKEXo7np3UB+rIku/4xOUsYy2vU?= =?iso-8859-1?Q?wuTVFFmkbQhXjbYMDVKIBEZNPSlHwe4i2kO9hIg1X9sFsNzP30nyd/UDVf?= =?iso-8859-1?Q?ezuDdpmjT+z2uKV5lV7AWpWF7X/FpTS/SDgIrxpNgm9L2ddOcpGLGLkVJf?= =?iso-8859-1?Q?5MUHZy4A6vqo5bmpZmV4UooRYxPeKYe66WuifV5WgGGvHgPbQgfbkqSUU9?= =?iso-8859-1?Q?xclN6eIddP0XUnwzIvFmSEQyZEaKSx4rpuw3nINhxcycBIsk540VqNwfZb?= =?iso-8859-1?Q?syL2sz30LApv/VFYqq3SOWnCDwbGjNWCF6vNzM4WnVU4/cqoXbfVfpCr+8?= =?iso-8859-1?Q?ELCgU/J7m6ZKrqAZpQfSuasq1Bs5lSUpFWcg/Wwk6QcG8yIA/FAsuycj7E?= =?iso-8859-1?Q?XRv0Qa282cdjqBIKa7pf4+1s5tg3tKuBmbwjHnzeDQ8EZ08Hx6mYow89vo?= =?iso-8859-1?Q?RL0RZwgklyrw6/mY7Xw3ilmeCZwZd6X4S4wxUAvT57N9ENg0uGz1dDjYNr?= =?iso-8859-1?Q?+KeQ09HxIdb4Mq6L9BMnmoSICuUfg9GyPaKx5jM/PaaHlt55KYYs3H3yOW?= =?iso-8859-1?Q?cZFqyYz2NQDHqM70ct+c0KkP9fpki+eVo+uckr8R+MozBnPQ5+h14FvJH4?= =?iso-8859-1?Q?kO4ffmR1eVftsaWfiP3iAYimUnJD1LIoFRH4iUt7K3d6d4B05r4gLWHwmU?= =?iso-8859-1?Q?+SFm9e2nleudJ6faeBw3NCDMxbGAfkqcpWXPRddMAhbk3/1VnK6AXyFh/w?= =?iso-8859-1?Q?twqEeuJ5PEbKieCKMGIgs2a1PgVY1crgTtTRyijMyAQ6d+c4s+V724DEIt?= =?iso-8859-1?Q?6gAKac/BKFaEJKsMhxCtw1FilioesW9HODEnnSmxOoWKN5wfj3T5+DSwyc?= =?iso-8859-1?Q?KolhDlJpJoPaSSHpG9c+PgDeVGDL6YygjK64+geZ70cZq2WmlQHhQb7xu+?= =?iso-8859-1?Q?CMu1Zj3ca4mopwKhEOwy2ksE4atG4CMcdQpzMf/LBkI3D8ORaze3hbr7Cj?= =?iso-8859-1?Q?t4Ss1TOacvHJLv13mebnvF4HAWzCREBwS/ziaFe2KZHSycpecnEfixTEw3?= =?iso-8859-1?Q?9wda46birW5QQHsryk/Km4jntAQmZQkJ2tq2rthgldF7zU4EDycGpA7OwF?= =?iso-8859-1?Q?XVKJ1v2rXmQdnn/KGP+M6j5KmDeqJl+pd2MWezqD154amZXQlgL2OtYGUQ?= =?iso-8859-1?Q?90H/jbh9M1c71DEMEZ715rcwRXsn7DC2TpFvAPLBFYGuVm+A4YAdAGIJM2?= =?iso-8859-1?Q?td9CTWro4OpCIxf5tzaU3biYvU5qmjpkRGNtKmVkDr1Qchxf0FOp?= X-Exchange-RoutingPolicyChecked: hxXds1wB836M+KQ+Oyma2cAjnNV+EjksAfIHHj4Or11ElCJPo2TLry+k864Q34ZmMd0QpmZ+bCjArMvhZf3iBwIHqfh77BW3ArS6Rh8ANV3ZhPseCrWHjinCdqfI7YECH02/GPpiVruqTunNRl+e8jBE3ZYpmZO9fZCs1CJm+ZSB2dVQ5FjX7X/MHYxx+mmfbJPA+0xJG53bOHj1SvgUSAmnsgGFTlTZiLhPMqH17q5IzYjI9lUVZrWk1D/Y7KbNnk6Fd2XW3sYkTeL6GSssgdVdYW0yCLTi14SAPxuzRZ5vzOZkc1uwhA4goKvGAl452yMQxS7UWzdktc+u9tE40w== X-MS-Exchange-CrossTenant-Network-Message-Id: 73315416-5646-45df-2ff9-08df50f742a5 X-MS-Exchange-CrossTenant-AuthSource: MW3PR11MB4684.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2026 04:38:21.6866 (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: vl5FFNnA7i6xUxW3T3PT+VJepD31A6QoEeOelBboQNAb3R6IQ/ngOl05DyEapvdXgEbzCPjUDA2CFN39CqKP9CrjmcOug+8T6hySV9UaJeN09vMDCSVxqGkfKT86QF+q X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR11MB6266 X-OriginatorOrg: intel.com On Wed, Dec 02, 2026 at 03:33:10PM -0800, Matthew Brost wrote: >xe_gem_create_ioctl() populates a buffer object's backing store inside >xe_validation_guard(), i.e. under the dma-resv lock. For a system-memory >buffer that means the whole page allocation - potentially stalling in >reclaim or compaction - happens in the critical section, holding the >reservation and blocking anything that contends on it. > >Use the TTM full-preallocation mechanism to move that work out of the >lock. For a system-only, non-deferred user BO, allocate the entire tt >backing up front, before entering the validation guard, and hand the bag >down to the populate so it merely installs the pages: > > - Thread an optional struct ttm_pool_prealloc through xe_bo_create_user() > -> __xe_bo_create_locked() -> xe_bo_init_locked(), which stashes it in > ttm_operation_ctx::prealloc. All other callers pass NULL. > > - In xe_gem_create_ioctl(), for XE_BO_FLAG_SYSTEM BOs that are not VRAM, > stolen or deferred-backing, call ttm_pool_prealloc_fill_full() before > the guard and ttm_pool_prealloc_fini() after it. The bag size covers > both the data pages and the appended CCS backup pages, matching the tt > layout in xe_ttm_tt_create(), and the caching mirrors the same path. > >The fill is best-effort: on a short fill (or if it is skipped) the pool >allocates the remainder in-line as before, so this is purely an >optimisation with no behavioural change to the created BO. fini() only >releases the unconsumed tail, so it is safe on every success, error and >OOM-retry path (consumed pages are owned by the tt). > >The fill requests reclaim backoff for higher-order chunks >(@beneficial_reclaim_backoff) when defragmentation is supported: Xe runs >a background defragmenter that upgrades suboptimal pages to beneficial >order in place, so there is no need to stall this user context >reclaiming/compacting for contiguity. When defrag is disabled (VF CCS) >there is no later upgrade, so reclaim backoff is left off and >beneficial-order pages are taken up front. > >To size the preallocation before the xe_bo exists, factor the CCS-pages >decision in xe_bo_needs_ccs_pages() into a parameterised helper, >__xe_bo_needs_ccs_pages(), and query it directly from the ioctl. > >v4: > - Use helper function in xe_gem_create_ioctl (Niranjana) >v5: > - Fix build for certain Kconfig (Sashiko) > - Rework math to avoid overflow (Sashiko) > >Cc: Carlos Santa >Cc: Ryan Neph >Cc: Natalie Vock >Cc: Arun Pravin >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 >Signed-off-by: Matthew Brost LGTM. Reviewed-by: Niranjana Vishwanathapura >--- > drivers/gpu/drm/xe/tests/xe_bo.c | 12 +- > drivers/gpu/drm/xe/tests/xe_dma_buf.c | 4 +- > drivers/gpu/drm/xe/tests/xe_migrate.c | 9 +- > drivers/gpu/drm/xe/xe_bo.c | 151 +++++++++++++++++++++----- > drivers/gpu/drm/xe/xe_bo.h | 6 +- > drivers/gpu/drm/xe/xe_dma_buf.c | 3 +- > 6 files changed, 146 insertions(+), 39 deletions(-) > >diff --git a/drivers/gpu/drm/xe/tests/xe_bo.c b/drivers/gpu/drm/xe/tests/xe_bo.c >index 22a2e8f8143a..68a7d5eb74bb 100644 >--- a/drivers/gpu/drm/xe/tests/xe_bo.c >+++ b/drivers/gpu/drm/xe/tests/xe_bo.c >@@ -89,7 +89,7 @@ static void run_only_leaf(struct kunit *test, > > bo = xe_bo_create_user(xe, NULL, li->alloc_size, > DRM_XE_GEM_CPU_CACHING_WC, >- XE_BO_FLAG_VRAM0, NULL); >+ XE_BO_FLAG_VRAM0, NULL, NULL); > if (IS_ERR(bo)) { > page_size_alloc_restore(xe, &saved); > if (PTR_ERR(bo) == -ENOSPC) { >@@ -183,7 +183,7 @@ static void xe_bo_page_size_alloc_mixed_bos(struct kunit *test) > */ > bo = xe_bo_create_user(xe, NULL, SZ_1G, > DRM_XE_GEM_CPU_CACHING_WC, >- XE_BO_FLAG_VRAM0, NULL); >+ XE_BO_FLAG_VRAM0, NULL, NULL); > if (IS_ERR(bo)) { > int err = PTR_ERR(bo); > >@@ -366,7 +366,7 @@ static void ccs_test_run_tile(struct xe_device *xe, struct xe_tile *tile, > kunit_info(test, "Testing system memory\n"); > > bo = xe_bo_create_user(xe, NULL, SZ_1M, DRM_XE_GEM_CPU_CACHING_WC, >- bo_flags, exec); >+ bo_flags, NULL, exec); > if (IS_ERR(bo)) { > KUNIT_FAIL(test, "Failed to create bo.\n"); > return; >@@ -445,7 +445,7 @@ static int evict_test_run_tile(struct xe_device *xe, struct xe_tile *tile, struc > xe_vm_lock(vm, false); > bo = xe_bo_create_user(xe, vm, 0x10000, > DRM_XE_GEM_CPU_CACHING_WC, >- bo_flags, exec); >+ bo_flags, NULL, exec); > xe_vm_unlock(vm); > if (IS_ERR(bo)) { > KUNIT_FAIL(test, "bo create err=%pe\n", bo); >@@ -454,7 +454,7 @@ static int evict_test_run_tile(struct xe_device *xe, struct xe_tile *tile, struc > > external = xe_bo_create_user(xe, NULL, 0x10000, > DRM_XE_GEM_CPU_CACHING_WC, >- bo_flags, NULL); >+ bo_flags, NULL, NULL); > if (IS_ERR(external)) { > KUNIT_FAIL(test, "external bo create err=%pe\n", external); > goto cleanup_bo; >@@ -719,7 +719,7 @@ static int shrink_test_run_device(struct xe_device *xe) > /* We can create bos using WC caching here. But it is slower. */ > bo = xe_bo_create_user(xe, NULL, XE_BO_SHRINK_SIZE, > DRM_XE_GEM_CPU_CACHING_WB, >- XE_BO_FLAG_SYSTEM, NULL); >+ XE_BO_FLAG_SYSTEM, NULL, NULL); > if (IS_ERR(bo)) { > if (bo != ERR_PTR(-ENOMEM) && bo != ERR_PTR(-ENOSPC) && > bo != ERR_PTR(-EINTR) && bo != ERR_PTR(-ERESTARTSYS)) >diff --git a/drivers/gpu/drm/xe/tests/xe_dma_buf.c b/drivers/gpu/drm/xe/tests/xe_dma_buf.c >index 792376e965f1..dae03a4f6af1 100644 >--- a/drivers/gpu/drm/xe/tests/xe_dma_buf.c >+++ b/drivers/gpu/drm/xe/tests/xe_dma_buf.c >@@ -127,7 +127,7 @@ static void xe_test_dmabuf_import_same_driver(struct xe_device *xe) > > kunit_info(test, "running %s\n", __func__); > bo = xe_bo_create_user(xe, NULL, size, DRM_XE_GEM_CPU_CACHING_WC, >- params->mem_mask, NULL); >+ params->mem_mask, NULL, NULL); > if (IS_ERR(bo)) { > KUNIT_FAIL(test, "xe_bo_create() failed with err=%ld\n", > PTR_ERR(bo)); >@@ -215,7 +215,7 @@ static void xe_test_dmabuf_move_notify_no_resource(struct xe_device *xe) > > kunit_info(test, "running %s\n", __func__); > bo = xe_bo_create_user(xe, NULL, PAGE_SIZE, DRM_XE_GEM_CPU_CACHING_WC, >- params->mem_mask, NULL); >+ params->mem_mask, NULL, NULL); > if (IS_ERR(bo)) { > KUNIT_FAIL(test, "xe_bo_create() failed with err=%ld\n", > PTR_ERR(bo)); >diff --git a/drivers/gpu/drm/xe/tests/xe_migrate.c b/drivers/gpu/drm/xe/tests/xe_migrate.c >index 7feb704b0984..eba991e28af0 100644 >--- a/drivers/gpu/drm/xe/tests/xe_migrate.c >+++ b/drivers/gpu/drm/xe/tests/xe_migrate.c >@@ -649,7 +649,7 @@ static void validate_ccs_test_run_tile(struct xe_device *xe, struct xe_tile *til > DRM_XE_GEM_CPU_CACHING_WC, > XE_BO_FLAG_SYSTEM | > XE_BO_FLAG_NEEDS_CPU_ACCESS | >- XE_BO_FLAG_PINNED, NULL); >+ XE_BO_FLAG_PINNED, NULL, NULL); > > if (IS_ERR(sys_bo)) { > KUNIT_FAIL(test, "xe_bo_create() failed with err=%ld\n", >@@ -675,7 +675,7 @@ static void validate_ccs_test_run_tile(struct xe_device *xe, struct xe_tile *til > ccs_bo = xe_bo_create_user(xe, NULL, SZ_4M, > DRM_XE_GEM_CPU_CACHING_WC, > bo_flags | XE_BO_FLAG_NEEDS_CPU_ACCESS | >- XE_BO_FLAG_PINNED, NULL); >+ XE_BO_FLAG_PINNED, NULL, NULL); > > if (IS_ERR(ccs_bo)) { > KUNIT_FAIL(test, "xe_bo_create() failed with err=%ld\n", >@@ -700,7 +700,7 @@ static void validate_ccs_test_run_tile(struct xe_device *xe, struct xe_tile *til > vram_bo = xe_bo_create_user(xe, NULL, SZ_4M, > DRM_XE_GEM_CPU_CACHING_WC, > bo_flags | XE_BO_FLAG_NEEDS_CPU_ACCESS | >- XE_BO_FLAG_PINNED, NULL); >+ XE_BO_FLAG_PINNED, NULL, NULL); > if (IS_ERR(vram_bo)) { > KUNIT_FAIL(test, "xe_bo_create() failed with err=%ld\n", > PTR_ERR(vram_bo)); >@@ -979,7 +979,8 @@ static void access_memory_test_run_tile(struct xe_device *xe, > > bo = xe_bo_create_user(xe, NULL, ACCESS_MEM_BO_SIZE, > DRM_XE_GEM_CPU_CACHING_WC, >- bo_flags | XE_BO_FLAG_NEEDS_CPU_ACCESS, NULL); >+ bo_flags | XE_BO_FLAG_NEEDS_CPU_ACCESS, NULL, >+ NULL); > if (IS_ERR(bo)) { > KUNIT_FAIL(test, "Failed to create bo: %pe\n", bo); > goto free_buf; >diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c >index bf8078635932..7b9017e9c758 100644 >--- a/drivers/gpu/drm/xe/xe_bo.c >+++ b/drivers/gpu/drm/xe/xe_bo.c >@@ -2321,7 +2321,7 @@ int xe_bo_notifier_prepare_pinned(struct xe_bo *bo) > backup = xe_bo_init_locked(xe, NULL, NULL, bo->ttm.base.resv, NULL, xe_bo_size(bo), > DRM_XE_GEM_CPU_CACHING_WB, ttm_bo_type_kernel, > XE_BO_FLAG_SYSTEM | XE_BO_FLAG_NEEDS_CPU_ACCESS | >- XE_BO_FLAG_PINNED, NULL, &exec); >+ XE_BO_FLAG_PINNED, NULL, NULL, &exec); > if (IS_ERR(backup)) { > drm_exec_retry_on_contention(&exec); > ret = PTR_ERR(backup); >@@ -2463,7 +2463,7 @@ int xe_bo_evict_pinned(struct xe_bo *bo) > xe_bo_size(bo), > DRM_XE_GEM_CPU_CACHING_WB, ttm_bo_type_kernel, > XE_BO_FLAG_SYSTEM | XE_BO_FLAG_NEEDS_CPU_ACCESS | >- XE_BO_FLAG_PINNED, NULL, &exec); >+ XE_BO_FLAG_PINNED, NULL, NULL, &exec); > if (IS_ERR(backup)) { > drm_exec_retry_on_contention(&exec); > ret = PTR_ERR(backup); >@@ -3266,6 +3266,8 @@ void xe_bo_free(struct xe_bo *bo) > * @flags: XE_BO_FLAG_ flags. > * @dma_buf: The dma-buf to reference for the BO lifetime (imported BOs), > * or NULL. >+ * @prealloc: Optional pages preallocated outside the dma-resv lock to back the >+ * bo (see ttm_operation_ctx::prealloc), or NULL. > * @exec: The drm_exec transaction to use for exhaustive eviction. > * > * Initialize or create an xe buffer object. On failure, any allocated buffer >@@ -3278,12 +3280,14 @@ struct xe_bo *xe_bo_init_locked(struct xe_device *xe, struct xe_bo *bo, > struct ttm_lru_bulk_move *bulk, size_t size, > u16 cpu_caching, enum ttm_bo_type type, > u32 flags, struct dma_buf *dma_buf, >+ struct ttm_pool_prealloc *prealloc, > struct drm_exec *exec) > { > struct ttm_operation_ctx ctx = { > .interruptible = true, > .no_wait_gpu = false, > .gfp_retry_mayfail = true, >+ .prealloc = prealloc, > }; > struct ttm_placement *placement; > uint32_t alignment; >@@ -3479,7 +3483,8 @@ __xe_bo_create_locked(struct xe_device *xe, > struct xe_tile *tile, struct xe_vm *vm, > size_t size, u64 start, u64 end, > u16 cpu_caching, enum ttm_bo_type type, u32 flags, >- u64 alignment, struct drm_exec *exec) >+ u64 alignment, struct ttm_pool_prealloc *prealloc, >+ struct drm_exec *exec) > { > struct xe_bo *bo = NULL; > int err; >@@ -3504,7 +3509,7 @@ __xe_bo_create_locked(struct xe_device *xe, > vm && !xe_vm_in_fault_mode(vm) && > flags & XE_BO_FLAG_USER ? > &vm->lru_bulk_move : NULL, size, >- cpu_caching, type, flags, NULL, exec); >+ cpu_caching, type, flags, NULL, prealloc, exec); > if (IS_ERR(bo)) > return bo; > >@@ -3579,7 +3584,7 @@ struct xe_bo *xe_bo_create_locked(struct xe_device *xe, struct xe_tile *tile, > struct drm_exec *exec) > { > return __xe_bo_create_locked(xe, tile, vm, size, 0, ~0ULL, 0, type, >- flags, 0, exec); >+ flags, 0, NULL, exec); > } > > static struct xe_bo *xe_bo_create_novm(struct xe_device *xe, struct xe_tile *tile, >@@ -3595,7 +3600,7 @@ static struct xe_bo *xe_bo_create_novm(struct xe_device *xe, struct xe_tile *til > xe_validation_guard(&ctx, &xe->val, &exec, (struct xe_val_flags) {.interruptible = intr}, > ret) { > bo = __xe_bo_create_locked(xe, tile, NULL, size, 0, ~0ULL, >- cpu_caching, type, flags, alignment, &exec); >+ cpu_caching, type, flags, alignment, NULL, &exec); > drm_exec_retry_on_contention(&exec); > if (IS_ERR(bo)) { > ret = PTR_ERR(bo); >@@ -3754,6 +3759,9 @@ static void xe_bo_debug_mixed_mode_cur_index_advance(struct xe_device *xe, > * @size: The storage size to use for the bo. > * @cpu_caching: The caching mode to be used for system backing store. > * @flags: XE_BO_FLAG_ flags. >+ * @prealloc: Optional pages preallocated outside the dma-resv lock to back the >+ * bo (see ttm_operation_ctx::prealloc), or NULL. Only consumed on the locked >+ * (@vm or @exec) path. > * @exec: The drm_exec transaction to use for exhaustive eviction, or NULL > * if such a transaction should be initiated by the call. > * >@@ -3764,7 +3772,8 @@ static void xe_bo_debug_mixed_mode_cur_index_advance(struct xe_device *xe, > struct xe_bo *xe_bo_create_user(struct xe_device *xe, > struct xe_vm *vm, size_t size, > u16 cpu_caching, >- u32 flags, struct drm_exec *exec) >+ u32 flags, struct ttm_pool_prealloc *prealloc, >+ struct drm_exec *exec) > { > struct xe_bo *bo; > int err = 0; >@@ -3781,7 +3790,7 @@ struct xe_bo *xe_bo_create_user(struct xe_device *xe, > xe_assert(xe, exec); > bo = __xe_bo_create_locked(xe, NULL, vm, size, 0, ~0ULL, > cpu_caching, ttm_bo_type_device, >- flags, 0, exec); >+ flags, 0, prealloc, exec); > if (!IS_ERR(bo)) > xe_bo_unlock_vm_held(bo); > } else { >@@ -3820,7 +3829,7 @@ struct xe_bo *xe_bo_create_pin_range_novm(struct xe_device *xe, struct xe_tile * > > xe_validation_guard(&ctx, &xe->val, &exec, (struct xe_val_flags) {}, err) { > bo = __xe_bo_create_locked(xe, tile, NULL, size, start, end, >- 0, type, flags, 0, &exec); >+ 0, type, flags, 0, NULL, &exec); > if (IS_ERR(bo)) { > drm_exec_retry_on_contention(&exec); > err = PTR_ERR(bo); >@@ -3859,7 +3868,7 @@ static struct xe_bo *xe_bo_create_pin_map_at_aligned(struct xe_device *xe, > > bo = __xe_bo_create_locked(xe, tile, vm, size, start, end, 0, type, > flags | XE_BO_FLAG_NEEDS_CPU_ACCESS | XE_BO_FLAG_PINNED, >- alignment, exec); >+ alignment, NULL, exec); > if (IS_ERR(bo)) > return bo; > >@@ -4456,6 +4465,80 @@ static int gem_create_user_extensions(struct xe_device *xe, struct xe_bo *bo, > return 0; > } > >+static bool __xe_bo_needs_ccs_pages(struct xe_device *xe, >+ enum ttm_bo_type type, u32 flags, >+ u16 cpu_caching); >+ >+/* >+ * For system-only BOs, preallocate the whole backing outside the dma-resv lock >+ * so the populate under the validation guard does not stall in >+ * reclaim/compaction. The caching mirrors the system-BO path in >+ * xe_ttm_tt_create(); the pool falls back to in-line allocation for any >+ * shortfall, so a failed fill is harmless. >+ * >+ * Return: true if @prealloc was filled (possibly partially) and must be >+ * released with ttm_pool_prealloc_fini(), false if preallocation was skipped. >+ */ >+static bool xe_gem_create_prealloc(struct xe_device *xe, >+ const struct drm_xe_gem_create *args, >+ u32 bo_flags, >+ struct ttm_pool_prealloc *prealloc) >+{ >+ struct ttm_resource_manager *tt_man = >+ ttm_manager_type(&xe->ttm, XE_PL_TT); >+ enum ttm_caching caching = ttm_cached; >+ u64 num_pages = args->size >> PAGE_SHIFT; >+ u64 used, shift_size, avail; >+ >+ if (!(bo_flags & XE_BO_FLAG_SYSTEM) || >+ (bo_flags & (XE_BO_FLAG_DEFER_BACKING | XE_BO_FLAG_VRAM_MASK | >+ XE_BO_FLAG_STOLEN))) >+ return false; >+ >+ if (!tt_man) >+ return false; >+ >+ if (!IS_DGFX(xe) && args->cpu_caching == DRM_XE_GEM_CPU_CACHING_WC) >+ caching = ttm_write_combined; >+ >+ /* >+ * Cover the CCS backup pages appended to the tt (see >+ * xe_ttm_tt_create()) so the whole tt is preallocated. >+ */ >+ if (__xe_bo_needs_ccs_pages(xe, ttm_bo_type_device, bo_flags, >+ args->cpu_caching)) >+ num_pages += DIV_ROUND_UP(xe_device_ccs_bytes(xe, args->size), >+ PAGE_SIZE); >+ >+ /* >+ * Only prealloc when the backing fits the currently-available TT space >+ * (manager size minus current usage). This skips the up-front >+ * reclaim/compaction both for over-large, user-controlled sizes and >+ * when TT is already near full; the populate under the validation >+ * guard handles those cases. Compare in pages: a user-controlled size >+ * plus the CCS pages can overflow a byte count, and the fill takes an >+ * unsigned int page count. >+ */ >+ used = ttm_resource_manager_usage(tt_man); >+ shift_size = tt_man->size << PAGE_SHIFT; >+ avail = shift_size > used ? shift_size - used : 0; >+ if (num_pages > (avail >> PAGE_SHIFT) || num_pages > UINT_MAX) >+ return false; >+ >+ /* >+ * Back off aggressive reclaim/compaction for higher-order chunks here: >+ * Xe runs a background defragmenter that upgrades suboptimal pages to >+ * beneficial order in place later, so there is no need to stall this >+ * user context reclaiming for contiguity. When defrag is disabled there >+ * is no such later upgrade, so do not back off reclaim here: take >+ * beneficial-order pages up front. >+ */ >+ ttm_pool_prealloc_fill_full(&xe->ttm.pool, caching, prealloc, >+ num_pages, xe_bo_defrag_supported(xe)); >+ >+ return true; >+} >+ > int xe_gem_create_ioctl(struct drm_device *dev, void *data, > struct drm_file *file) > { >@@ -4466,6 +4549,8 @@ int xe_gem_create_ioctl(struct drm_device *dev, void *data, > struct drm_exec exec; > struct xe_vm *vm = NULL; > struct xe_bo *bo; >+ struct ttm_pool_prealloc prealloc = {}; >+ bool have_prealloc; > unsigned int bo_flags; > u32 handle; > int err; >@@ -4548,6 +4633,8 @@ int xe_gem_create_ioctl(struct drm_device *dev, void *data, > return -ENOENT; > } > >+ have_prealloc = xe_gem_create_prealloc(xe, args, bo_flags, &prealloc); >+ > err = 0; > xe_validation_guard(&ctx, &xe->val, &exec, (struct xe_val_flags) {.interruptible = true}, > err) { >@@ -4558,7 +4645,8 @@ int xe_gem_create_ioctl(struct drm_device *dev, void *data, > break; > } > bo = xe_bo_create_user(xe, vm, args->size, args->cpu_caching, >- bo_flags, &exec); >+ bo_flags, have_prealloc ? &prealloc : NULL, >+ &exec); > drm_exec_retry_on_contention(&exec); > if (IS_ERR(bo)) { > err = PTR_ERR(bo); >@@ -4566,6 +4654,8 @@ int xe_gem_create_ioctl(struct drm_device *dev, void *data, > break; > } > } >+ if (have_prealloc) >+ ttm_pool_prealloc_fini(&xe->ttm.pool, &prealloc); > if (err) > goto out_vm; > >@@ -4883,21 +4973,19 @@ int xe_bo_evict(struct xe_bo *bo, struct drm_exec *exec) > return 0; > } > >-/** >- * xe_bo_needs_ccs_pages - Whether a bo needs to back up CCS pages when >- * placed in system memory. >- * @bo: The xe_bo >- * >- * Return: true if extra pages need to be allocated, false otherwise. >+/* >+ * Whether a bo with the given attributes needs to back up CCS pages when placed >+ * in system memory. Split out so callers can query before the xe_bo exists (see >+ * xe_gem_create_ioctl() preallocation). > */ >-bool xe_bo_needs_ccs_pages(struct xe_bo *bo) >+static bool __xe_bo_needs_ccs_pages(struct xe_device *xe, >+ enum ttm_bo_type type, u32 flags, >+ u16 cpu_caching) > { >- struct xe_device *xe = xe_bo_device(bo); >- > if (GRAPHICS_VER(xe) >= 20 && IS_DGFX(xe)) > return false; > >- if (!xe_device_has_flat_ccs(xe) || bo->ttm.type != ttm_bo_type_device) >+ if (!xe_device_has_flat_ccs(xe) || type != ttm_bo_type_device) > return false; > > /* On discrete GPUs, if the GPU can access this buffer from >@@ -4905,24 +4993,37 @@ bool xe_bo_needs_ccs_pages(struct xe_bo *bo) > * can't be used since there's no CCS storage associated with > * non-VRAM addresses. > */ >- if (IS_DGFX(xe) && (bo->flags & XE_BO_FLAG_SYSTEM)) >+ if (IS_DGFX(xe) && (flags & XE_BO_FLAG_SYSTEM)) > return false; > > /* Check if userspace explicitly requested no compression */ >- if (bo->flags & XE_BO_FLAG_NO_COMPRESSION) >+ if (flags & XE_BO_FLAG_NO_COMPRESSION) > return false; > > /* > * For WB (Write-Back) CPU caching mode, check if the device > * supports WB compression with coherency. > */ >- if (bo->cpu_caching == DRM_XE_GEM_CPU_CACHING_WB && >+ if (cpu_caching == DRM_XE_GEM_CPU_CACHING_WB && > xe->pat.idx[XE_CACHE_WB_COMPRESSION] == XE_PAT_INVALID_IDX) > return false; > > return true; > } > >+/** >+ * xe_bo_needs_ccs_pages - Whether a bo needs to back up CCS pages when >+ * placed in system memory. >+ * @bo: The xe_bo >+ * >+ * Return: true if extra pages need to be allocated, false otherwise. >+ */ >+bool xe_bo_needs_ccs_pages(struct xe_bo *bo) >+{ >+ return __xe_bo_needs_ccs_pages(xe_bo_device(bo), bo->ttm.type, >+ bo->flags, bo->cpu_caching); >+} >+ > /** > * __xe_bo_release_dummy() - Dummy kref release function > * @kref: The embedded struct kref. >@@ -5029,7 +5130,7 @@ int xe_bo_dumb_create(struct drm_file *file_priv, > DRM_XE_GEM_CPU_CACHING_WC, > XE_BO_FLAG_VRAM_IF_DGFX(xe_device_get_root_tile(xe)) | > XE_BO_FLAG_FORCE_WC | >- XE_BO_FLAG_NEEDS_CPU_ACCESS, NULL); >+ XE_BO_FLAG_NEEDS_CPU_ACCESS, NULL, NULL); > if (IS_ERR(bo)) > return PTR_ERR(bo); > >diff --git a/drivers/gpu/drm/xe/xe_bo.h b/drivers/gpu/drm/xe/xe_bo.h >index ff99bed7089b..48298a372e70 100644 >--- a/drivers/gpu/drm/xe/xe_bo.h >+++ b/drivers/gpu/drm/xe/xe_bo.h >@@ -115,6 +115,7 @@ enum xe_madv_purgeable_state { > struct drm_printer; > struct sg_table; > struct ttm_tt; >+struct ttm_pool_prealloc; > > struct xe_bo *xe_bo_alloc(void); > void xe_bo_free(struct xe_bo *bo); >@@ -124,13 +125,16 @@ struct xe_bo *xe_bo_init_locked(struct xe_device *xe, struct xe_bo *bo, > struct ttm_lru_bulk_move *bulk, size_t size, > u16 cpu_caching, enum ttm_bo_type type, > u32 flags, struct dma_buf *dma_buf, >+ struct ttm_pool_prealloc *prealloc, > struct drm_exec *exec); > struct xe_bo *xe_bo_create_locked(struct xe_device *xe, struct xe_tile *tile, > struct xe_vm *vm, size_t size, > enum ttm_bo_type type, u32 flags, > struct drm_exec *exec); > struct xe_bo *xe_bo_create_user(struct xe_device *xe, struct xe_vm *vm, size_t size, >- u16 cpu_caching, u32 flags, struct drm_exec *exec); >+ u16 cpu_caching, u32 flags, >+ struct ttm_pool_prealloc *prealloc, >+ struct drm_exec *exec); > struct xe_bo *xe_bo_create_pin_map(struct xe_device *xe, struct xe_tile *tile, > struct xe_vm *vm, size_t size, > enum ttm_bo_type type, u32 flags, >diff --git a/drivers/gpu/drm/xe/xe_dma_buf.c b/drivers/gpu/drm/xe/xe_dma_buf.c >index 90c9b90de552..f860221c7e53 100644 >--- a/drivers/gpu/drm/xe/xe_dma_buf.c >+++ b/drivers/gpu/drm/xe/xe_dma_buf.c >@@ -345,7 +345,8 @@ xe_dma_buf_create_obj(struct drm_device *dev, struct dma_buf *dma_buf) > > bo = xe_bo_init_locked(xe, NULL, NULL, resv, NULL, dma_buf->size, > 0, /* Will require 1way or 2way for vm_bind */ >- ttm_bo_type_sg, XE_BO_FLAG_SYSTEM, dma_buf, &exec); >+ ttm_bo_type_sg, XE_BO_FLAG_SYSTEM, dma_buf, >+ NULL, &exec); > drm_exec_retry_on_contention(&exec); > if (IS_ERR(bo)) { > ret = PTR_ERR(bo); >-- >2.34.1 >