Messages in this thread | | | Date | Thu, 16 Oct 2014 22:31:19 +0200 | From | Peter Zijlstra <> | Subject | Re: [PATCH] sched/fair: Fix race in update_cfs_rq_h_load() |
| |
On Thu, Oct 16, 2014 at 05:49:19PM +0400, Kirill Tkhai wrote: > > The original idea of cfs_rq::last_h_load_update was to do not > update cfs_rq::h_load more than once a jiffies. > > Since task_numa_compare()->task_h_load()->update_cfs_rq_h_load() > makes unlocked update, this may be a reason of race between two > parallel updates, or with remote rq->curr changing. > > The patch does not change idea, but it excludes the race. Now we > update cfs_rq::h_load holding rq's lock. This happens in two > places: every jiffie in task_tick_fair(), and in set_curr_task_fair() > when task becomes fair.
But why is this a problem? Most of the load balance code is racy like hell -- purposely so, added serialization is typically worse.
| |