Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3772877ybl; Tue, 21 Jan 2020 06:49:22 -0800 (PST) X-Google-Smtp-Source: APXvYqz3svItXz8/ItFBqTVdPJhaxbS9ogCQWwubsgV5oM6/vy8CPoLx3Ym9v7XRrJyJXJ3Uh9MB X-Received: by 2002:a05:6808:618:: with SMTP id y24mr3132434oih.86.1579618162268; Tue, 21 Jan 2020 06:49:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579618162; cv=none; d=google.com; s=arc-20160816; b=WzKl8dAB1a+4B45LFyvzEKgGSgEM4/c5EaQynLHRyIXqGUicb7+/8iApKsZxmaGc86 4iTj0hH6TBdRqYfHyY3/HDqGerx/eKBT0JHUA2dJF4SEoeNPqVGJttk0Mz9DcsXjRwe4 Gh90DYVUzTnknd12SBttuQpqImUiJT7g3bV2VmgZEl6P/xiVy9RerGiEmX81UNiGSTYH fO9XZV1GRcDlSnh7L1TjRTJxCuSJ0/Tc93FxpoPw+EtuLjBQeZFwmAHKcU7q/swvDZhq LzIcLKVh5M5Fnsxy0lhaXHzrKYPrrv1eCsTyPVNDaIchScAGIpCkix+xesWFqw0yojgd PAFA== 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=uyryvzrOJVnY2Rp4qJ6rxjhfB8x1mJVRx6ecxsTZGfA=; b=excjfY4KyWl41B7UR0XygAh4meSV23tLhWO4aBPtA5QQwGEtu9qLKqmMxSXmuZh+5A 06YxPaUnHjXJqlxijvQRVHKW9/W7jAz7wGhieyaEDJ6i48STm82NQYhwDka2lGvizL1H iXTrmMjDeSpyCG8F8IRZW7iEIf6vWZ65s49+WAArnjyy1APNLem09C2BFK0SAH+jl6Na EJL8f5KFxYLzKTM5NXkjOxoqo2sLddzyASleq9+8NlD7987uvJA5w+gWyx6ruRTd0DQ0 c6aum3i4TxbznzPQKDhUYpn7XVTAEIIIyfGrvFuiBt8gH/tAHar4MV6Q9GUz1YCFNWJ+ RV/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=bwKVHF7s; 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 j16si19356460oii.57.2020.01.21.06.49.10; Tue, 21 Jan 2020 06:49: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=merlin.20170209 header.b=bwKVHF7s; 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 S1729152AbgAUOsP (ORCPT + 99 others); Tue, 21 Jan 2020 09:48:15 -0500 Received: from merlin.infradead.org ([205.233.59.134]:44236 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726968AbgAUOsP (ORCPT ); Tue, 21 Jan 2020 09:48:15 -0500 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: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=uyryvzrOJVnY2Rp4qJ6rxjhfB8x1mJVRx6ecxsTZGfA=; b=bwKVHF7soQKI2IrooaVefjguG fiAGC74P3bvssr0+css1C8EDCghS7r8UidTgSfsCcsr7l9MJtQOBGEztGXa+draot+IJe1QsvNUWm ooyuPGZu7ltO1acjhyi9PTgOZgKMhjfDCTAsoatpnl18p88qhPu6Jw06F9KBUyv45wlBW4yWwNqwf qQUW6g192epkfBVw2EcZj1iaUt2shzGMxi7C4M24doGP/9t+u8zmdVnImpXEgvqjV/4AzBqRIpC5v /cN7vv8avgOlqsmMtRk9CNvAThOodw2QTHJ0HW3GkIngZk5JmjpHEyfUwikqFK1R7crtZdrOPJlKM 5nYFbT79Q==; 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 1ituoJ-0007N0-GP; Tue, 21 Jan 2020 14:47:19 +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 1CE8E30067C; Tue, 21 Jan 2020 15:45:37 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 35E7C20983E32; Tue, 21 Jan 2020 15:47:16 +0100 (CET) Date: Tue, 21 Jan 2020 15:47:16 +0100 From: Peter Zijlstra To: "Paul E. McKenney" Cc: Marco Elver , andreyknvl@google.com, glider@google.com, dvyukov@google.com, kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, mark.rutland@arm.com, will@kernel.org, boqun.feng@gmail.com, arnd@arndb.de, viro@zeniv.linux.org.uk, christophe.leroy@c-s.fr, dja@axtens.net, mpe@ellerman.id.au, rostedt@goodmis.org, mhiramat@kernel.org, mingo@kernel.org, christian.brauner@ubuntu.com, daniel@iogearbox.net, cyphar@cyphar.com, keescook@chromium.org, linux-arch@vger.kernel.org Subject: Re: [PATCH 3/5] asm-generic, kcsan: Add KCSAN instrumentation for bitops Message-ID: <20200121144716.GQ14879@hirez.programming.kicks-ass.net> References: <20200120141927.114373-1-elver@google.com> <20200120141927.114373-3-elver@google.com> <20200120144048.GB14914@hirez.programming.kicks-ass.net> <20200120162725.GE2935@paulmck-ThinkPad-P72> <20200120165223.GC14914@hirez.programming.kicks-ass.net> <20200120202359.GF2935@paulmck-ThinkPad-P72> <20200121091501.GF14914@hirez.programming.kicks-ass.net> <20200121142109.GQ2935@paulmck-ThinkPad-P72> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200121142109.GQ2935@paulmck-ThinkPad-P72> 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 Tue, Jan 21, 2020 at 06:21:09AM -0800, Paul E. McKenney wrote: > On Tue, Jan 21, 2020 at 10:15:01AM +0100, Peter Zijlstra wrote: > > On Mon, Jan 20, 2020 at 12:23:59PM -0800, Paul E. McKenney wrote: > > > We also don't have __atomic_read() and __atomic_set(), yet atomic_read() > > > and atomic_set() are considered to be non-racy, right? > > > > What is racy? :-) You can make data races with atomic_{read,set}() just > > fine. > > Like "fairness", lots of definitions of "racy". ;-) > > > Anyway, traditionally we call the read-modify-write stuff atomic, not > > the trivial load-store stuff. The only reason we care about the > > load-store stuff in the first place is because C compilers are shit. > > > > atomic_read() / test_bit() are just a load, all we need is the C > > compiler not to be an ass and split it. Yes, we've invented the term > > single-copy atomicity for that, but that doesn't make it more or less of > > a load. > > > > And exactly because it is just a load, there is no __test_bit(), which > > would be the exact same load. > > Very good! Shouldn't KCSAN then define test_bit() as non-racy just as > for atomic_read()? Sure it does; but my comment was aimed at the gripe that test_bit() lives in the non-atomic bitops header. That is arguably entirely correct.