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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux