[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181228015352.GG2509588@devbig004.ftw2.facebook.com>
Date: Thu, 27 Dec 2018 17:53:52 -0800
From: Tejun Heo <tj@...nel.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Vincent Guittot <vincent.guittot@...aro.org>,
Sargun Dhillon <sargun@...gun.me>,
Xie XiuQi <xiexiuqi@...wei.com>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>, xiezhipeng1@...wei.com,
huawei.libin@...wei.com,
linux-kernel <linux-kernel@...r.kernel.org>,
Dmitry Adamushko <dmitry.adamushko@...il.com>,
Rik van Riel <riel@...riel.com>
Subject: Re: [PATCH] sched: fix infinity loop in update_blocked_averages
Hello,
On Thu, Dec 27, 2018 at 05:36:47PM -0800, Linus Torvalds wrote:
> > Unless I'm totally confused, which is definitely possible, I don't
> > think there's a race condition and the only bug is the
> > tmp_alone_branch pointer getting dangled, which maybe doesn't happen
> > all that much?
>
> Ahh. That would explain the list corruption. The next
> list_add_leaf_cfs_rq() could try to add to a removed entry.
>
> How would you reset it? Do something like
>
> rq->tmp_alone_branch = &rq->leaf_cfs_rq_list;
>
> for every removal, or make it conditional on it matching the removed entry?
Vincent knows that part way better than me but I think the safest way
would be doing the optimization removal iff tmp_alone_branch is
already pointing to leaf_cfs_rq_list. IIUC, it's pointing to
something else only while a branch is being built and deferring
optimization removal by an avg update cycle isn't gonna make any
difference anyway.
Thanks.
--
tejun
Powered by blists - more mailing lists