[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f40d85e0-1d90-2261-99a4-4db315df4860@i-love.sakura.ne.jp>
Date: Wed, 27 Jun 2018 05:10:48 +0900
From: Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
To: paulmck@...ux.vnet.ibm.com
Cc: Michal Hocko <mhocko@...nel.org>,
David Rientjes <rientjes@...gle.com>, linux-mm@...ck.org,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm,oom: Bring OOM notifier callbacks to outside of OOM
killer.
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.
Powered by blists - more mailing lists