Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3857529ybl; Tue, 21 Jan 2020 08:17:57 -0800 (PST) X-Google-Smtp-Source: APXvYqwZFtS6TZOHBsKsV1E2pKK0YtjQ0O/yX9gYWIvy8+eZxoMtJqLWzsm4KM1G5O5ApSZ5blGk X-Received: by 2002:aca:4ec3:: with SMTP id c186mr3497125oib.53.1579623477695; Tue, 21 Jan 2020 08:17:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579623477; cv=none; d=google.com; s=arc-20160816; b=fSdSy24rwPh1hjgT197WlUzQkK+SOUVQxuDo0UEG6vCLlrKDDQGchE8jFgrjQENZC7 EvPmvf0le15K06TQwk1PgA54FR5U4lD/BwPybv6Fi93EV5ZYd/CHP1z4uLG3spYNZSFS PYqA59tbFOoEX1/44KY+2KamZMPYkDS66UP0eoWzLkTvRn9pcULCDopVp/MY631TauVd EcwJAyc6AtTI109kRUxfZclxQ4K0YJWTEP5Kt73bvV28EJlfo53Cenw78QrdIPEGjgTs znx/cByGYUsUIyP9CR9uWvwBUnv3WasVFxaGfZHFLhOqU+z9CDXN+E/yYQB4JdS48M5n T/5Q== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=HwQDf2Hnv36KRq5wQ9NdwNzTgHjSiYTn6/ev9AQDDQA=; b=BgxxurHQcM/NxgYxrj/8VoPOQoydlieUvSncJb9EqE7rpM5C7p8c/J5oa1gXKmpGlT YJxh7Rly8QCAXIL5xtF8VtLPK3X8h7SMyd0gj4WPSUeR8J5CCzMQfNN6iDL4n3bt1mgr 4APUfYHEodX+BF0fXxY0V6gXcay50g/WMp1WVda977/kTOGpRBU0z3rHldvNOaEY0GoP 8+0U1dq2CfMktLBs6rKE3SI3RkcAib57s1Ko7VimAgwXc2V4IrFWIEP+MfiPkVZzLSyg 9Zoks8j3PpL6vA6MhrDSEs4msVZZFC4mashaO9ZUZgn8x0NGHsd5+ese87HKt36hHMae SgZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Il7G75GL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1si22030214otp.70.2020.01.21.08.17.45; Tue, 21 Jan 2020 08:17:57 -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=pass header.i=@kernel.org header.s=default header.b=Il7G75GL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729162AbgAUQQd (ORCPT + 99 others); Tue, 21 Jan 2020 11:16:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:48542 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726555AbgAUQQd (ORCPT ); Tue, 21 Jan 2020 11:16:33 -0500 Received: from paulmck-ThinkPad-P72.home (50-39-105-78.bvtn.or.frontiernet.net [50.39.105.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CCD43217F4; Tue, 21 Jan 2020 16:16:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579623392; bh=QeSKKD6PfrbbZOwfYV8hICQ+MCLi4jauPz7wyQelez8=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=Il7G75GLGL9BYlH35+SMX/L6VBP/oLIMGiRkoA99QP49hy6FgnqV7/3fGSwKEVz4T gn7tnHJmIaly9Ua5+BSqlpRJS3e3S/uyuC7G8BCbJK2VPnaKShgTYsuAONkYPko1Ix 94CNdGU/2JGEwDWIXc+3suGyu7MgSWaUF5YA8XuI= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id A677E3520DC0; Tue, 21 Jan 2020 08:16:32 -0800 (PST) Date: Tue, 21 Jan 2020 08:16:32 -0800 From: "Paul E. McKenney" To: Peter Zijlstra 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: <20200121161632.GV2935@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org 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> <20200121144716.GQ14879@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200121144716.GQ14879@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.9.4 (2018-02-28) 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 03:47:16PM +0100, Peter Zijlstra wrote: > 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. Fair enough! Thanx, Paul