From: Christian Brauner <christian.brauner@ubuntu.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Suren Baghdasaryan <surenb@google.com>,
mhocko@kernel.org, rientjes@google.com, willy@infradead.org,
hannes@cmpxchg.org, guro@fb.com, riel@surriel.com,
minchan@kernel.org, christian@brauner.io, oleg@redhat.com,
timmurray@google.com, linux-api@vger.kernel.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
kernel-team@android.com
Subject: Re: [PATCH 1/1] RFC: add pidfd_send_signal flag to reclaim mm while killing a process
Date: Wed, 18 Nov 2020 11:32:40 +0100 [thread overview]
Message-ID: <20201118103240.hnggudihd3xmqty5@wittgenstein> (raw)
In-Reply-To: <20201113155539.64e0af5b60ad3145b018ab0d@linux-foundation.org>
On Fri, Nov 13, 2020 at 03:55:39PM -0800, Andrew Morton wrote:
> On Fri, 13 Nov 2020 09:34:48 -0800 Suren Baghdasaryan <surenb@google.com> wrote:
>
> > When a process is being killed it might be in an uninterruptible sleep
> > which leads to an unpredictable delay in its memory reclaim. In low memory
> > situations, when it's important to free up memory quickly, such delay is
> > problematic. Kernel solves this problem with oom-reaper thread which
> > performs memory reclaim even when the victim process is not runnable.
> > Userspace currently lacks such mechanisms and the need and potential
> > solutions were discussed before (see links below).
> > This patch provides a mechanism to perform memory reclaim in the context
> > of the process that sends SIGKILL signal. New SYNC_REAP_MM flag for
> > pidfd_send_signal syscall can be used only when sending SIGKILL signal
> > and will lead to the caller synchronously reclaiming the memory that
> > belongs to the victim and can be easily reclaimed.
>
> hm.
>
> Seems to me that the ability to reap another process's memory is a
> generally useful one, and that it should not be tied to delivering a
> signal in this fashion.
I agree and I see you've already had some good ideas how to tie this to
process_madvise(). If that's workable for your use-case then I'd prefer
that approach. Signals are almost always not a great choice.
Christian
prev parent reply other threads:[~2020-11-18 10:32 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-13 17:34 [PATCH 1/1] RFC: add pidfd_send_signal flag to reclaim mm while killing a process Suren Baghdasaryan
2020-11-13 23:55 ` Andrew Morton
2020-11-14 0:06 ` Suren Baghdasaryan
2020-11-14 1:00 ` Andrew Morton
2020-11-14 1:09 ` Suren Baghdasaryan
2020-11-14 1:18 ` Andrew Morton
2020-11-14 1:57 ` Suren Baghdasaryan
2020-11-14 2:16 ` Andrew Morton
2020-11-14 2:51 ` Suren Baghdasaryan
2020-11-16 23:24 ` Minchan Kim
2020-11-18 19:10 ` Michal Hocko
2020-11-18 19:22 ` Suren Baghdasaryan
2020-11-18 19:32 ` Michal Hocko
2020-11-18 19:51 ` Suren Baghdasaryan
2020-11-18 19:55 ` Suren Baghdasaryan
2020-11-19 0:13 ` Suren Baghdasaryan
2020-11-24 5:45 ` Suren Baghdasaryan
2020-11-18 10:32 ` Christian Brauner [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=20201118103240.hnggudihd3xmqty5@wittgenstein \
--to=christian.brauner@ubuntu.com \
--cc=akpm@linux-foundation.org \
--cc=christian@brauner.io \
--cc=guro@fb.com \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@android.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=minchan@kernel.org \
--cc=oleg@redhat.com \
--cc=riel@surriel.com \
--cc=rientjes@google.com \
--cc=surenb@google.com \
--cc=timmurray@google.com \
--cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).