lkml.org 
[lkml]   [2018]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH] mm,oom: Bring OOM notifier callbacks to outside of OOM killer.
    From
    Date
    On 2018/06/27 2:03, Paul E. McKenney wrote:
    > There are a lot of ways it could be made concurrency safe. If you need
    > me to do this, please do let me know.
    >
    > That said, the way it is now written, if you invoke rcu_oom_notify()
    > twice in a row, the second invocation will wait until the memory from
    > the first invocation is freed. What do you want me to do if you invoke
    > me concurrently?
    >
    > 1. One invocation "wins", waits for the earlier callbacks to
    > complete, then encourages any subsequent callbacks to be
    > processed more quickly. The other invocations return
    > immediately without doing anything.
    >
    > 2. The invocations serialize, with each invocation waiting for
    > the callbacks from previous invocation (in mutex_lock() order
    > or some such), and then starting a new round.
    >
    > 3. Something else?
    >
    > Thanx, Paul

    As far as I can see,

    - atomic_set(&oom_callback_count, 1);
    + atomic_inc(&oom_callback_count);

    should be sufficient.

    \
     
     \ /
      Last update: 2018-06-26 22:11    [W:2.532 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site