lkml.org 
[lkml]   [2020]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/1] mm, oom_adj: don't loop through tasks in __set_oom_adj when not necessary
On Fri, Aug 21, 2020 at 9:37 AM Oleg Nesterov <oleg@redhat.com> wrote:
>
> again, don't really understand...
>
> On 08/21, Suren Baghdasaryan wrote:
> >
> > Actually, reviewing again and considering where list_add_tail_rcu is
> > happening, maybe the race with clone(CLONE_VM) does not introduce
> > false negatives.
>
> I think it does... Whatever we check, mm_users or MMF_PROC_SHARED,
> the task can do clone(CLONE_VM) right after the check.

Ah, yes of course. I missed this same just like in the original patch.

>
> > However a false negative I think will happen when a
> > task shares mm with another task and also has an additional thread.
> > Shared mm will increment mm_users without adding to signal->live
>
> Yes,
>
> > and
> > the additional thread will advance signal->live without adding to
> > mm_users.
>
> No, please note that CLONE_THREAD requires CLONE_VM.

My fault. Forgot that CLONE_VM means "share VM" and not "dup VM". Need
some coffee.
Thanks Oleg!

>
> Oleg.
>

\
 
 \ /
  Last update: 2020-08-21 19:23    [W:0.062 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site