lkml.org 
[lkml]   [2021]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 2/3] mm: introduce process_mrelease system call
Date
>>> Getting a hold of the mm and locking the mmap_lock would be sufficient I guess.
>
> That's exactly what I do here. The simplified sequence is:
>
> task_lock
> if (task_will_free_mem())
> mm=mmget()
> task_unlock
> if (!mm) return;
>
> mmap_read_lock(mm)
> __oom_reap_task_mm(mm)
> mmap_read_unlock(mm)
> mmput(mm)
>
> Or did I misunderstand your comments?

Oh, sorry, my tired eyes confused "put_task_struct()" with
"task_unlock()" and even "mmget()" with "mmgrab()" ...

So this is essentially get_task_mm() with an additional
task_will_free_mem() check.

LGHTM!

:)

--
Thanks,

David / dhildenb

\
 
 \ /
  Last update: 2021-07-22 19:13    [W:1.091 / U:0.820 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site