From: zhongjinji <zhongjinji@honor.com>
To: <mhocko@suse.com>
Cc: <akpm@linux-foundation.org>, <feng.han@honor.com>,
<liam.howlett@oracle.com>, <linux-kernel@vger.kernel.org>,
<linux-mm@kvack.org>, <liulu.liu@honor.com>,
<lorenzo.stoakes@oracle.com>, <rientjes@google.com>,
<shakeel.butt@linux.dev>, <tglx@linutronix.de>,
<zhongjinji@honor.com>
Subject: Re: [PATCH v5 1/2] mm/oom_kill: Do not delay oom reaper when the victim is frozen
Date: Wed, 27 Aug 2025 20:14:36 +0800 [thread overview]
Message-ID: <20250827121436.10795-1-zhongjinji@honor.com> (raw)
In-Reply-To: <aK71W1ITmC_4I_RY@tiehlicka>
> On Mon 25-08-25 21:38:54, zhongjinji wrote:
> > The OOM reaper can quickly reap a process's memory when the system
> > encounters OOM, helping the system recover. If the victim process is
> > frozen and cannot be unfrozen in time, the reaper delayed by two seconds
> > will cause the system to fail to recover quickly from the OOM state.
> >
> > When an OOM occurs, if the victim is not unfrozen, delaying the OOM reaper
> > will keep the system in a bad state for two seconds. Before scheduling the
> > oom_reaper task, check whether the victim is in a frozen state. If the
> > victim is frozen, do not delay the OOM reaper.
>
> I do not think this changelog captures the essence of the change really
> well and it suggests that this might be a performance optimization. As I
> have explained on several occasions the oom reaper is not meant to be a
> performance optimization but rather a forward progress guarantee. I
> would suggest this wording instead.
>
> "
> The oom reaper is a mechanism to guarantee a forward process during OOM
> situation when the oom victim cannot terminate on its own (e.g. being
> blocked in uninterruptible state or frozen by cgroup freezer). In order
> to give the victim some time to terminate properly the oom reaper is
> delayed in its invocation. This is particularly beneficial when the oom
> victim is holding robust futex resources as the anonymous memory tear
> down can break those.
>
> On the other hand deliberately frozen tasks by the freezer cgroup will
> not wake up until they are thawed in the userspace and delay is
> effectively pointless. Therefore opt out from the delay for cgroup
> frozen oom victims.
> "
Thank you, I will update it.
>
> Thanks!
> --
> Michal Hocko
> SUSE Labs
next prev parent reply other threads:[~2025-08-27 12:14 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-25 13:38 [PATCH v5 0/2] " zhongjinji
2025-08-25 13:38 ` [PATCH v5 1/2] mm/oom_kill: " zhongjinji
2025-08-25 19:41 ` Shakeel Butt
2025-08-26 13:01 ` zhongjinji
2025-08-26 12:43 ` Lorenzo Stoakes
2025-08-27 12:08 ` Michal Hocko
2025-08-27 12:14 ` zhongjinji [this message]
2025-08-25 13:38 ` [PATCH v5 2/2] mm/oom_kill: Have the OOM reaper and exit_mmap() traverse the maple tree in opposite order zhongjinji
2025-08-26 12:53 ` Lorenzo Stoakes
2025-08-26 13:37 ` Liam R. Howlett
2025-08-26 13:50 ` Lorenzo Stoakes
2025-08-26 15:21 ` Liam R. Howlett
2025-08-26 22:26 ` Shakeel Butt
2025-08-27 4:12 ` Liam R. Howlett
2025-08-27 4:25 ` Liam R. Howlett
2025-08-27 9:55 ` zhongjinji
2025-08-27 15:57 ` Suren Baghdasaryan
2025-08-28 0:38 ` Liam R. Howlett
2025-08-29 7:11 ` Michal Hocko
2025-08-29 7:14 ` Michal Hocko
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=20250827121436.10795-1-zhongjinji@honor.com \
--to=zhongjinji@honor.com \
--cc=akpm@linux-foundation.org \
--cc=feng.han@honor.com \
--cc=liam.howlett@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liulu.liu@honor.com \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@suse.com \
--cc=rientjes@google.com \
--cc=shakeel.butt@linux.dev \
--cc=tglx@linutronix.de \
/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