From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762100AbYD2Rp5 (ORCPT ); Tue, 29 Apr 2008 13:45:57 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755497AbYD2Rpq (ORCPT ); Tue, 29 Apr 2008 13:45:46 -0400 Received: from fg-out-1718.google.com ([72.14.220.156]:28013 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755366AbYD2Rpp (ORCPT ); Tue, 29 Apr 2008 13:45:45 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Jggme9kVaozXqoYI+p+VgQD3ZXRftClBdJaLUIkvmzfuJ1oxyEaNmjLBIYpiOBjMg1JSGzFs3wTlIaPMuDjfTbfeEdBKkPEI4xz37gbL0fdtTOUIueQpnK1ktSkGtgxKEokgwIY5eBYzOerJzw6MYrbjRgMkI4CVbXWtXHLJBrY= Message-ID: Date: Tue, 29 Apr 2008 19:45:43 +0200 From: "Bart Van Assche" To: "Peter Zijlstra" Subject: Re: [PATCH 1/8] lockdep: fix recursive read lock validation Cc: ego@in.ibm.com, linux-kernel@vger.kernel.org, "Zdenek Kabelac" , "Oleg Nesterov" , "Heiko Carstens" , "Rafael J. Wysocki" , "Andrew Morton" , "Ingo Molnar" , "Srivatsa Vaddagiri" In-Reply-To: <1209488643.6433.14.camel@lappy> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080429125659.GA23562@in.ibm.com> <20080429125750.GB23562@in.ibm.com> <1209481050.13978.72.camel@twins> <1209482101.13978.91.camel@twins> <1209485739.13978.96.camel@twins> <1209488643.6433.14.camel@lappy> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 29, 2008 at 7:04 PM, Peter Zijlstra wrote: > > I think the critical part is: > > > It really is invalid when considered against write locks. > > Aside from that it just states that inversion of lock order will be > treated as invalid - even for read locks. Inversion of recursive reader locks can't trigger a deadlock, even when considered against write locks, as long as the rules are followed I posted earlier. I invite anyone to come up with an example that proves me wrong. Let's return to the starting point of this discussion. The patch at the start of this thread forbids to invert the lock order of reader locks. Why to forbid this if it can't trigger a deadlock ? At least in user space code, it's quite easy to trigger such inversion. In sufficiently complex code where functions call other functions while holding a reader lock, reader lock inversion can be hard to avoid. Bart.