[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201118103240.hnggudihd3xmqty5@wittgenstein>
Date: Wed, 18 Nov 2020 11:32:40 +0100
From: Christian Brauner <christian.brauner@...ntu.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Suren Baghdasaryan <surenb@...gle.com>, mhocko@...nel.org,
rientjes@...gle.com, willy@...radead.org, hannes@...xchg.org,
guro@...com, riel@...riel.com, minchan@...nel.org,
christian@...uner.io, oleg@...hat.com, timmurray@...gle.com,
linux-api@...r.kernel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, kernel-team@...roid.com
Subject: Re: [PATCH 1/1] RFC: add pidfd_send_signal flag to reclaim mm while
killing a process
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@...gle.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
Powered by blists - more mailing lists