lkml.org 
[lkml]   [2021]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/2] mm: introduce process_mrelease system call
On Fri 23-07-21 01:11:51, Suren Baghdasaryan wrote:
> On Thu, Jul 22, 2021, 11:20 PM Michal Hocko <mhocko@suse.com> wrote:
>
> > On Thu 22-07-21 21:47:56, Suren Baghdasaryan wrote:
> > > On Thu, Jul 22, 2021, 7:04 PM Shakeel Butt <shakeelb@google.com> wrote:
> > >
> > > > On Thu, Jul 22, 2021 at 6:14 PM Suren Baghdasaryan <surenb@google.com>
> > > > wrote:
> > > > >
> > > > [...]
> > > > > +
> > > > > + mmap_read_lock(mm);
> > > >
> > > > How about mmap_read_trylock(mm) and return -EAGAIN on failure?
> > > >
> > >
> > > That sounds like a good idea. Thanks! I'll add that in the next respin.
> >
> > Why is that a good idea? Can you do anything meaningful about the
> > failure other than immediately retry the syscall and hope for the best?
> >
>
> I was thinking if this syscall implements "best effort without blocking"
> approach then for a more strict usage user can simply retry.

I do not think we really want to promise non blocking behavior at this
stage unless that is absolutely necessary. The current implementation
goes an extra mile to not block but I wouldn't carve it into stone via
userspace expectations.

> However
> retrying means issuing another syscall, so additional overhead...
> I guess such "best effort" approach would be unusual for a syscall, so
> maybe we can keep it as it is now and if such "do not block" mode is needed
> we can use flags to implement it later?

Yeah, an explicit opt-in via flags would be an option if that turns out
to be really necessary.
--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2021-07-23 10:54    [W:0.450 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site