From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4EA3E606A322 for ; Thu, 3 Dec 2026 09:43:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=FD1VE0zv Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1229E10E5A9; Thu, 3 Dec 2026 09:43:20 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id D2AF110E5A9; Thu, 3 Dec 2026 09:43:13 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 8E5D5434AB; Thu, 3 Dec 2026 09:43:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 507E31F00893; Thu, 3 Dec 2026 09:43:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796290993; bh=w9PZG6PyyL9xw6+DGpnt3htVdossz5JMJZPSCTLVvh8=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=FD1VE0zvNx/j2bbWJxwoQHw2s9g0t45KZlo/p5jxdWTmnZMfTyarzjKOn0P/daBzm l3f2nkcsg9DmxHE5kfop+Gcd3Z68Vy5JRilwMb7ckgjTY+4v/mCg2QyFYxzaU32v4L wz5awP2a0bKpWFVtyYU9+CsiBuGok9U3tj6aEmgiKCeipPzfxafSi5XLrAQea4nclq taDl6yP0yubx2MXMgkbCSpvVmq7hcTUTBcSQkFiPCAgd7m8hEcQrOWOn4gwBwo192E r/+QoX5u4eYodrLzMyTauP7f7i+4rvYU09o6tpjCWihvG7wP9CCSuq9NOCUmN/FcQ5 qHCszj1VPMvzQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 2/3] drm/xe: Don't fail runtime suspend permanently on VRAM eviction -ENOMEM To: =?utf-8?b?VGhvbWFzIEhlbGxzdHLDtm0=?= , intel-xe@lists.freedesktop.org Cc: DRI-devel In-Reply-To: <20261203085321.235694-3-thomas.hellstrom@linux.intel.com> References: <20261203085321.235694-1-thomas.hellstrom@linux.intel.com> <20261203085321.235694-3-thomas.hellstrom@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 09:43:12 +0000 X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "Intel-xe" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] drm/xe: -EAGAIN in xe_pm_runtime_suspend() self-retriggers OOM retry storm -- commit 432d67d7cb644bed2d1d62b6cc14bc747772f450 Author: Thomas Hellstr=C3=B6m drm/xe: Don't fail runtime suspend permanently on VRAM eviction -ENOMEM This commit converts -ENOMEM returned by xe_bo_evict_all() during D3cold runtime suspend into -EAGAIN so the runtime PM core does not record a permanent runtime error on the device. > diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c > index 103290fd6445c..f1dc97afb72a2 100644 > --- a/drivers/gpu/drm/xe/xe_pm.c > +++ b/drivers/gpu/drm/xe/xe_pm.c > @@ -581,8 +581,16 @@ int xe_pm_runtime_suspend(struct xe_device *xe) > =20 > if (xe->d3cold.allowed) { > err =3D xe_bo_evict_all(xe); > - if (err) > + if (err) { > + /* > + * Runtime PM treats errors other than -EAGAIN and > + * -EBUSY as fatal, so report memory shortage as > + * transient to allow a later retry. > + */ > + if (err =3D=3D -ENOMEM) > + err =3D -EAGAIN; > goto out_resume; > + } > } [Severity: Medium] Can returning -EAGAIN here trigger an unbounded runtime suspend retry loop while the GPU is idle under persistent memory pressure? During xe_bo_evict_all(), evicting a BO on xe->pinned.late.external or xe->pinned.late.kernel_bo_present submits a migration job via xe_sched_job_create(), which calls xe_pm_runtime_get_noresume(). If a later pinned BO hits -ENOMEM, xe_bo_evict_all_undo() discards all new backups. When that migration job finishes, drm_sched_free_job_work() runs on the scheduler submit_wq worker and calls xe_sched_job_destroy() -> xe_pm_runtime_put(). Because current is not xe->pm_callback_task, it calls pm_runtime_mark_last_busy() and pm_runtime_put() instead of the noidle path. Because -EAGAIN leaves dev->power.runtime_error clear, that off-thread put either refreshes last_busy before rpm_suspend() checks autosuspend expirati= on or drops usage_count to zero after RPM_ACTIVE is restored and queues RPM_REQ_IDLE. Either way, autosuspend re-arms every autosuspend_delay_ms. Each retry drives repeated __GFP_RETRY_MAYFAIL reclaim on a memory-starved host, submits GPU copies whose backups are immediately undone, and runs full display D3cold teardown and re-init via xe_display_disable_d3cold(). Falli= ng back to D3hot on -ENOMEM would avoid this self-retriggering loop. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203085321.2356= 94-1-thomas.hellstrom@linux.intel.com?part=3D2