From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B27F273816 for ; Wed, 20 May 2026 14:47:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779288474; cv=none; b=LAlpUqb2JygUNQF6/GG+iNzc/JlXxy3HE2u1stnrUfGB1X7CP7ZIn6QSemUic9xeut+wDsNTipNgOwG2LFY3t5xMe0/zyyWroUrl3T/bQ0BnAl13EoKdDEiTO5tG83hYzneCZ3P4SacJ1nWaLrZ9aqlnvruuKiPFCu/tXm54Mhw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779288474; c=relaxed/simple; bh=3/X8kQJn7tqSLxuKsJm3VE2f1gWKBo4Jb0UM3SCqGPw=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=ERuqNbWSlDWiHsu9AXMvbHrWQnlgrvnlNuFxLVrI0ZxrxWdLwQTIt4aMZbSAjJvr5K4xj0VZJYwQ+4NLAwKRDdpyrJrT6vzv8mMJK3dAAwoDJh7MHNXe42FDXgEp/0zqSg3BmqqKZrOnUqfpMIhbwvZQvLzlTSRRb9W5GAkutvs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=lMNvWM3+; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="lMNvWM3+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0AC21F000E9; Wed, 20 May 2026 14:47:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779288473; bh=5Gr3wEg2hmVW2Qg3Odu8fBbdNARhKHAVaOtDN25DD3E=; h=Subject:To:Cc:From:Date; b=lMNvWM3+Bevu/VecCRdNQFv5wBHbWgibol/zfQjmDxQm7kGh87hoys0km5Y19OQO8 c8+qPIDzERgz1WvhcdwKg32JseGtL6aqwBM73zO5eus9r3yegBuOyAcSzZ5L362QsI UFvFnop6bx0avNY1lDJq2MRvXQhD1Xt4q5i2IaHw= Subject: FAILED: patch "[PATCH] drm/ttm: Fix ttm_bo_shrink() infinite LRU walk on backup" failed to apply to 6.18-stable tree To: thomas.hellstrom@linux.intel.com,airlied@redhat.com,christian.koenig@amd.com,matthew.auld@intel.com,matthew.brost@intel.com,ray.huang@amd.com Cc: From: Date: Wed, 20 May 2026 16:47:56 +0200 Message-ID: <2026052056-ideology-finite-c38d@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.18-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y git checkout FETCH_HEAD git cherry-pick -x 1d59f36e95f7f7134db0e313c9d787cb0adb2153 # git commit -s git send-email --to '' --in-reply-to '2026052056-ideology-finite-c38d@gregkh' --subject-prefix 'PATCH 6.18.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 1d59f36e95f7f7134db0e313c9d787cb0adb2153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= Date: Mon, 11 May 2026 18:24:43 +0200 Subject: [PATCH] drm/ttm: Fix ttm_bo_shrink() infinite LRU walk on backup failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apply the same fix as b2ed01e7ad ("drm/ttm: Fix ttm_bo_swapout() infinite LRU walk on swapout failure") to the ttm_bo_shrink() path. Move del_bulk_move from before the backup to after success only, using ttm_resource_del_bulk_move_unevictable() since the resource is now unevictable once fully backed up. Fixes: 70d645deac98 ("drm/ttm: Add helpers for shrinking") Cc: Christian König Cc: Huang Rui Cc: Matthew Auld Cc: Matthew Brost Cc: Dave Airlie Cc: dri-devel@lists.freedesktop.org Cc: stable@vger.kernel.org # v6.15+ Assisted-by: GitHub_Copilot:claude-opus-4.6 Reviewed-by: Matthew Auld Link: https://patch.msgid.link/20260511162443.24352-1-thomas.hellstrom@linux.intel.com Signed-off-by: Thomas Hellström diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index f83b7d5ec6c6..3e3c201a0222 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c @@ -1112,19 +1112,14 @@ long ttm_bo_shrink(struct ttm_operation_ctx *ctx, struct ttm_buffer_object *bo, if (lret < 0) return lret; - if (bo->bulk_move) { - spin_lock(&bdev->lru_lock); - ttm_resource_del_bulk_move(bo->resource, bo); - spin_unlock(&bdev->lru_lock); - } - lret = ttm_tt_backup(bdev, bo->ttm, (struct ttm_backup_flags) {.purge = flags.purge, .writeback = flags.writeback}); - if (lret <= 0 && bo->bulk_move) { + if (lret > 0) { spin_lock(&bdev->lru_lock); - ttm_resource_add_bulk_move(bo->resource, bo); + ttm_resource_del_bulk_move_unevictable(bo->resource, bo); + ttm_resource_move_to_lru_tail(bo->resource); spin_unlock(&bdev->lru_lock); }