Received: by 10.223.185.116 with SMTP id b49csp2014265wrg; Thu, 22 Feb 2018 06:55:54 -0800 (PST) X-Google-Smtp-Source: AH8x2245jPnn3naoL5pX2UmGVPH2kUfbsYdy7OptdxVIQuCF5OvN64pqWxW1JEmVtGjDj+O4F5et X-Received: by 10.99.51.77 with SMTP id z74mr6033252pgz.120.1519311354698; Thu, 22 Feb 2018 06:55:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519311354; cv=none; d=google.com; s=arc-20160816; b=pWrzoF5CFgYOgmQOZgIJ0HUPLa7DcBD0Hzxosf1mhiL5qf2vujyv/EWw2UuTwyrNYL Lhi1nsCS6sBGATh+ERZyCXtkePHw0WhRPJbv8urQEt/Z65ktQzGd3or7RFW83fVnCSAD z/I62Qr7C15J9YJK0chwBR+KopEmt7VH7jyWE8MTc0N00NaVEIhwhZIXBRUBH6XKp/tv IbdrP7ngtfDX8/3M/0Ycrs1XuQEqq66S2lX5v45npOClRC1ICCxO+KW5t9NBnoKWKSY0 +1XXf76XJnE7iHOiO+riBlok5tgP0o5UWD5toLSYqGYlM/092cQ+RPIS7cbjijITNNbz 9K4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=D5cin+La4HPwwoCSHLc/B1vjdAtF0guUzJ3fKWz9qRM=; b=x3+RA6TmeOi0tk5F9lYxi8rZzS5owAtlBcIs/vmzZ4JnBk+WS3DgxuHCOWWOHiBV5h T2vd/LXXtNyYCGeVBkAGWqYcyGJNmX93Cy0aizFMaFzn5niXUupnp6MrnLHtsrwAafAD dOUIhIOH1qwaxJSej3QccPk/QIhtkAXFgDB/eW40Hyu11nejREef1Kz8ig4wwCJYK4gP GwviHkKzTw+XqocnzqAn3vMjaLqzSTOVdFfkvUdRgKUoUf8mNoX4rXjkF6txeJ647esk cmMGiRmpHR4Sk9c+YOd+QdM25maWPvM+VJO6cWQDyaqxDMFA1OCnm/A2XuO9CbTIG6eQ 6Iig== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=OZxrk6+e; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k185si78841pgd.533.2018.02.22.06.55.37; Thu, 22 Feb 2018 06:55:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=OZxrk6+e; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753891AbeBVOyk (ORCPT + 99 others); Thu, 22 Feb 2018 09:54:40 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:37514 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753805AbeBVOyh (ORCPT ); Thu, 22 Feb 2018 09:54:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=D5cin+La4HPwwoCSHLc/B1vjdAtF0guUzJ3fKWz9qRM=; b=OZxrk6+eZ/cAifz+YuQACdoFq p3aIfcRoRN3or3XOfg9rx2hkqCmor74NkGl9/oRa6h7hM0pw7GKinEtssJRXIQkubqqCOvJ17Mrxl yBwyKUEfg65nnnJ3l7A71EyqdUO5mpA2X9oo8A1PbtTNxCwLCraU8Udk+su9+iJNPqn+S5BCBDWdo 84cKRjHklx0ikzsEWKDYBgSdqFEgIKUIXU0AQspmgjr/4DkeS/SBZc9n2s1RjfdwRYgyz6ihSLAOW sY/9YGWxp5hC+fyYFCh6n2+deUHkB6QHPGtlS6tNMD5E0rknN+45vRax8HeQYUUFB0Gv3hm5fi7UK N/Wd/32TA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1eosGZ-0000dI-U6; Thu, 22 Feb 2018 14:54:36 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 3A2312029F9F9; Thu, 22 Feb 2018 15:54:34 +0100 (CET) Date: Thu, 22 Feb 2018 15:54:34 +0100 From: Peter Zijlstra To: Boqun Feng Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Andrea Parri Subject: Re: [RFC tip/locking/lockdep v5 06/17] lockdep: Support deadlock detection for recursive read in check_noncircular() Message-ID: <20180222145434.GS25201@hirez.programming.kicks-ass.net> References: <20180222070904.548-1-boqun.feng@gmail.com> <20180222070904.548-7-boqun.feng@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180222070904.548-7-boqun.feng@gmail.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 22, 2018 at 03:08:53PM +0800, Boqun Feng wrote: > +static inline int hlock_conflict(struct lock_list *entry, void *data) > +{ > + struct held_lock *hlock = (struct held_lock *)data; > + > + return hlock_class(hlock) == entry->class && > + (hlock->read != 2 || !entry->is_rr); > +} Bah, brain hurts. So before we add prev -> this, relation, we check if there's a this -> prev relation already in the graph -- if so that would be a problem. The above function has @data == @prev (__bfs_forward starts at @this, looking for @prev), and the above patch augments the 'class_equal' test with @prev not having read==2 or @entry not having xr; This is because.... (insert brain hurt)