Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=192.198.163.18 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail; t=1796259625; b=PKaJXHVl9mxAk7myD5eq4Ad5dAqd/Q39IGPOhtx2Trvy5PmFdrF9rYVuUpqYa8XHRtBz proorC/zTKym170HkU3qcSinoEF4npjyPW3O9doH2w508zwM1x/mMnTBaeK+QYQbSpZfc Z8BpLTHAw4XMg1o3c/gvHc1+hd+FmDH729g3U8gSE2LnHkQtTKvyO4BF3NJR555AeOpvv 8jdraIF92OloTrGFWhi048iJ0bMnOfXFLZB2ROZokXhuROXL2LRB+i0EMBpkFFjHS8tbn qaoflRDDikpi6BKKPialIzZTDkrQf+2O4dZkTMad+YBCnH1h1FeOwiPOXgcetFsGMcQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796259625; 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-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=S01yKiX3XzCbhHfvIHdIKKkibUDjcoW5vvkPLU8agiU=; b=ZjTtRygPletEe3xTUR2Mj+V3cZV+Hu8xwyho3oDt+xTfBLjLMRr7OZW5thUSoAhF0RSx MaKqlLJ1qqfM4OPupgOI3J1VubS+Wswbv0/UhaccmBR6it39xPZhC2A7JJoCRJhHLywTk lZzXNpU1dMj6nuC6o9tG2ITLddnbmv1q7fA4E/XkaZWwBIpXhByO2V9LUwBot5SwbMANR tEgEmWgha4Um7Yn03KCdvSFXaiOpGZIwljU+vSt2Y2A7LyIoUWXErhYoD2XEDD36IzzOO k2kOELrcqJoG+MgbV2e686jyDKlwUSMtUBXo7lJUEEER2Ugh+6f0eEWcYaHcPNcXXzA== 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=dL0Fl1MA; arc=fail smtp.remote-ip=192.198.163.18 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 6D635606A32C for ; Thu, 3 Dec 2026 01:00:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6D635606A32C 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) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=dL0Fl1MA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796259624; x=1827795624; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=S01yKiX3XzCbhHfvIHdIKKkibUDjcoW5vvkPLU8agiU=; b=dL0Fl1MAA1meZY1nBPPyo8x2qO9YI1LO7c6L9zVl8t6QV2vmUwrMwqZO 8O0JIaHAK0t+Q3Y/js5u/7xjqSx3EkJqdPtYliYB17hsXA1/nCYtkPRSD pk+aGWv2IpjNu1VqkDk+QHWoy7Foku1W28KdgrQjuQBbL+kG9rUfzsnRK 9bO/UFVVyMGNPvy9IdMgfzX/QbRimcp6Jrbb7knVWisBAyS0kULZCfI4c uW+82XnTthfD9lIfZZaB/DT91bnF9A5/1IYBaJSr0VUPnDrS8NX6YZDYE T6QgiCYTivCNEhTpKNKYsLtmgzC3iqTSd+GwqpzapwhodrFLyxHTHrzie Q==; X-CSE-ConnectionGUID: VJ+WCekEToqlMxau2w3MkA== X-CSE-MsgGUID: pOQzdznqRGu8ogl21HVMew== X-IronPort-AV: E=McAfee;i="6800,10657,11984"; a="5212404" X-IronPort-AV: E=Sophos;i="6.27,247,1787036400"; d="scan'208";a="5212404" Received: from fmviesa011.fm.intel.com ([10.60.135.151]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2026 17:00:23 -0800 X-CSE-ConnectionGUID: wfVDK1fcRNKTYXEQoof/NQ== X-CSE-MsgGUID: woW/1OGbQO2pc4/usmfb8g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,247,1787036400"; d="scan'208";a="15411672" 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 17:00:24 -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 17:00:23 -0800 Received: from ORSEDG901.ED.cps.intel.com (10.7.248.11) 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 17:00:23 -0800 Received: from PH7PR06CU001.outbound.protection.outlook.com (52.101.201.19) by edgegateway.intel.com (134.134.137.111) 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 17:00:22 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UJxhvMPD40K7yH6HIB1vc4lS1EzE1Wi2yi6Uqn2qMkegO1PGZ1Tp9qYxj1ophee/UxUatl9IB5rxsEfLuQAXQrMoyeZB/OPtjru2+u81o2k2X4bhzVttj89NS226/D8NAFO8q+begZ8BVmExsDGvAOJ1fJh9RD4/ki28y6U6Zs9n1I7XBijNCvqupsLND/y0UuplzBQKE0mGCZQtxictqJcv8rnu7ReHEBg4JVAQmPUPwJlw5A1UgEKib31IgX9fHbm0l2+Ue4KzGVB9EXKNvv6w2qbXUTWlP1eiouw/fEvBCZe3cHPcJakDadTRByKzVXhPMMhFtePuDrVtu2VOqA== 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=UUcjpw/wRgknFp6rHk1j+05kzsdBermzVJBdyDNB16Y=; b=lwT5ThiA5bcJbT1Ad5oZXxj0Uq5PxgRABcwAQ5Jma7PwBZQSzBzCalNOilwo8FlQi4SW8AGhBi6/yik1VZMvL3JZ3WvuFG5xEwWpOfwCCaJTBuTnMYeRQJVEMR3gCMicK2yQCRIGWj8/JGN/wYnUENOBY3xgAU23h8ssTemiSV1Vx6eB1jxvbZdNXQCE1NRPUVmSO1vGsxJAoo5z9f4Q0C4XqZHHnUpk67xkbEo7v8VjHrMclH+IiQWIlO4I5IQ5h2qXhGlD04BvmQQhv0xUQDpQMPCY5GPTriTPb2MT84ThV2Cui426q8P/VfhkNpQCG+i8orrpq7Xj8oxR0e497Q== 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 PH0PR11MB4792.namprd11.prod.outlook.com (2603:10b6:510:32::11) by PH8PR11MB9747.namprd11.prod.outlook.com (2603:10b6:510:3a2::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.10; Thu, 3 Dec 2026 01:00:21 +0000 Received: from PH0PR11MB4792.namprd11.prod.outlook.com ([fe80::fec9:8db4:c768:8289]) by PH0PR11MB4792.namprd11.prod.outlook.com ([fe80::fec9:8db4:c768:8289%6]) with mapi id 15.21.0688.010; Thu, 3 Dec 2026 01:00:21 +0000 Date: Wed, 2 Dec 2026 17:00:19 -0800 From: Matthew Brost To: CC: , Subject: Re: [PATCH v5 18/36] drm/xe: Add a page defragmentation worker Message-ID: References: <20261202233323.3743190-1-matthew.brost@intel.com> <20261202233323.3743190-19-matthew.brost@intel.com> Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: SJ2PR07CA0004.namprd07.prod.outlook.com (2603:10b6:a03:505::10) To PH0PR11MB4792.namprd11.prod.outlook.com (2603:10b6:510:32::11) X-Mailing-List: sashiko-reviews@lists.linux.dev 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: PH0PR11MB4792:EE_|PH8PR11MB9747:EE_ X-MS-Office365-Filtering-Correlation-Id: 309d444b-2646-4edd-3820-08df50d8ce04 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|23010399003|4143699003|11063799006|6133799003|261009221727099003|261009223327099003|261009221227099003|261009223027099003|261009220027099003|18002099003|22082099003|10067099003|56012099006|261028144727099003|261102123227099003|261022105027099003|261022075727099003|261022113327099003|261021121427099003|261021123027099003|261026121527099003|261026140227099003; X-Microsoft-Antispam-Message-Info: cMqIi/y+GdIOrZUDA3A9WSMiK0R/eveygzeIAQOIb38fWp+puzS2NAi5TLdxrsR011R6NmW9e9T1lxaLq3B5Ioi/dJw1CsU29pSfSe69aRmtG/L6ch3p6o+SBwmSw8H6dBk09yZhmW+6xQQ40D7stCN5b19tCR7lDtkCMXp1LBG6YlIBRRiXxWlegnsEO+rvMge//3X++Zk4yx0n5miIO2tOwlSp+IXhvdghVC7voMKMRJw53uoZeBlbM0I6StMcDpI1BzpDH9G+jMNpBeQO7nUVIUI9UlIbnNJgmoZQ8ESwE8BK2IgOKHXr1RWqmqZPhZK18aPkGEY5tyYc65G6R2b6cE8waiAEppmNF/uFOG1pjsY4P9tw1+5iuSsuQTPqt3Ni7gOnndg6W8G/VJxpL2sA9sR82YrKwdb0lc04JCHt7alrobLRvG8iQs2zjO6116p9ftGhclbEQMpuvCPKOYeB3avyswpB2SsSoATjD1fmhWdYrxlcPlAPPQZjp5CjR2zxB2Dwd0KS388IqgpH987iWY5GZjXX7C8aiYs5T2Luy3afgry/fgT4WomcZGcYJpeoGIPvk+PsKaSGPZsboFX2J8JfdW/0nixZkw57jrc= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR11MB4792.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016)(23010399003)(4143699003)(11063799006)(6133799003)(261009221727099003)(261009223327099003)(261009221227099003)(261009223027099003)(261009220027099003)(18002099003)(22082099003)(10067099003)(56012099006)(261028144727099003)(261102123227099003)(261022105027099003)(261022075727099003)(261022113327099003)(261021121427099003)(261021123027099003)(261026121527099003)(261026140227099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?cDVRqn6fMhdVbwA9v/Jg6JNy4hlxLtmMbr3hV92HGgBTc/23GUNw9DjbIs?= =?iso-8859-1?Q?GhxacNCa5NmB8y+rWIuPQExXjCDiWYuOnWpeZX2hCwQRU43vnt+ZozoHaa?= =?iso-8859-1?Q?o+wsESnCaeyRMf21sGh7LBXUwuAck/bswriKwuL8lzSK5+n8xM5YgafL/j?= =?iso-8859-1?Q?Hq88FvVvB1HZ5EmVOmc7e7JltFFYA909zm4ncz1F/FtMvjYv3NmrWoQum/?= =?iso-8859-1?Q?GJPtoXVzlAD/Q+FGpP+CQSIVrnN8eWmEXokChvcH9jtpUFUynDGGcW/R4N?= =?iso-8859-1?Q?C2vBPFxCCwdBE4qAl5M/uYYOQWEp76qyHbd0npxSPwcW7u+FvHxRU/nu+O?= =?iso-8859-1?Q?KX53pDnoZJjhLmjpDFRGQsGc8N0T7VvqjeckerKV5o2w721QUUBX7i4h7u?= =?iso-8859-1?Q?jBbFZ3rqHdbz+yXY2G37IIp07g8th6jM/jNcTDJrXCa/LgK8jNf5ty9635?= =?iso-8859-1?Q?nrdwigsCr6C4KLfobMSkLxJ23QHEiV0mi/hChB9HOyFMcM+ZEPBD6mnjic?= =?iso-8859-1?Q?yZEajj12d60p+rLjFYjPET7UtqOV43PMuZSoJJ4UKDSQBzx10qhnUmjG86?= =?iso-8859-1?Q?NNpOzgFTE9FEj6CTEUsiC1IyFvH0gWAlMp5BtIatiAa57Y4rz2z4uvaaLZ?= =?iso-8859-1?Q?eQr75sML990WEvP60kMZAw9wOtJ0wvxirn04L9RmpqfWDk/u/EwoM21TBt?= =?iso-8859-1?Q?4gxpTov+lw7s6yR5YyAV1lAUhUXoAqlOoDWrd7SHFY3fsk0p1JNpNeGkuC?= =?iso-8859-1?Q?xIo5mXTWIr+QJmZpDKj9a2KpjucFBBeD52POBf8WGZKfam6meLP5FLfaKh?= =?iso-8859-1?Q?uBlRcBu0pddwJDs7tMGkS/ZKtnMg9LYEaRwxDMSAnr7f7hMSwQe9uQs0+Q?= =?iso-8859-1?Q?DezlAfv2/CYDmn/fFP4d8txf7HENqZSLln/0Vy67jeFaY4lNmqVctp/SYq?= =?iso-8859-1?Q?lSMW6KPLfsaYYFcqe2lBB05rlofs00gVRdEaOFXIhsG9neVg7OoyPdHtUE?= =?iso-8859-1?Q?ca38znIX4YPR+Jn6sEn64eMkHvA65fp9hK+rZNBn+M5kxNMXy6WLatgO8B?= =?iso-8859-1?Q?K9C0fzxR0T9L1hfY/LVw/vCRHmBvlW/OKqPzk6jY0uK5VX9VsE6TRnic9a?= =?iso-8859-1?Q?oW97ArsYeSd9bJVVl68RWccvRQSIODwsTXUyEDLnI16y7qPspWlDj2/7uj?= =?iso-8859-1?Q?/BJVBXKkGzyPh9deR1xZIejGjwBndL5LAJSnFOdThYK0adpdb1cqxv46h5?= =?iso-8859-1?Q?drPpYCBgXw5oL8BT2tcWPpC+L1uvLWKja1AsZlZL6oPNKPqbYpDAztKuC8?= =?iso-8859-1?Q?PiPhSF1ToWdMM8k0d1fY0OLpzdkZlFUqJkNs12Z8Nyw5Ux+LAx27Ff8Via?= =?iso-8859-1?Q?cnubiAxch207TMZtbeiXL8oULMTz5gWz6oX9vh53SiCsPj+8LgI/4cC+Tg?= =?iso-8859-1?Q?zvL6yI/O4kkDeBAvKy8Str3jJRF/1RT+rRBpcwH5KpFZGMzedNiNT0rRr4?= =?iso-8859-1?Q?RK2wbLZ60S/F+KJh+Oy92RBUBxUeyzAua1G3AlEdOaheebJjHETiTey7Xg?= =?iso-8859-1?Q?g28Iipx/eS12qUdR3AyLvi4vURqnhXcuX+wSIqXraBCrobR/9IVReA9zt8?= =?iso-8859-1?Q?ghKupRkZvb02jj0dFla/jm/8th5epOneA9IJZXS/YIv/Kf4dGLiPTcJdbe?= =?iso-8859-1?Q?p1/KTl998CazKFDU+KriUgIaNAylXXLV/HIeTzbRzb/OCt2KdonZrb74jd?= =?iso-8859-1?Q?TwjdvgEurPji/MpXofcxXRv4k5v8Q0+QR/qX6dxJWbV8d2Iq3v80G+SAGJ?= =?iso-8859-1?Q?mcUXvl1lq4TSnbTBZLruCZ45snnoc8s=3D?= X-Exchange-RoutingPolicyChecked: cDEsjxt9USwREx90y1RlzQZqbXB/kZ6m0ze8ta/GEITaOOmTMX6oeBhRdkfPDl4snGCnQwMuI6GRXJTrcZv067v/vZbhWHKfZ6aOPBjD7XQh6oJlG0iiEJjZTSXrriEx+j/bgluzYqelaBr5jHN2Zhnkxzw6rnkVdEV8usLPQGHX7sWGA4a0sIRxsPaZuWmURZWdYnnoZAYoLZSYi53/jYWrTTFRdQOgJn/xU+GL/QzNyhzCEQ6LJAXiZN3XvTxnhQ6K7Z1JOOosn6XJ1tvkyHJR2E/kjzbHgywPKeKVjRr9SBNybG9ch+ud9ydLL7wBmT+sMUnDXnPnOMpLcmyqDg== X-MS-Exchange-CrossTenant-Network-Message-Id: 309d444b-2646-4edd-3820-08df50d8ce04 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB4792.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2026 01:00:21.0787 (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: rHDjTLTHsBift/NyyzUF0fXxSuPvx0z67IeEj4HoeKFNbeK5B8xH9P0BJEz5H9bl2ysgq1V3lvToCjaMGYLjOA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR11MB9747 X-OriginatorOrg: intel.com On Thu, Dec 03, 2026 at 12:12:43AM +0000, sashiko-bot@kernel.org wrote: > Thank you for your contribution! Sashiko AI review found 3 potential > issues to consider: > - [High] drm/xe: missing wedge and shutdown checks for > xe_bo_defrag_worker() Looks valid, will fix. > - [High] drm/xe: sliced defrag of FlatCCS BOs hits WARN_ON in > __xe_migrate_copy() Flagged in prior patch, fixing. > - [Medium] drm/xe: stop defrag worker in xe_device_shutdown() before GT > reset and FLR Looks valid, will fix. Matt > -- > > commit 2827cf9a3258f09b55ed0523757aafd710c5214d > Author: Matthew Brost > > drm/xe: Add a page defragmentation worker > > This commit adds a delayed worker that walks the per-device defrag list and > attempts to reallocate and GPU-copy BO backing pages at the device's > beneficial order in budget-limited slices. > > > diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c > > index 85fb888d5db4e..5944077ba997d 100644 > > --- a/drivers/gpu/drm/xe/xe_bo.c > > +++ b/drivers/gpu/drm/xe/xe_bo.c > > [ ... ] > > > @@ -1292,6 +1457,216 @@ static void xe_bo_defrag_update(struct xe_bo *bo) > > [ ... ] > > > +static void xe_bo_defrag_worker(struct work_struct *w) > > +{ > > + struct delayed_work *dwork = to_delayed_work(w); > > + struct xe_device *xe = > > + container_of(dwork, struct xe_device, mem.defrag.worker); > > + u64 defrag_bytes = 0; > > + bool requeue = false; > > + int idx; > > + > > + if (!drm_dev_enter(&xe->drm, &idx)) > > + return; > > + > > + if (!xe_pm_runtime_get_if_active(xe)) { > > [Severity: High] > Can xe_bo_defrag_worker() replace live BO contents with uninitialized pages > when the device is wedged? > > When xe_wedge_declare() or prepare_device_for_reset() runs, xe_wedge_get() > holds a runtime PM reference, so xe_pm_runtime_get_if_active() still succeeds > while tile->migrate->q is marked wedged or killed. ttm_bo_validate() then > allocates uninitialized beneficial-order pages for the new bo->ttm and calls > xe_bo_move() -> xe_migrate_copy_defrag(). In guc_exec_queue_run_job(), > hardware submission is skipped for wedged/killed queues while job->fence is > still returned, so ttm_bo_move_accel_cleanup() commits the uncopied new > bo->ttm and frees defrag_old_tt once TDR signals job->fence with -ETIME. > > Should xe_bo_defrag_worker() check xe_wedged(xe) (or should > xe_wedge_declare() and prepare_device_for_reset() stop the defrag worker)? > > [ ... ] > > > + /* > > + * Bound the per-BO move to the run's remaining byte budget. A > > + * large object is upgraded in budget-sized slices across runs; > > + * the slices already upgraded come back as free already- > > + * beneficial harvests, so each run only spends budget on new > > + * forward progress. > > + */ > > + ret = xe_bo_defrag_one(xe, bo, XE_BO_DEFRAG_SIZE_LIMIT - defrag_bytes, > > + &consumed, &needs_more); > > + defrag_bytes += consumed; > > + > > + if (ret || needs_more) { > > [Severity: High] > Can sliced defragmentation of a large FlatCCS BO hit XE_WARN_ON(!fence) in > __xe_migrate_copy() and get stuck at the head of xe->mem.defrag.list? > > For compressible BOs on integrated FlatCCS platforms, xe_ttm_tt_create() > appends extra_pages beyond xe_bo_size(bo) to tt->num_pages (reaching 2MB or > more once xe_bo_size(bo) is at least 1GB on Xe2 iGPU). Slicing such a BO in > XE_BO_DEFRAG_SIZE_LIMIT passes upgrades the data pages in > [0, xe_bo_size(bo)) first, leaving only the trailing extra_pages sub-optimal > with TTM_TT_FLAG_BENEFICIAL_ORDER_FAILED still set. > > On the next pass, ttm_pool_alloc() borrows all data pages from defrag_old_tt > and reallocates only the trailing extra_pages. Because __xe_migrate_copy() > iterates over xe_bo_size(src_bo) during the XE_MIGRATE_COPY_DEFRAG_DATA pass, > emit_copy_chunks() finds no unborrowed data pages, leaving fence NULL: > > drivers/gpu/drm/xe/xe_migrate.c:__xe_migrate_copy() { > ... > if (XE_WARN_ON(!fence)) > return ERR_PTR(-EINVAL); > } > > The move fails with -EINVAL and restores defrag_old_tt with the failed-order > flag still set, so the BO remains at the head of xe->mem.defrag.list, > triggering the warning on every retry and starving any BOs queued behind it. > > [ ... ] > > > diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c > > index 67d648833030c..637f9e71e78b0 100644 > > --- a/drivers/gpu/drm/xe/xe_device.c > > +++ b/drivers/gpu/drm/xe/xe_device.c > > [ ... ] > > > @@ -1445,9 +1456,12 @@ int xe_device_suspend(struct xe_device *xe, bool hibernate, bool flr) > > u8 id; > > int err; > > > > + /* No defrag moves (GPU copies) while suspending or across FLR. */ > > + xe_bo_defrag_suspend(xe); > > + > > err = xe_pxp_pm_suspend(xe->pxp); > > [Severity: Medium] > Should xe_device_shutdown() also call xe_bo_defrag_suspend(xe)? > > During system shutdown, pci_device_shutdown() calls pm_runtime_resume() right > before xe_pci_shutdown() -> xe_device_shutdown(). If the device was runtime > suspended with a non-empty defrag list, xe_pm_runtime_resume() calls > xe_bo_defrag_kick(xe), arming xe_bo_defrag_worker() to run and issue GPU > migration copies while xe_device_shutdown() suspends IRQs, resets GTs and > runs __xe_driver_flr(). > > -- > Sashiko AI review · https://sashiko.dev/#/patchset/20261202233323.3743190-1-matthew.brost@intel.com?part=18