From: "Christian König" <christian.koenig@amd.com>
To: Mario Limonciello <superm1@kernel.org>,
Alex Deucher <alexander.deucher@amd.com>,
"Rafael J . Wysocki" <rafael@kernel.org>
Cc: "open list:RADEON and AMDGPU DRM DRIVERS"
<amd-gfx@lists.freedesktop.org>,
"open list:DRM DRIVERS" <dri-devel@lists.freedesktop.org>,
"open list:HIBERNATION (aka Software Suspend,
aka swsusp)" <linux-pm@vger.kernel.org>,
Mario Limonciello <mario.limonciello@amd.com>
Subject: Re: [RFC 0/2] Evict VRAM after processes are frozen
Date: Fri, 2 May 2025 16:47:42 +0200 [thread overview]
Message-ID: <0c097223-ff2f-4f1a-843d-5feb94ce3c40@amd.com> (raw)
In-Reply-To: <20250501211734.2434369-1-superm1@kernel.org>
On 5/1/25 23:17, Mario Limonciello wrote:
> From: Mario Limonciello <mario.limonciello@amd.com>
>
> As part of the suspend and hibernate sequences devices supported
> by amdgpu will have VRAM evicted. This has been littered with problems
> in the past, and now it is called strategically at multiple times
> during power management sequences.
>
> Most recently there were a number of issues reported that were root caused
> to physical memory pressure at suspend time where VRAM couldn't be evicted.
> A new call was introduced using a PM notifier before swap was turned off
> so that even if there are physical memory pressures VRAM could still be
> evicted into swap.
>
> This helped, but users using older systemd noted that this could lead to a
> deadlock. This is because user processes aren't frozen by older versions
> of systemd and thus if a game is running it could potentially be creating
> BOs during the eviction thus preventing eviction from ever completing.
>
> This isn't an issue with newer systemd because it uses cgroup freezing
> to freeze user processes. Nonetheless this isn't a good behavior to rely
> upon for userspace, so this series aims to solve the problem in another way.
>
> Introduce new PM notifier calls after "prepare" notifier is done AND after
> tasks have been frozen. amdgpu listens to these PM notifier calls and
> will run the first eviction at this time.
Sounds totally sane to me, but I'm really not deep enough in the PM code to fully judge the implementation.
Feel free to add Acked-by: Christian König <christian.koenig@amd.com> to the patches.
Regards,
Christian.
>
> Mario Limonciello (2):
> PM: Add suspend and hibernate notifications for after freeze
> drm/amd: Use suspend and hibernate post freeze notifications
>
> Documentation/driver-api/pm/notifiers.rst | 19 ++++++++++++++++---
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
> include/linux/suspend.h | 14 ++++++++------
> kernel/power/hibernate.c | 9 +++++++--
> kernel/power/suspend.c | 13 +++++++++----
> 5 files changed, 42 insertions(+), 17 deletions(-)
>
prev parent reply other threads:[~2025-05-02 14:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-01 21:17 [RFC 0/2] Evict VRAM after processes are frozen Mario Limonciello
2025-05-01 21:17 ` [RFC 1/2] PM: Add suspend and hibernate notifications for after freeze Mario Limonciello
2025-05-02 16:37 ` Mario Limonciello
2025-05-01 21:17 ` [RFC 2/2] drm/amd: Use suspend and hibernate post freeze notifications Mario Limonciello
2025-05-07 19:14 ` Rafael J. Wysocki
2025-05-07 19:17 ` Mario Limonciello
2025-05-07 19:39 ` Rafael J. Wysocki
2025-05-07 19:42 ` Alex Deucher
2025-05-07 19:45 ` Mario Limonciello
2025-05-07 19:51 ` Rafael J. Wysocki
2025-05-02 14:47 ` Christian König [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0c097223-ff2f-4f1a-843d-5feb94ce3c40@amd.com \
--to=christian.koenig@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-pm@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=rafael@kernel.org \
--cc=superm1@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox