ANDROID: mm/oom_kill: allow process_mrelease reclaim memory in parallel with exit_mmap
To allow process_mrelease to reap targeted mm in parallel with exit_mmap mark the victim with MMF_OOM_VICTIM flag. Bug: 189803002 Signed-off-by: Suren Baghdasaryan <surenb@google.com> Change-Id: I89cf5f8fbeeb18b93a340b9ebe7f200837ebe846
This commit is contained in:
parent
f4f2c619d5
commit
e99926fdfa
1 changed files with 6 additions and 0 deletions
|
|
@ -1233,6 +1233,12 @@ SYSCALL_DEFINE2(process_mrelease, int, pidfd, unsigned int, flags)
|
|||
mm = p->mm;
|
||||
mmgrab(mm);
|
||||
|
||||
/*
|
||||
* If we are too late and exit_mmap already checked mm_is_oom_victim
|
||||
* then will block on mmap_read_lock until exit_mmap releases mmap_lock
|
||||
*/
|
||||
set_bit(MMF_OOM_VICTIM, &mm->flags);
|
||||
|
||||
if (task_will_free_mem(p))
|
||||
reap = true;
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue