From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796380645; b=wz7F9QML+6MTr34yzuhvqRWO107/4W9fxE4pTijlNZUB3JzSZfM+jMz7U2DwpXGyI4hY BiZz7FKcPzYHXSh2GNMYsBtbuk+J2nC3vw7eTDsauFdSWYWYZPE+/WlKlDwowsbAMm7x1 WIZxY+nymZc86Zu5TqvVIzF5dMg6I0oCfbDBybmEmvGSaijMX78H2TLZI0661+8bMfF/p LUy2LoXnXyUUHXHewN8nZsgkIchWqOOX/4UmvQF1O05rDHucfYiiWRkdxel9BFiDU56J+ ETUPjl/vH7IczgHIYco+d6NdCNy+dl4qJAmdfZEtJH4wwLL9n10ZdQ3Gdpqgg44xWnw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380645; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=UWlAu4akUEiURyemwBWeWUUAABTVdYMSqvhUeMrxY3A=; b=4B2AH4dBSB8p/vs7BT4hCEAtWnKUHJ3sA+IWDMbt8hhZHi9qsbdSHhPAchG3yJRoDo54 w0VaUgNmpLt4x5V6YWmVZnjmTCHzupBc+Nzi0GL8m8G+L+9QHRp1SSkkKUpFVKUdrIMYw 9qklUUc6foe1JAs2Vg0AR5OYjdXk/ak3tvjTIe2X8KdHg20Th9QeOx4qd8JBzlZ8tOv+l znolPGZSLri7GHeREWczYh8IcotQ9ODM6ANRNdOI7unCaZqPzj9Jepu/L7Jd4JKPa5Hem r1Ctnaj24mrPxIm9oSNgoRUU55wjbYyG6UqRMtH5esskBefXMGi4NzBAuriJFq1n94A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=ytGUwfjB; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D42A606A33B; Fri, 4 Dec 2026 10:37:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=ytGUwfjB Received: by smtp.kernel.org (Postfix) with ESMTPSA id 063C71F000C2; Fri, 4 Dec 2026 10:37:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380645; bh=UWlAu4akUEiURyemwBWeWUUAABTVdYMSqvhUeMrxY3A=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ytGUwfjBt6W1jt3SYCVOqM7rqhgJH1xdG7U/9hkl0kpMPW5ph4dFmm8szCDGpPJtp /XZNCEAPWpYc2EzOGJshvWV5Ps/t6CRkqbBd/Oro34tpUi873nj0AL7P/l/uEAmNRe 26ZRKPTnsATwTs+IK8rh0Rga/2H7i/5S+2F0vtM0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Christian=20K=C3=B6nig?= , Matthew Brost , Rodrigo Vivi , intel-xe@lists.freedesktop.org, =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , Dave Airlie Subject: [PATCH 7.3 365/742] drm/xe: Dont abort the shrinker walk on -EBUSY Date: Fri, 4 Dec 2026 19:03:49 +0900 Message-ID: <20261204100644.779270556@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thomas Hellström commit 9de430b6fbbdfeee1a5eec33edf53f52c13c869b upstream. xe_bo_shrink() returns -EBUSY for bos that can't currently be shrunk, for example imported dma-bufs, bos whose vm is currently validating, bos that are still busy after the wait timeout, or bos whose backup fails. The shrinker LRU walk treats any negative return value as fatal and aborts, which also skips the remaining shrinker passes. As a result, a single such bo, like an imported dma-buf on the XE_PL_TT LRU, prevents reclaim of all bos behind it on the LRU. Skip bos for which xe_bo_shrink() returns -EBUSY and continue the walk, like the TTM LRU walk does. v4: - Patch introduced. Fixes: 00c8efc3180f ("drm/xe: Add a shrinker for xe bos") Cc: Christian König Cc: Matthew Brost Cc: Rodrigo Vivi Cc: intel-xe@lists.freedesktop.org Cc: # v6.15+ Assisted-by: LLM Signed-off-by: Thomas Hellström Reviewed-by: Matthew Brost Link: https://patch.msgid.link/20261019095655.3501-2-thomas.hellstrom@linux.intel.com (cherry picked from commit 846f333b3e0b48065f96bee74ffa0b9d390ed05f) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/xe/xe_shrinker.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/gpu/drm/xe/xe_shrinker.c +++ b/drivers/gpu/drm/xe/xe_shrinker.c @@ -113,6 +113,9 @@ static int __xe_shrinker_walk(struct xe_ continue; lret = xe_bo_shrink(ctx, ttm_bo, flags, scanned); + /* Like the TTM LRU walk, skip bos we can't shrink now. */ + if (lret == -EBUSY) + continue; if (lret < 0) { ret = lret; goto out;