From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=192.198.163.17 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796096570; b=mT7UrKXn5TNqQjlNkuNtoCjkW0FVkeay5bdWOT4BweLDGPFXvnyl+pDQEt6LDDAbicH8 NyCScnJS2zBrFuWxXToN/RZ9Z3U+q9I6uon/H9kwZHWspLCqyVnSUmRwjNE077xVtcXlL N2knPjKTTHMJWHyFYtRWL0tBiD+7DAqYLjRF07ZI1U3gMH96a1+UZRHDgPckUSHuiuKqe /xDyhsu9XWbKftEFCKAUvL29091/9H1shQbfZ4UJpyjdb4BeyW8M3OcSlE5spznA6ajAN 2dKeFiDDEvUe88yovvCBWw8g2LgNzDCb06PtRJ1etWOtQedCd5hyN2mrGfCrZgFf2qQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796096570; 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=bnXcW16fNr6kPAN8q9kJjN6ZJxKp2StyhbuJoYHZIps=; b=qLgjW5OCK8irF32WyASwOix95XWrmmniajY3be8ZkqrLLSgSz49CQXv94jnL25qkUuGt GpGnmEqlPMdBAJHs8oFhxRKCylUaaAZtda8hw/grmB62djM17D5cin9esxgv26oEOpSMQ pEsY3Dlaxr1hQMOtVEGPTciwi2UKQmO3jV8IWxxgPF2dFC/juqbPXGg4PhhA+u7dHeyzQ dOUs+ajjx5bhQB7GLt6munIezZnHJ1rF95xxQ3KW5GRpgQARdo4Y8qkcQ9GBQqJ0/V71F 6R7RY4i+xr9HrRkJ3iTethiM2mszTUBc82JZwIceLzcdJzkv6VnFpgnx2exU2ADpOUA== 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=HHdJ5DoE; arc=pass header.oldest-pass=0 smtp.remote-ip=192.198.163.17 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (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 78449606A31A for ; Tue, 1 Dec 2026 03:42:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 78449606A31A 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=HHdJ5DoE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796096569; x=1827632569; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=bnXcW16fNr6kPAN8q9kJjN6ZJxKp2StyhbuJoYHZIps=; b=HHdJ5DoEkasGjYe/DbJVV10I0RN5+4vg64PV8uBEl46zqLbZHMP/Gw3W oplHQr0aAYaVn34eKAEi7zWUIJjdHrSURGIoLVmZPS2KI355xRIhsLfsF eH6kt1zro2mAyLa+yZLxkFzqG0uoTcG2Kc6+qIzA3hRehh0VTfM4fxSre FAeV3Uj2vq2ALaxHvUarsObk+J7mK8yRDMP21AcDwIpfhB5MM6LwIzoLz 9LJJPGdoTDPZR3g6r6PqrZT+Wg9PPpRVlWH6L8TVzaOJ/5+Y9Zd9V4h1Y PN4ETvj0SNyeXBaYt4a94coVTE7m7tIGpkgZ6jF+oHvJFAS88h8YHQEqA g==; X-CSE-ConnectionGUID: Abv3HGCCT+SFTJngLQOK+w== X-CSE-MsgGUID: 7EsKJxxTTAaI1iaqSZiumA== X-IronPort-AV: E=McAfee;i="6800,10657,11982"; a="4956588" X-IronPort-AV: E=Sophos;i="6.27,244,1787036400"; d="scan'208";a="4956588" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2026 19:42:48 -0800 X-CSE-ConnectionGUID: LQGWK9lFSoKGOItNwHEu/A== X-CSE-MsgGUID: Rs/RntwFQm6mActBPqyMPQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,244,1787036400"; d="scan'208";a="13085003" Received: from fmsmsx903.amr.corp.intel.com ([10.18.126.92]) by fmviesa004.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2026 19:42:47 -0800 Received: from FMSMSX901.amr.corp.intel.com (10.18.126.90) by fmsmsx903.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Mon, 30 Nov 2026 19:42:45 -0800 Received: from fmsedg902.ED.cps.intel.com (10.1.192.144) 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.57 via Frontend Transport; Mon, 30 Nov 2026 19:42:45 -0800 Received: from PH7PR06CU001.outbound.protection.outlook.com (52.101.201.43) 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.57; Mon, 30 Nov 2026 19:42:44 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Jh8gIlutDSGRdZE1I0QSamGWWfGatB6kcQgGCSAGFLIyUVJ6azUOLzKR7qOJZ6fjVBrM45bsyecZS0fTQYmgDi7S2oYjhV9QR7OvgUxAiny5PFzV0GpBsFS87LLPBE8qK0PMwyLqJgZKRfJWhJ08rjDBNNFIp4AL3hDDcI3Rop5RxN+vrYY9b32MUHyoqGm5CYoGiVfS1GUjGCYAIqsp2IG6BJchq3N7SK7bvubjmq0zvmgi/dRHn7h4GqFwY4mSxNdGf+C6ddFqj9spjcGPEpUyCv1Mt2kj07IvPrv6CcXDJWnoDa+rzqbWCcSONoC2jiVLRxaOFoGc8nyoeRNHEg== 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=bnXcW16fNr6kPAN8q9kJjN6ZJxKp2StyhbuJoYHZIps=; b=x1gBALEPEwgjHEjpYvQ5ZxHXReN4u88N6W2Tn6y8brOsG4uiJzVeHDoJcKISAPCFBgM3qdViBl3ThmvUQfpzE5sKm36YPo0OYQVNeBY/teovTQYYIOWHtX63tuqEGiIb/z2XoiqkfE0NAQvsattpzGTB1yzIRRAowAu7wY+/Mq75xRYo+C/1q7DPPxmNlc66uPiIjOGj1GxJL83F3xeFNd2xhg51oLyVvw6jIpyfGCkekiQHBY4lp/cPdLYRtKNqzm5hVp4AifSc6J3h/tcWqo91zpXw5cTkx0foKxPUqFWUnkvESdN3YkIYQ/fs/qcRonpk2U+mjBF+AyH8cZ9epw== 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 BL1PR11MB5285.namprd11.prod.outlook.com (2603:10b6:208:309::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.13; Tue, 1 Dec 2026 03:42:30 +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.0662.012; Tue, 1 Dec 2026 03:42:30 +0000 Date: Mon, 30 Nov 2026 19:42:27 -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 05/33] drm/ttm: Support defragmentation moves Message-ID: References: <20260711025619.2540575-1-matthew.brost@intel.com> <20260711025619.2540575-6-matthew.brost@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: BY3PR05CA0029.namprd05.prod.outlook.com (2603:10b6:a03:254::34) 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_|BL1PR11MB5285:EE_ X-MS-Office365-Filtering-Correlation-Id: 59a51a01-7bfa-4261-c590-08df4f5d1ff7 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|376014|7416014|1800799024|366016|23010399003|11063799006|5023799004|4143699003|6133799003|261009221727099003|261009223327099003|261009221227099003|261009223027099003|261009220027099003|22082099003|18002099003|261026140227099003|10067099003|56012099006|261028144727099003|261026121527099003|261026130827099003|261022075727099003|261022115727099003|261026135527099003|261021133027099003|261022105027099003|261022113327099003|261021123027099003|261021135927099003|261102123227099003|261021121427099003|261021130227099003; X-Microsoft-Antispam-Message-Info: wsScphXglrWgJPW+gPsfEExzbq7aCLTGZn/sP045JfmPvCxi77TBRhLz+dsnHkDuyUO0+TKEtBSFJBSP5uEtQ6A+OIuTwFr7qo0tX1ZYS5X5r7y9pfJuv992EK9lAODwUKk+qZX5M/0cnCEXP9S80kGBThKhu/xYjx+8ykT1hCrEGiEtYsidtQ+OoLnqz5xZ4mdxAC+NR/S6oMunTs9El8nqEugkAd8ucB56xPmsc/rDtJ74FvkPzHCkhL7nX+5lqlNYegY4vYbye9zFbVtfzeCS6Dili2mD9F69EPmve1crZOo3h/8OMkGXqGzr9mhmKRBbKaqYX1twPWgphGr548MXwLUu/UEeTr7H1uBhFIjER7vk5HaFLp88Qs8h+FTlFcD63Kv9KgvLGqK0SlXZ7977l3PnvIaFfPBw2KPlwZz3V3/oHY+cq3NSDSru9TzkMfOyyg357LGaQMccnMW+GAOwAoeGHtxLpCdx31tYJmeld3wpl31FI6qEctYvWA5oUgXsDeyslSu9a8gJb6cTM1q6AElyBU+fy0AJLp3rVtaxWQUZcZX0XtN7geK51j6BvrReJ1vfM78Uv2FjR0CVfp3XjmareilVi9WgJyMoRCYJQvGohuE5chEf72Yi77OKWFEhE7Z7pJm3dkBaKRso5ViXPtTreSj53hf6P2giLlY= 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)(376014)(7416014)(1800799024)(366016)(23010399003)(11063799006)(5023799004)(4143699003)(6133799003)(261009221727099003)(261009223327099003)(261009221227099003)(261009223027099003)(261009220027099003)(22082099003)(18002099003)(261026140227099003)(10067099003)(56012099006)(261028144727099003)(261026121527099003)(261026130827099003)(261022075727099003)(261022115727099003)(261026135527099003)(261021133027099003)(261022105027099003)(261022113327099003)(261021123027099003)(261021135927099003)(261102123227099003)(261021121427099003)(261021130227099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ODFQZUp5Y2hYeTZSNXhSdnZXa2hFem8rRzJTRlRoSlRheENpbUFQbHhjcVBo?= =?utf-8?B?TGduZUtIMjQ2cUV6ZjlTakg3OGVCMTVkck9LMUQ4WUluNHduZTh5bXcrc2RR?= =?utf-8?B?TlZIZi9rMUkzaU1BYi85MmhjQWdzVCs2aHpvYm95YUFGNFQ3UUIwWEY5RU5H?= =?utf-8?B?UFNzbytGUHgxYUR4VlVId0U3RXhYbnE3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?c3hDU1lsUWRWKzB5ZmIwVEpIUWxUc0JqdGY5RzRmdjJBaXBHZHQyaVFuM00r?= =?utf-8?B?MjJ1QzVxbGUxSitiMTg5eXVaN1hhRnZwUjZaMU40WmhxanNxRnZsTUhYdUhu?= =?utf-8?B?cXBYeTg4OXpubkxudzFFSmx2NFMwUXoyNld3aDY4OTh2clh2NFZTc1ZOOVdM?= =?utf-8?B?ZkNzWTNnMjJlaFZMR2hramlrRmNjSXFwN3dENUowa2VkdTN4S3MrMG9JQkE5?= =?utf-8?B?NkI0a2d5WmcwZnJOOUs0aEsyNXNRelVuemhJb2MyNHZvR2svMU9OdjhjNnhl?= =?utf-8?B?S3JIdEo2eHlXZWZmYW9sVUNWbGkrT3l1c0VjMUpTSFQ3eXAvSHlXdUdGU0w2?= =?utf-8?Q?pL5okNcdB8GabV+DR6jCjnctm1py9YljczNf8?= X-Exchange-RoutingPolicyChecked: W6Sjrl+8hmAu/NI/8Krzrsz4VRO9f86nWWE6T8kQ7ctvuIXVkUZP/wky5x6pih/m09CB9fpGhbfyqowIFn+E3taP7fT3mcUs8BXUgULpzTz/f4KfB5/eyiGe7vjpA/0UdggFa6idvrCGPj2mb8Sc3wQF+amtcKp2GrircMuoRtnzh2+FLYKXDkJbILEisJkSkwKdopLpMGdne4ObX4h2Ljv9LR/SgMDvp/JpP60zzqliUaEcrSQ+dFgu3gUhBJi54rVaUaDtDSKsisw9nxAaRMo32YPCR97wn89WKUGMOHesPLE60m8vVhO5roLIllINjcsOmnOfgoHDEM8mUD3ZoQ== X-MS-Exchange-CrossTenant-Network-Message-Id: 59a51a01-7bfa-4261-c590-08df4f5d1ff7 X-MS-Exchange-CrossTenant-AuthSource: MW3PR11MB4684.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2026 03:42:29.9542 (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: vgxr1KHBLp/dvVJIqy1Pg2v34hdb3tA6A5ZNFbfrf3hDvU7K7xSkLNqturgfzS66hwtossM6rAJEDHRk+r99D0PU2tV3JKfwxBZ7BO6oolEQsYJft6vjdoqnSQknt+Uu X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5285 X-OriginatorOrg: intel.com On Mon, Nov 23, 2026 at 09:53:03AM -0800, Matthew Brost wrote: >On Fri, Nov 20, 2026 at 10:30:14PM -0800, Niranjana Vishwanathapura wrote: >> On Thu, Nov 19, 2026 at 12:15:11PM -0800, Matthew Brost wrote: >> > On Thu, Nov 05, 2026 at 06:51:51PM -0800, Niranjana Vishwanathapura wrote: >> > > On Fri, Jul 10, 2026 at 07:55:51PM -0700, Matthew Brost wrote: >> > > > Add infrastructure to let a driver re-back an already-resident BO with >> > > > fresh pages (e.g. at a more beneficial order) by reusing the normal move >> > > > machinery. >> > > > >> > > > Add ctx->defrag, which makes ttm_bo_validate() skip the "current >> > > > resource already compatible" short-circuit so a move is forced even when >> > > > placement is unchanged. In ttm_bo_handle_move_mem(), when defragging a >> > > > populated BO, stash the old tt, create and populate a fresh one >> > > > (allocating new backing), and hand the old tt to the driver move >> > > > callback via bo->defrag_old_tt for copying. On success the old tt is >> > > > unpopulated and freed; if populate or the move fails, the freshly >> > > > allocated backing is discharged and the BO is restored to its original >> > > > tt and placement. >> > > > >> > > > The old tt is handed off through bo->defrag_old_tt (reservation-lock >> > > > protected) rather than the operation context. The pointer describes BO >> > > > state for the duration of the move, so keeping it on the buffer object >> > > > is better layering and lets ttm_bo_move_accel_cleanup() pick it up. >> > > > >> > > > Because a defrag move commonly fails (beneficial-order pages are often >> > > > unavailable) and then leaves the BO untouched on its original backing, >> > > > defer ttm_bo_unmap_virtual() for the defrag case until the new backing >> > > > has been populated and the move is about to commit. Ordinary moves still >> > > > unmap up front. This avoids needlessly zapping and refaulting every >> > > > userspace mapping on the common failure path where nothing moved. >> > > > >> > > > Teach ttm_bo_move_accel_cleanup()'s ghost path about defrag: instead of >> > > > tearing the move's source tt down synchronously, hand bo->defrag_old_tt >> > > > to the ghost object so it is kept populated until the copy fence signals >> > > > and then unbound and destroyed asynchronously, while the BO keeps its >> > > > new tt. This lets a driver pipeline defrag teardown behind the GPU copy >> > > > rather than blocking on it. >> > > > >> > > > This is driver-opt-in and a no-op unless ctx->defrag is set. >> > > > >> > > > 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 >> > > > >> > > > --- >> > > > >> > > > v3: >> > > > - Reject defrag moves needing a multihop bounce: WARN, restore backing, >> > > > -EINVAL (Sashiko) >> > > > --- >> > > > drivers/gpu/drm/ttm/ttm_bo.c | 100 +++++++++++++++++++++++++++--- >> > > > drivers/gpu/drm/ttm/ttm_bo_util.c | 16 ++++- >> > > > drivers/gpu/drm/ttm/ttm_pool.c | 5 +- >> > > > include/drm/ttm/ttm_bo.h | 17 +++++ >> > > > 4 files changed, 127 insertions(+), 11 deletions(-) >> > > > >> > > > diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c >> > > > index 3980f376e3ba..c1629b4c4f0f 100644 >> > > > --- a/drivers/gpu/drm/ttm/ttm_bo.c >> > > > +++ b/drivers/gpu/drm/ttm/ttm_bo.c >> > > > @@ -125,49 +125,133 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo, >> > > > { >> > > > struct ttm_device *bdev = bo->bdev; >> > > > bool old_use_tt, new_use_tt; >> > > > + bool defrag; >> > > > int ret; >> > > > >> > > > old_use_tt = !bo->resource || ttm_manager_type(bdev, bo->resource->mem_type)->use_tt; >> > > > new_use_tt = ttm_manager_type(bdev, mem->mem_type)->use_tt; >> > > > >> > > > - ttm_bo_unmap_virtual(bo); >> > > > + /* >> > > > + * Only the BO that is the actual defrag target (moved in place via >> > > > + * ttm_bo_validate(), evict == false) is being defragmented. The same >> > > > + * ctx->defrag is threaded into evictions triggered while allocating >> > > > + * that target's new backing (ttm_bo_evict_alloc()), so guard against >> > > > + * an unrelated victim BO (evict == true) being misclassified as a >> > > > + * defrag move and needlessly reallocating its backing. >> > > > + */ >> > > > + defrag = ctx->defrag && !evict && new_use_tt && bo->ttm && >> > > > + ttm_tt_is_populated(bo->ttm); >> > > > + >> > > >> > > The sashiko reports a bug about '!evict' check which seems legitimate. >> > > >> > >> > See below - we don't allow multi-hop if ctx->defrag == true - i.e., we >> > pop a warning if driver tries to do this. Thus the Sashiko feedback >> > isn't right. >> > >> >> I think the issue is in ttm_bo_evict(): >> >> ret = ttm_bo_handle_move_mem(bo, evict_mem, true, ctx, &hop); >> if (ret != -EMULTIHOP) >> break; >> >> ret = ttm_bo_bounce_temp_buffer(bo, ctx, &hop); >> >> The bo here is an unrelated victim BO being evicted to make room for the defrag target's new backing — >> not the BO actually being defragged. ctx is the same ctx threaded down from the defrag target's >> ttm_bo_validate() call, so ctx->defrag is still set. >> >> If the first call (evict=true) returns -EMULTIHOP, ttm_bo_bounce_temp_buffer() calls >> ttm_bo_handle_move_mem(bo, hop_mem, false, ctx, NULL) — evict=false this time, >> with ctx->defrag still true. defrag = ctx->defrag && !evict && ...now evaluates true for >> this unrelated victim, misclassifying its bounce-completion as a defrag move. >> >> Since this is the final hop (it's completing the bounce, not requesting another one), >> it doesn't return -EMULTIHOP itself, so the WARN_ON_ONCE+EINVAL guard below never triggers >> here — that guard only catches a defrag-classified move that itself needs another hop. >> > >Right but actually evict isn't reachable from the Xe defrag path. > >We set TTM_PL_FLAG_TEMPORARY which doesn't change the new allocation. > >I could change ttm_bo_bounce_temp_buffer to clear defrag I guess, but >would rather not have hack like that in the code. Maybe I'll add WARN_ON >to ttm_bo_bounce_temp_buffer if defrag is set? > Ok, got it, sounds good. Thanks, Niranjana >> > > > + /* >> > > > + * Tear down userspace mappings up front for ordinary moves. A defrag >> > > > + * move is likely to leave the BO in place (beneficial-order allocation >> > > > + * commonly fails), so defer the unmap until the new backing has been >> > > > + * populated and the move is about to commit. This avoids a needless >> > > > + * zap and refault of every userspace mapping on the common failure, >> > > > + * where the BO keeps its original, still-mapped backing. >> > > > + */ >> > > > + if (!defrag) >> > > > + ttm_bo_unmap_virtual(bo); >> > > > >> > > > /* >> > > > * Create and bind a ttm if required. >> > > > */ >> > > > >> > > > if (new_use_tt) { >> > > > + struct ttm_tt *defrag_old_tt = NULL; >> > > > + >> > > > + /* >> > > > + * For a defrag move, stash the current populated tt and force a >> > > > + * fresh one to be created and populated (at beneficial order). >> > > > + * The old tt is handed to the driver move callback to copy the >> > > > + * contents from, and freed once the move completes. >> > > > + */ >> > > > + if (defrag) { >> > > > + defrag_old_tt = bo->ttm; >> > > > + bo->ttm = NULL; >> > > > + } >> > > > + >> > > > /* Zero init the new TTM structure if the old location should >> > > > * have used one as well. >> > > > */ >> > > > - ret = ttm_tt_create(bo, old_use_tt); >> > > > - if (ret) >> > > > + ret = ttm_tt_create(bo, old_use_tt && !defrag_old_tt); >> > > > + if (ret) { >> > > > + if (defrag_old_tt) >> > > > + bo->ttm = defrag_old_tt; >> > > > goto out_err; >> > > > + } >> > > > >> > > > - if (mem->mem_type != TTM_PL_SYSTEM) { >> > > > + if (defrag_old_tt || mem->mem_type != TTM_PL_SYSTEM) { >> > > > ret = ttm_bo_populate(bo, ctx); >> > > > - if (ret) >> > > > + if (ret) { >> > > > + /* >> > > > + * Discharge the freshly allocated backing and >> > > > + * leave the BO on its original tt/placement. >> > > > + */ >> > > > + if (defrag_old_tt) { >> > > > + ttm_tt_destroy(bo->bdev, bo->ttm); >> > > > + bo->ttm = defrag_old_tt; >> > > > + } >> > > > goto out_err; >> > > > + } >> > > > } >> > > > + >> > > > + bo->defrag_old_tt = defrag_old_tt; >> > > > } >> > > > >> > > > ret = dma_resv_reserve_fences(bo->base.resv, 1); >> > > > if (ret) >> > > > goto out_err; >> > > > >> > > > + /* >> > > > + * A defrag move deferred its virtual unmap until the new backing was >> > > > + * successfully populated; tear the userspace mappings down now, before >> > > > + * the move swaps in the new pages, so the next fault re-establishes >> > > > + * them against the new backing. >> > > > + */ >> > > > + if (defrag) >> > > > + ttm_bo_unmap_virtual(bo); >> > > > + >> > > >> > > NIT...would it be good to always do virtual unmap here defrag or not? >> > > >> > >> > We could unconditionally move the ttm_bo_unmap_virtual here. I didn't do >> > that to not mess non-defrag behavior but it looks harmless to >> > unconditionally shuffle around. >> >> yes, ok. >> >> > >> > > > ret = bdev->funcs->move(bo, evict, ctx, mem, hop); >> > > >> > > Sashiko reports a bug here when ttm_bo_move_memcpy() is used as move() >> > > function. Though xe doesn't use that function, it is perhaps good to >> > > guard against. >> > > >> > >> > What is suggestion to guard against this? >> > >> >> As ttm_bo_move_memcpy() is not defragmentation aware, it will cause both >> source and destination kmap to refer to same bo->ttm. we should probably >> guard against drivers falling back on ttm_bo_move_memcpy(). May be in >> ttm_bo_move_memcpy(), add a WARN_ON if bo->defrag_old_tt is set and >> return error? >> > >+1 > >> > > > if (ret) { >> > > > - if (ret == -EMULTIHOP) >> > > > + if (ret == -EMULTIHOP) { >> > > > + /* >> > > > + * A defrag move targets the BO's current placement and >> > > > + * must complete in a single hop. A driver requesting a >> > > > + * bounce here is unsupported: restore the original >> > > > + * backing and fail the defrag rather than retrying the >> > > > + * multihop with ctx->defrag still set, which would >> > > > + * misclassify the bounce as another defrag move and >> > > > + * overwrite/leak bo->defrag_old_tt. >> > > > + */ >> > > > + if (unlikely(defrag)) { >> > >> > Here is what makes -EMULTIHOP (Sashiko evict issue) impossible. >> > >> >> Responded above. >> >> > > > + WARN_ON_ONCE(1); >> > > > + ret = -EINVAL; >> > > > + goto out_err; >> > > > + } >> > > > return ret; >> > > > + } >> > > > goto out_err; >> > > > } >> > > > >> > > > + if (bo->defrag_old_tt) { >> > > > + ttm_tt_unpopulate(bo->bdev, bo->defrag_old_tt); >> > > > + ttm_tt_destroy(bo->bdev, bo->defrag_old_tt); >> > > > + bo->defrag_old_tt = NULL; >> > > > + } >> > > > + >> > > > ctx->bytes_moved += bo->base.size; >> > > > return 0; >> > > > >> > > > out_err: >> > > > - if (!old_use_tt) >> > > > + if (bo->defrag_old_tt) { >> > > > + /* Failed defrag move: restore the original backing. */ >> > > > + ttm_bo_tt_destroy(bo); >> > > > + bo->ttm = bo->defrag_old_tt; >> > > > + bo->defrag_old_tt = NULL; >> > > > + } else if (!old_use_tt) { >> > > >> > > Another sashiko reported bug about tearing down the old pages while an >> > > async copy is still in progress. Looks like xe driver waits for move to >> > > complete before returning, so should be fine. But probably worth adding >> > > a documentation for defrag_old_tt that "a defrag-aware move callback must >> > > not return an error while a copy into the new backing is still in flight >> > > >> > >> > I think it is implied in the ->move() contract if one fails after >> > triggering an async move, you must wait on async move before returning >> > or TTM will explode. This appears to be existing behavior too. >> > >> >> Ok. >> >> One more point below. >> >> > Matt >> > >> > > Niranjana >> > > >> > > > ttm_bo_tt_destroy(bo); >> > > > + } >> > > > >> > > > return ret; >> > > > } >> > > > @@ -835,7 +919,7 @@ int ttm_bo_validate(struct ttm_buffer_object *bo, >> > > > force_space = false; >> > > > do { >> > > > /* Check whether we need to move buffer. */ >> > > > - if (bo->resource && >> > > > + if (bo->resource && !ctx->defrag && >> > > > ttm_resource_compatible(bo->resource, placement, >> > > > force_space)) >> > > > return 0; >> > > > diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c >> > > > index 3e3c201a0222..771313162c8d 100644 >> > > > --- a/drivers/gpu/drm/ttm/ttm_bo_util.c >> > > > +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c >> > > > @@ -626,10 +626,22 @@ static int ttm_bo_move_to_ghost(struct ttm_buffer_object *bo, >> > > > * bo to be unbound and destroyed. >> > > > */ >> > > > >> > > > - if (dst_use_tt) >> > > > + if (bo->defrag_old_tt) { >> > > > + /* >> > > > + * Defrag move: @bo already points at the freshly allocated, >> > > > + * beneficial-order tt that the move copied into. Hand the old >> > > > + * tt (the move's source) to the ghost so it is kept populated >> > > > + * until @fence signals and then unbound and destroyed, instead >> > > > + * of being torn down synchronously. @bo keeps its new tt. >> > > > + */ >> > > > + ghost_obj->ttm = bo->defrag_old_tt; >> > > > + ghost_obj->defrag_old_tt = NULL; >> > > > + bo->defrag_old_tt = NULL; >> > > > + } else if (dst_use_tt) { >> > > > ghost_obj->ttm = NULL; >> > > > - else >> > > > + } else { >> > > > bo->ttm = NULL; >> > > > + } >> > > > >> > > > dma_resv_unlock(&ghost_obj->base._resv); >> > > > ttm_bo_put(ghost_obj); >> > > > diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c >> > > > index 0ca63f5ce73c..d045105afc24 100644 >> > > > --- a/drivers/gpu/drm/ttm/ttm_pool.c >> > > > +++ b/drivers/gpu/drm/ttm/ttm_pool.c >> > > > @@ -860,8 +860,11 @@ static int ttm_pool_iter_lower_order(struct ttm_pool_alloc_iter *it) >> > > > * pages. Record it so the driver can later try to defragment the object >> > > > * back to beneficial order. >> > > > */ >> > > > - if (it->beneficial_order && it->order == it->beneficial_order) >> > > > + if (it->beneficial_order && it->order == it->beneficial_order) { >> > > > it->tt->page_flags |= TTM_TT_FLAG_BENEFICIAL_ORDER_FAILED; >> > > > + if (it->ctx->defrag) >> > > > + return -ENOMEM; >> > > > + } >> > > >> > > NIT...probably good to add a comment here that says something like, >> > > 'return error here as the purpose of defragmentation is to get beneficial order'. >> > > >> >> I guess, you missed this point (sorry for signing early at previous comment). >> > >Sure. > >Matt > >> Niranjana >> >> > > > >> > > > it->order--; >> > > > it->page_caching = it->tt->caching; >> > > > diff --git a/include/drm/ttm/ttm_bo.h b/include/drm/ttm/ttm_bo.h >> > > > index fd814b5cf535..f4f8a8c29f04 100644 >> > > > --- a/include/drm/ttm/ttm_bo.h >> > > > +++ b/include/drm/ttm/ttm_bo.h >> > > > @@ -135,6 +135,16 @@ struct ttm_buffer_object { >> > > > * reservation lock. >> > > > */ >> > > > struct sg_table *sg; >> > > > + >> > > > + /** >> > > > + * @defrag_old_tt: Used internally during a defrag move to hand the BO's >> > > > + * previous, populated struct ttm_tt to the driver's move callback so >> > > > + * that it can copy the contents into the freshly allocated >> > > > + * beneficial-order backing. Set by TTM, consumed by the driver; the old >> > > > + * tt is freed (or restored on failure) by TTM once the move completes. >> > > > + * Protected by the reservation lock. >> > > > + */ >> > > > + struct ttm_tt *defrag_old_tt; >> > > > }; >> > > > >> > > > #define TTM_BO_MAP_IOMEM_MASK 0x80 >> > > > @@ -194,6 +204,13 @@ struct ttm_operation_ctx { >> > > > * reclaim/compaction before falling back to a smaller order anyway. >> > > > */ >> > > > bool beneficial_reclaim_backoff; >> > > > + /** >> > > > + * @defrag: Defragmentation pass. Attempt a move even when the bo's >> > > > + * current resource is already compatible with the requested placement, >> > > > + * so that the backing store can be reallocated at the pool's beneficial >> > > > + * order. >> > > > + */ >> > > > + bool defrag; >> > > > /** >> > > > * @resv: Reservation object to be used together with >> > > > * @allow_res_evict. >> > > > -- >> > > > 2.34.1 >> > > >