linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Suren Baghdasaryan <surenb@google.com>
To: Michal Hocko <mhocko@suse.com>
Cc: 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>, Shakeel Butt <shakeelb@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 v4 1/2] mm: introduce process_mrelease system call
Date: Wed, 4 Aug 2021 09:54:12 -0700	[thread overview]
Message-ID: <CAJuCfpFX4t_SpWs5de=dSvW8jWvJ6tYJPFeesY2mYuGtxSDOxg@mail.gmail.com> (raw)
In-Reply-To: <YQox2Ems40WXmJ3z@dhcp22.suse.cz>

On Tue, Aug 3, 2021 at 11:21 PM Michal Hocko <mhocko@suse.com> wrote:
>
> On Tue 03-08-21 15:09:43, Suren Baghdasaryan wrote:
> > On Tue, Aug 3, 2021 at 10:27 AM Suren Baghdasaryan <surenb@google.com> wrote:
> [...]
> > > > > +     if (task_will_free_mem(task) && (task->flags & PF_KTHREAD) == 0) {
> > > > > +             mm = task->mm;
> > > > > +             mmget(mm);
> > > > > +     }
> > > > > +     task_unlock(task);
> > > > > +     if (!mm) {
> > > >
> > > > Do we want to treat MMF_OOM_SKIP as a failure?
> > >
> > > Yeah, I don't think we want to create additional contention if
> > > oom-killer is already working on this mm. Should we return EBUSY in
> > > this case? Other possible options is ESRCH, indicating that this
> > > process is a goner, so don't bother. WDYT?
> >
> > After considering this some more I think ESRCH would be more
> > appropriate. EBUSY might be understood as "I need to retry at a better
> > time", which is not what we want here.
>
> Why cannot we simply return 0 in that case. The work has been done
> already by the kernel so why should we tell the caller that there was
> something wrong?

Ah, you are right. I was under the impression that MMF_OOM_SKIP means
oom-killer is reaping the mm, but looks like it means that mm was
already reaped. If that's true then I agree, returning 0 is the right
move here. Will fix.

>
> --
> Michal Hocko
> SUSE Labs

      reply	other threads:[~2021-08-04 16:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-02 22:14 [PATCH v4 1/2] mm: introduce process_mrelease system call Suren Baghdasaryan
2021-08-02 22:14 ` [PATCH v4 2/2] mm: wire up syscall process_mrelease Suren Baghdasaryan
2021-08-03  7:48 ` [PATCH v4 1/2] mm: introduce process_mrelease system call David Hildenbrand
2021-08-03 17:19   ` Suren Baghdasaryan
2021-08-03  8:39 ` Michal Hocko
2021-08-03 17:27   ` Suren Baghdasaryan
2021-08-03 22:09     ` Suren Baghdasaryan
2021-08-04  6:21       ` Michal Hocko
2021-08-04 16:54         ` Suren Baghdasaryan [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='CAJuCfpFX4t_SpWs5de=dSvW8jWvJ6tYJPFeesY2mYuGtxSDOxg@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).