linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Suren Baghdasaryan <surenb@google.com>
To: Shakeel Butt <shakeelb@google.com>
Cc: Michal Hocko <mhocko@suse.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	 David Rientjes <rientjes@google.com>,
	Matthew Wilcox <willy@infradead.org>,
	 Johannes Weiner <hannes@cmpxchg.org>,
	Roman Gushchin <guro@fb.com>, Rik van Riel <riel@surriel.com>,
	 Minchan Kim <minchan@kernel.org>,
	Christian Brauner <christian@brauner.io>,
	 Christoph Hellwig <hch@infradead.org>,
	Oleg Nesterov <oleg@redhat.com>,
	 David Hildenbrand <david@redhat.com>,
	Jann Horn <jannh@google.com>, Andy Lutomirski <luto@kernel.org>,
	 Christian Brauner <christian.brauner@ubuntu.com>,
	Florian Weimer <fweimer@redhat.com>,
	 Jan Engelhardt <jengelh@inai.de>,
	Tim Murray <timmurray@google.com>,
	 Linux API <linux-api@vger.kernel.org>,
	Linux MM <linux-mm@kvack.org>,
	 LKML <linux-kernel@vger.kernel.org>,
	kernel-team <kernel-team@android.com>
Subject: Re: [PATCH v3 1/2] mm: introduce process_mrelease system call
Date: Mon, 2 Aug 2021 15:16:27 -0700	[thread overview]
Message-ID: <CAJuCfpFKP=+pG=dLd5RLyDaqGN8HMHJaqSH9c-uvWckyMWweig@mail.gmail.com> (raw)
In-Reply-To: <CAJuCfpHVUZZFPBFc6SPWOT7TrH5=SczegruB1+j=2N_ka7DG4A@mail.gmail.com>

On Mon, Aug 2, 2021 at 1:08 PM Suren Baghdasaryan <surenb@google.com> wrote:
>
> On Mon, Aug 2, 2021 at 1:05 PM Shakeel Butt <shakeelb@google.com> wrote:
> >
> > On Mon, Aug 2, 2021 at 12:54 PM Suren Baghdasaryan <surenb@google.com> wrote:
> > >
> > > On Mon, Jul 26, 2021 at 6:44 AM Shakeel Butt <shakeelb@google.com> wrote:
> > > >
> > > > On Mon, Jul 26, 2021 at 12:27 AM Michal Hocko <mhocko@suse.com> wrote:
> > > > >
> > > > [...]
> > > > >
> > > > > Is process_mrelease on all of them really necessary? I thought that the
> > > > > primary reason for the call is to guarantee a forward progress in cases
> > > > > where the userspace OOM victim cannot die on SIGKILL. That should be
> > > > > more an exception than a normal case, no?
> > > > >
> > > >
> > > > I am thinking of using this API in this way: On user-defined OOM
> > > > condition, kill a job/cgroup and unconditionally reap all of its
> > > > processes. Keep monitoring the situation and if it does not improve go
> > > > for another kill and reap.
> > > >
> > > > I can add additional logic in between kill and reap to see if reap is
> > > > necessary but unconditionally reaping is more simple.
> > > >
> > > > >
> > > > > > An alternative would be to have a cgroup specific interface for
> > > > > > reaping similar to cgroup.kill.
> > > > >
> > > > > Could you elaborate?
> > > > >
> > > >
> > > > I mentioned this in [1] where I was thinking if it makes sense to
> > > > overload cgroup.kill to also add the SIGKILLed processes in
> > > > oom_reaper_list. The downside would be that there will be one thread
> > > > doing the reaping and the syscall approach allows userspace to reap in
> > > > multiple threads. I think for now, I would go with whatever Suren is
> > > > proposing and we can always add more stuff if need arises.
> > > >
> > > > [1] https://lore.kernel.org/containers/CALvZod4jsb6bFzTOS4ZRAJGAzBru0oWanAhezToprjACfGm+ew@mail.gmail.com/
> > >
> > > Hi Folks,
> > > So far I don't think there was any request for further changes.
> > > Anything else you would want me to address or are we in a good shape
> > > wrt this feature?
> > > If so, would people who had a chance to review this patchset be
> > > willing to endorse it with their Reviewed-by or Acked-by?
> >
> > I think with Michal's suggestion to use a killable mmap lock, at least
> > I am good with the patch.
>
> Ah, yes. Thanks for pointing this out! I'll replace mmap_read_lock()
> with mmap_read_lock_killable(). Will post an updated version later
> today.

Posted the next version at https://lore.kernel.org/patchwork/patch/1471403/


  reply	other threads:[~2021-08-02 22:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23  1:14 [PATCH v3 1/2] mm: introduce process_mrelease system call Suren Baghdasaryan
2021-07-23  1:14 ` [PATCH v3 2/2] mm: wire up syscall process_mrelease Suren Baghdasaryan
2021-07-23  2:03 ` [PATCH v3 1/2] mm: introduce process_mrelease system call Shakeel Butt
2021-07-23  4:47   ` Suren Baghdasaryan
2021-07-23  6:20     ` Michal Hocko
2021-07-23  8:11       ` Suren Baghdasaryan
2021-07-23  8:15         ` David Hildenbrand
2021-07-23  8:18           ` Suren Baghdasaryan
2021-07-23  8:53         ` Michal Hocko
2021-07-23 13:46           ` Shakeel Butt
2021-07-23 16:08             ` Suren Baghdasaryan
2021-07-23 17:00               ` Shakeel Butt
2021-07-26  7:27                 ` Michal Hocko
2021-07-26 13:43                   ` Shakeel Butt
2021-08-02 19:53                     ` Suren Baghdasaryan
2021-08-02 20:05                       ` Shakeel Butt
2021-08-02 20:08                         ` Suren Baghdasaryan
2021-08-02 22:16                           ` Suren Baghdasaryan [this message]
2021-07-23 13:40       ` Shakeel Butt
2021-07-26  8:20   ` 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='CAJuCfpFKP=+pG=dLd5RLyDaqGN8HMHJaqSH9c-uvWckyMWweig@mail.gmail.com' \
    --to=surenb@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=christian.brauner@ubuntu.com \
    --cc=christian@brauner.io \
    --cc=david@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=guro@fb.com \
    --cc=hannes@cmpxchg.org \
    --cc=hch@infradead.org \
    --cc=jannh@google.com \
    --cc=jengelh@inai.de \
    --cc=kernel-team@android.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@kernel.org \
    --cc=mhocko@suse.com \
    --cc=minchan@kernel.org \
    --cc=oleg@redhat.com \
    --cc=riel@surriel.com \
    --cc=rientjes@google.com \
    --cc=shakeelb@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).