Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2244883yba; Thu, 25 Apr 2019 13:05:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqDTeF+OkD15oTsN1ucyUSvtMiViGxC+/1S6LBQhRwjSN3vM/a8Sc6NN0psz197pUt1vrA X-Received: by 2002:aa7:92d5:: with SMTP id k21mr42265853pfa.223.1556222719410; Thu, 25 Apr 2019 13:05:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556222719; cv=none; d=google.com; s=arc-20160816; b=F7L44SdZgE/Njos+UQZ82ch26txzsh1t/cIkHJJNIZMucr+V178mn89LZBFaFKBqjD ZMVr3HEQ1+ZCASBsNcSDebQtTgOEFD4f0V54FF8vUUpbdfuAKLiE51V98p0VGzOx2BLF FSNFNa4kCqSnqBf6ejbTSKz9NfW0JBB6Drr/PFntZJZvaqYlfWnja7C6/c76NXtFC1TS Ack5bpZ4a0Nsao/6tgNR4SAjSJHdvtdZpkmBicYhxc8jo/lxBZKnMYucw/3eXwPHYwLl rqQ0OP8nPoOIfAXHFmhvzzrvKglE0jJzGleUKopwliTuf1AtRDXIYT4Iun2f8cQkSy/K hfEg== 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; bh=OXcAVsdqOGUXkbYQOEo7XQ6GAUCp7NVsTJfv5Z9H1oE=; b=UfYPQJmK7KGG5QtOym0nGBDo+extWFYccZee0/COyIsV1xehR7jL6ikpc48IMjdZNY ANN24CC+33M6ZSr7jg0V2cx7yQLcR4EzzuHQDk4fpCsEpFhymFLH3yjI1hyn4ShulLcE PTNJaRXgIPFLahTgwDp5k6nLER6FpCenu1DO10p3I4pLRPb25BdokKVLh3nfestPX+IN bp0dzXwjShzpkUfbJKQPt+/jH0b4Lev0VD6HEQ6wdSRF0tlieFHfrQfy8K9uSp0H3Ct2 MbF2xuXXw7HCRBmr5488eIBLZhG+SpUT0uOeHfRRvRi7i3Sfi6zeeoSi+3ksWUhhzpt4 X/hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=pGEkRoLH; 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 q137si21724948pgq.58.2019.04.25.13.05.03; Thu, 25 Apr 2019 13:05:19 -0700 (PDT) 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=pGEkRoLH; 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 S1730874AbfDYUDn (ORCPT + 99 others); Thu, 25 Apr 2019 16:03:43 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:51760 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727873AbfDYUDm (ORCPT ); Thu, 25 Apr 2019 16:03:42 -0400 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=OXcAVsdqOGUXkbYQOEo7XQ6GAUCp7NVsTJfv5Z9H1oE=; b=pGEkRoLHHf7WCOTpebU1p5Tkb fQg5VvGVH6d7flq0ybt9WkZLhw/HaQlJ35a3WedPfxTZJe6y3NzszxcRmVJPB/DaWHxcxKcm6pCw9 rFtH75r1jeKPenS440w/KA19A/e8V1lEwZcviJwxMxzZtvRLFr9+9YxzvwYlVf41mqM7ihCibI5U0 2UkBSeODIl8H6rYbsaYJ6OOwrrO8VUPbh59bz0ZOvTb1+HgeCQkariuYtauik9VMKGfyqBJB3DNc2 AhwMXEzjkjvn7H5Uvap0N1IRdhU2+QIjbOnC/cJj211AWRQ1B39ztLNKlgAcTM/09dCAINhVUPjEB pzhwdMbYw==; 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.90_1 #2 (Red Hat Linux)) id 1hJkao-0001r0-4d; Thu, 25 Apr 2019 20:03:38 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 9DF3F29CB5DC9; Thu, 25 Apr 2019 22:03:36 +0200 (CEST) Date: Thu, 25 Apr 2019 22:03:36 +0200 From: Peter Zijlstra To: Yuyang Du Cc: will.deacon@arm.com, mingo@kernel.org, bvanassche@acm.org, ming.lei@redhat.com, frederic@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, Boqun Feng Subject: Re: [PATCH 24/28] locking/lockdep: Remove !dir in lock irq usage check Message-ID: <20190425200336.GY12232@hirez.programming.kicks-ass.net> References: <20190424101934.51535-1-duyuyang@gmail.com> <20190424101934.51535-25-duyuyang@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190424101934.51535-25-duyuyang@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 24, 2019 at 06:19:30PM +0800, Yuyang Du wrote: > In mark_lock_irq(), the following checks are performed: > > ---------------------------------- > | -> | unsafe | read unsafe | > |----------------------------------| > | safe | F B | F* B* | > |----------------------------------| > | read safe | F? B* | - | > ---------------------------------- > > Where: > F: check_usage_forwards > B: check_usage_backwards > *: check enabled by STRICT_READ_CHECKS > ?: check enabled by the !dir condition > > From checking point of view, the special F? case does not make sense, > whereas it perhaps is made for peroformance concern. As later patch will > address this issue, remove this exception, which makes the checks > consistent later. > > With STRICT_READ_CHECKS = 1 which is default, there is no functional > change. Oh man.. thinking required and it is way late.. anyway this whole read stuff made me remember we had a patch set on readlocks last year. https://lkml.kernel.org/r/20180411135110.9217-1-boqun.feng@gmail.com I remember reviewing that a few times and then it dropped on the floor, probably because Spectre crap or something sucked up all my time again :/ Sorry Boqun!