Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755468Ab3C2J6C (ORCPT ); Fri, 29 Mar 2013 05:58:02 -0400 Received: from merlin.infradead.org ([205.233.59.134]:57769 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752165Ab3C2J6A (ORCPT ); Fri, 29 Mar 2013 05:58:00 -0400 Message-ID: <1364551075.5053.82.camel@laptop> Subject: Re: [PATCH v2 -mm -next] ipc,sem: fix lockdep false positive From: Peter Zijlstra To: Michel Lespinasse Cc: Rik van Riel , Sasha Levin , torvalds@linux-foundation.org, davidlohr.bueso@hp.com, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, hhuang@redhat.com, jason.low2@hp.com, lwoodman@redhat.com, chegu_vinod@hp.com, Dave Jones , benisty.e@gmail.com, Ingo Molnar Date: Fri, 29 Mar 2013 10:57:55 +0100 In-Reply-To: References: <1363809337-29718-1-git-send-email-riel@surriel.com> <5150B1C2.8090607@oracle.com> <20130325163844.042a45ba@annuminas.surriel.com> <1364303965.5053.29.camel@laptop> <1364308023.5053.40.camel@laptop> <5151BC78.3030306@surriel.com> <1364373750.5053.54.camel@laptop> <20130328162337.3003ccd4@cuia.bos.redhat.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.6.2-0ubuntu0.1 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 Content-Length: 1216 Lines: 26 On Thu, 2013-03-28 at 19:50 -0700, Michel Lespinasse wrote: > So, there are a few things I don't like about spin_unlock_wait(): > > 1- From a lock ordering point of view, it is strictly equivalent to > taking the lock and then releasing it - and yet, lockdep won't catch > any deadlocks that involve spin_unlock_wait. (Not your fault here, > this should be fixed as a separate change in lockdep. I manually > looked at the lock ordering here and found it safe). Ooh, I never noticed that, but indeed this shouldn't be hard to cure. > 2- With the current ticket lock implementation, a stream of lockers > can starve spin_unlock_wait() forever. Once again, not your fault and > I suspect this could be fixed - I expect spin_unlock_wait() callers > actually only want to know that the lock has been passed on, not that > it actually got to an unlocked state. I suppose the question is do we want to fix it or have both semantics and use lock+unlock where appropriate. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/