From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754997AbbCGDlp (ORCPT ); Fri, 6 Mar 2015 22:41:45 -0500 Received: from cantor2.suse.de ([195.135.220.15]:49578 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751670AbbCGDlo (ORCPT ); Fri, 6 Mar 2015 22:41:44 -0500 Message-ID: <1425699696.19505.99.camel@stgolabs.net> Subject: Re: softlockups in multi_cpu_stop From: Davidlohr Bueso To: Ming Lei Cc: Jason Low , Linus Torvalds , Ingo Molnar , Sasha Levin , Peter Zijlstra , LKML , Dave Jones Date: Fri, 06 Mar 2015 19:41:36 -0800 In-Reply-To: References: <54F41516.6060608@oracle.com> <54F98F1F.3080107@oracle.com> <20150306123233.GA9972@gmail.com> <1425662342.19505.41.camel@stgolabs.net> <1425668223.2475.94.camel@j-VirtualBox> <1425670188.2475.113.camel@j-VirtualBox> <1425676346.2475.135.camel@j-VirtualBox> <1425680137.19505.63.camel@stgolabs.net> <20150307095526.5ffb1bf0@tom-ThinkPad-T410> <1425694046.19505.71.camel@stgolabs.net> <1425695184.19505.79.camel@stgolabs.net> <1425695363.19505.81.camel@stgolabs.net> <1425697805.19505.92.camel@stgolabs.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.9 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2015-03-07 at 11:19 +0800, Ming Lei wrote: > On Sat, Mar 7, 2015 at 11:10 AM, Davidlohr Bueso wrote: > > On Sat, 2015-03-07 at 10:55 +0800, Ming Lei wrote: > >> On Sat, Mar 7, 2015 at 10:29 AM, Davidlohr Bueso wrote: > >> > On Fri, 2015-03-06 at 18:26 -0800, Davidlohr Bueso wrote: > >> >> That's not what this is about. New lock _owners_ need to worry about > >> > ^^^ make that "need not" > >> > >> Sorry, could you explain a bit why new owner can't be scheduled > >> out(on_cpu becomes zero)? If that is possible, it still can cause > >> soft lockup like current problem. > > > > Oh its not that it can't be scheduled out. The point is we don't care > > what happens with the lock owner itself (new or not). We care about, and > > the point of this discussion, how _other_ threads handle themselves when > > trying to take that lock (a lock having an owner implies the lock is not > > free, of course). So if a lock owner gets scheduled out... so what? > > That's already taken into account by spinners. > > Not exactly, current problem is just in spinner because it > ignores scheduled out owner and continues to spin, then > cause lockup, isn't it? Exactly my point, Ming. It's the _spinner_ that has the problem, hence the fix in the part of the code that must decide just that. By the time we're doing this: if (READ_ONCE(sem->owner)) return true; /* new owner, continue spinning */ We need to have already taken into account the owner->on_cpu situation. We fix spinners, not lock owners. I'm really running out of ways to explain this, and you are going in circles, which is getting annoying given that you haven't even tried the other patch.