Thread (17 messages) flat view 17 messages, 3 authors, 2021-07-23

Re: [PATCH v2 2/3] mm: introduce process_mrelease system call

From: David Hildenbrand <hidden>
Date: 2021-07-22 07:45:49
Also in: linux-api, lkml

quoted
quoted
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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help