Re: [PATCH -rt] memcg: use migrate_disable()/migrate_enable( ) in memcg_check_events()
From: Yong Zhang <hidden>
Date: 2011-11-17 03:03:42
Also in:
lkml
From: Yong Zhang <hidden>
Date: 2011-11-17 03:03:42
Also in:
lkml
On Wed, Nov 16, 2011 at 06:02:42PM +0100, Thomas Gleixner wrote:
On Wed, 16 Nov 2011, Steven Rostedt wrote:quoted
On Wed, 2011-11-16 at 17:16 +0800, Yong Zhang wrote:quoted
Looking at commit 4799401f [memcg: Fix race condition in memcg_check_events() with this_cpu usage], we just want to disable migration. So use the right API in -rt. This will cure below warning.No this won't work. Not even for -rt. If we disable migration but not preemption, then two tasks can take this path. And the checks in __memcg_event_check() will be corrupted because nothing is protecting the updates from two tasks going into the same path. Perhaps a local_lock would work.Yes, that's the only sensible option for now. Untested patch below.
Works for me. Thanks, Yong