Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1774069ybl; Thu, 30 Jan 2020 05:50:22 -0800 (PST) X-Google-Smtp-Source: APXvYqw2hMX9ChbcOK1Sx9jX6NumPK+pQLTLHWOjF92VExqwKqnqEnc2PDvPQpVKUF9bYbijialp X-Received: by 2002:a9d:4f15:: with SMTP id d21mr3531562otl.253.1580392222243; Thu, 30 Jan 2020 05:50:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580392222; cv=none; d=google.com; s=arc-20160816; b=TFOnNBgCMpwk+k4n6AkvMgbd+uEqEvwBnvRaeaOAWAH+l1nsy77VKKL0jKkuSXjKkd RLcIDm4DtX2FWSb4rJRmXi+197So8uncAd8n7diSjbqWQKPrepaYa+v6vXC0HiUrtP6b GJNzpsr+yIPwkqBMQ54XEYmUOIzNyG9KQLLNL0grDFtxp/lLULpd5ZIMmpI3Ga5M1LEv C+xXnW1LZ0c72lVudEGCJp3ElCu35DeVfzxu0kjc3EzqdXtayxlmZ0LRsuG9eI3Y9M6M vamW851h4GV5aQRvfB2KWVs7tWCoTK9M+9Nesao4g0eAjivzj6bMJgPD/i7BEzWNn7cZ c4YA== 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=KWeJ60yy7ZEEaAUYkcnvwcBr+M2J16KKlBnyHKEQ2N0=; b=Q7CjI8+8lecFwEsrfvFe6U6RQ5q7uW9ZNkaUxc61HFqqR4r3cCEMFDsL+/3wN08rfZ YoGvSeGJWW+sZZWzkVpOlv4AwljgR3GcHyM8rSt2xtCUqcrp+Mtq5R/8ib8mVK06fVb/ xqlxC0W+/UHaZaLwDj1n+uurdsyH0tVY+zicPs8e7V0gmaF0BOZiTXrp9fECKwCCXHfL LQTNWdlVJ6xIWGb+ZbrsF4/WaBNjI5Z6OfNkL/q9hA2j/Cch7VVGU1y6cGYZmttGiWsd ExEoQ//C+t7kVJW4lmPCF5zhOCSvqluj68An+yTw4YD04DRp/5FRLnMS3GFdzG3d3KGC amsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=QQ+WNZuW; 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 y18si2989394oix.27.2020.01.30.05.50.09; Thu, 30 Jan 2020 05:50:22 -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=QQ+WNZuW; 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 S1727431AbgA3Ns6 (ORCPT + 99 others); Thu, 30 Jan 2020 08:48:58 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:35708 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727107AbgA3Ns6 (ORCPT ); Thu, 30 Jan 2020 08:48:58 -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=KWeJ60yy7ZEEaAUYkcnvwcBr+M2J16KKlBnyHKEQ2N0=; b=QQ+WNZuW3RFOQGsjn5mwpYQ+b e1psPbIVvHVIMA2GEkO3sYhH+MPRKGTUCQsNxC0lOi+rlvWpKtCj8cxd7A3KBExRFrlM/unRp2VzC 5iNdG0OjFxVwQHVkNWub1088RIwgYdKyrW9oecGEEGQ3Tp5BYIETHz9mcRrl9HLDYpVmMlNZUore+ m/4YLOa9LK+z6F5q0pzF246neVoRTqud1dNCzUSwnvcRhXVehAj0tmUAh+lyiaAjln+UIhvSnvHTz 5aMu0yRhDHaGE3F88xvHOhxDDte3t8y5VZlY013nJrJseS8KhvFJ0swhWaN/r/NK6kkHlS92thMEU SbrBvi/0g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1ixABh-0001R1-T0; Thu, 30 Jan 2020 13:48:54 +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 6EA86304BDF; Thu, 30 Jan 2020 14:47:08 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id AE96120147130; Thu, 30 Jan 2020 14:48:51 +0100 (CET) Date: Thu, 30 Jan 2020 14:48:51 +0100 From: Peter Zijlstra To: Marco Elver Cc: "Paul E. McKenney" , Qian Cai , Will Deacon , Ingo Molnar , Linux Kernel Mailing List , kasan-dev Subject: Re: [PATCH] locking/osq_lock: fix a data race in osq_wait_next Message-ID: <20200130134851.GY14914@hirez.programming.kicks-ass.net> References: <20200122223851.GA45602@google.com> <20200123093905.GU14914@hirez.programming.kicks-ass.net> <20200128165655.GM14914@hirez.programming.kicks-ass.net> <20200129002253.GT2935@paulmck-ThinkPad-P72> <20200129184024.GT14879@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Thu, Jan 30, 2020 at 02:39:38PM +0100, Marco Elver wrote: > On Wed, 29 Jan 2020 at 19:40, Peter Zijlstra wrote: > > It's probably not terrible to put a READ_ONCE() there; we just need to > > make sure the compiler doesn't do something stupid (it is known to do > > stupid when 'volatile' is present). > > Maybe we need to optimize READ_ONCE(). I think recent compilers have gotten better at volatile. In part because of our complaints. > 'if (data_race(..))' would also work here and has no cost. Right, that might be the best option.