From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756139Ab1FGOkw (ORCPT ); Tue, 7 Jun 2011 10:40:52 -0400 Received: from casper.infradead.org ([85.118.1.10]:56868 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754972Ab1FGOkv convert rfc822-to-8bit (ORCPT ); Tue, 7 Jun 2011 10:40:51 -0400 Subject: Re: [PATCH] sched: correct testing need_resched in mutex_spin_on_owner() From: Peter Zijlstra To: Hillf Danton Cc: LKML , Ingo Molnar In-Reply-To: References: <1307454439.2322.260.camel@twins> <1307456680.2322.270.camel@twins> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Date: Tue, 07 Jun 2011 16:40:46 +0200 Message-ID: <1307457646.2322.273.camel@twins> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2011-06-07 at 22:36 +0800, Hillf Danton wrote: > If you are right, the following comment also in __mutex_lock_common() > > for (;;) { > struct task_struct *owner; > > /* > * If there's an owner, wait for it to either > * release the lock or go to sleep. > */ > owner = ACCESS_ONCE(lock->owner); > if (owner && !mutex_spin_on_owner(lock, owner)) > break; > > looks misleading too, but if owner is on this CPU, for what does we wait? huh, wtf!? it cannot be on this cpu, if it was we wouldn't be running the above code but whatever owner was doing. So my argument was, it cannot be on this cpu, therefore, by checking it is on a cpu, we check its on a different cpu. And I really don't see how any of that is related to the above.