Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4170681pxb; Tue, 10 Nov 2020 09:31:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJyEQ1EeKeR21FF8N3McG+bxcocVinYlzGFzk5EXuViQsgoVyK8DszdQ2pbsVo+k/1LENhRT X-Received: by 2002:aa7:d4c9:: with SMTP id t9mr435873edr.313.1605029497017; Tue, 10 Nov 2020 09:31:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605029497; cv=none; d=google.com; s=arc-20160816; b=wJ7A4sx/ZVbetAQHoa8DkWCHw2F8zTr5+OgfCMTH4pMlJeiELBX8b4CvGEY7AKCOKn mUyma22wzk4nZftaaAkzqA6z+k6Cl0tRMF6B/1WCKU/Iz32ZZFl8mD5tegcQ/mRVqHkI c+POp0Foyj+BaVx80OuawOWDs7AyXvtLL1k+5Kd28hRb25PK3lqRWhe4SQehbemVkQQ1 zMwCXMDWN+eIlb1NViXtJvhwmT2rQq+ZZl9BVGHJ/YJwoh4Pe9Ex8Enb5nVauiokzs35 1ARS+vfbDghxXej/xYFaH+mScqITimot6H0ZE1OdmCgnV1jU2YOTyLm692zM5PbsFTuA /kkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=HmUTZYGrR/d2vlH5DfUaqIdhg5JyXUfN+e9H+G1so7Y=; b=uWPVbHhTcKNHq6/wIValOJRYw7Ev4J6pmmrGjBgw2ppTlBt03P2HPw/RsZbr0dmBRR rZGgXq6Oo8dFdgjXeC9LOEs0mHupMf3+TnuHEzdBTamgQYqPCrmtcN4XKsv1ITK+3tXq Lep8SjeEDbjkMZodZUcb5gvy2UFt98Ks5JQfY6DWA04CHRLyh77B/JcWWAPy2POZ8Xf8 NXytZTa2NxXfdO3L8WcakgF0DQRsclb3aNwwEd+ePnmkqn32r2g1ra7plWaeoRFYn2C/ STs4+OPPDYgj15zBmVmEBGUlc25dakJ4Ezn/xkws5fWCZS69UZh/1ITDCIv5qa9EJ9Fl LIPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b="O87/okRK"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l26si9582848ejq.557.2020.11.10.09.31.12; Tue, 10 Nov 2020 09:31:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b="O87/okRK"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730975AbgKJR2v (ORCPT + 99 others); Tue, 10 Nov 2020 12:28:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726307AbgKJR2v (ORCPT ); Tue, 10 Nov 2020 12:28:51 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1509C0613CF; Tue, 10 Nov 2020 09:28:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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; bh=HmUTZYGrR/d2vlH5DfUaqIdhg5JyXUfN+e9H+G1so7Y=; b=O87/okRKGoZqB8rEmfQg1N2Uvz I+k/a0S4IlQ43WJzql61DHZINpXV7IIlx9xTCeYi3oXgjo6zEIf06fAeNzq2xA3D9OfYiMP76jHEw GXCxHDzGv9/LvXcpjyW+BNmG0bVR5J2dPjOUI830ML9/jjYd1QInxu0hdfSxt1IxiXepEWF0ilb+4 2UFdMrHOE5TUtzJXIEx42UDI0cButAh7BzuMs3/oMnrw9CTNxqdhr9PUGmSfweambA6tYKJP4EcFc 3ffFoepILDPSRIVy2Lon0YFU9YAcpteJUERKnagI2eQ5gKkGE50uoZf71zvtMqnqUwL8+GqepMy4f 0UCNw2xA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcXRh-0004MV-T1; Tue, 10 Nov 2020 17:28:42 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id E6FCD307197; Tue, 10 Nov 2020 18:28:38 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C14142BDD3947; Tue, 10 Nov 2020 18:28:38 +0100 (CET) Date: Tue, 10 Nov 2020 18:28:38 +0100 From: Peter Zijlstra To: Boqun Feng Cc: linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org, Qian Cai , Chris Wilson , Ingo Molnar , Will Deacon Subject: Re: [PATCH 1/2] lockdep: Avoid to modify chain keys in validate_chain() Message-ID: <20201110172838.GP2594@hirez.programming.kicks-ass.net> References: <20201030093806.GA2628@hirez.programming.kicks-ass.net> <20201102053743.450459-1-boqun.feng@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201102053743.450459-1-boqun.feng@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 02, 2020 at 01:37:41PM +0800, Boqun Feng wrote: > Chris Wilson reported a problem spotted by check_chain_key(): a chain > key got changed in validate_chain() because we modify the ->read in > validate_chain() to skip checks for dependency adding, and ->read is > taken into calculation for chain key since commit f611e8cf98ec > ("lockdep: Take read/write status in consideration when generate > chainkey"). > > Fix this by avoiding to modify ->read in validate_chain() based on two > facts: a) since we now support recursive read lock detection, there is > no need to skip checks for dependency adding for recursive readers, b) > since we have a), there is only one case left (nest_lock) where we want > to skip checks in validate_chain(), we simply remove the modification > for ->read and rely on the return value of check_deadlock() to skip the > dependency adding. > > Reported-by: Chris Wilson > Signed-off-by: Boqun Feng > Cc: Peter Zijlstra Thanks Boqun!