lkml.org 
[lkml]   [2021]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v4 1/2] mm: introduce process_mrelease system call
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

\
 
 \ /
  Last update: 2021-08-04 18:55    [W:1.492 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site