Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3969833ybl; Mon, 3 Feb 2020 10:00:00 -0800 (PST) X-Google-Smtp-Source: APXvYqw721oSA4Tk21Ks6G8wXa8cuRrHWZt6kvudU+PnfPWjOQerHRwtViWop62S03s/idZTGNcc X-Received: by 2002:a05:6830:1691:: with SMTP id k17mr19390628otr.282.1580752800373; Mon, 03 Feb 2020 10:00:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580752800; cv=none; d=google.com; s=arc-20160816; b=T9aXd80JpEPQNZ444r1ZZDKiMT8H0lELiEzAxbqTIx0eP4HYl3/Uc6dJkZTTSI/UrJ kxAaC+X1nJSL/ve6bUsOtjiyZXTmi39oTumYmbTaoMkjCC5h8gHjLHD/rmxu0IEe1g4i e41P0r56zsCCYSUC0kV4+tZ4hEntlYjMq8rEPYF+TTAS04MuWCiscRJt1HlWp2kmHII6 X/cueozzwB6dQVHCF33GDOIRCq0AM3RbesEHZ2OmX7Xvzl0uf+UUhfQ0UrXw8EH9EZ5P va2YqXZKYL7d2xR0VF+hmX2JA8G8qEVucYAYpHNQ+sKp+uCCtefV4EbkWI+KHmYaWN0S BcGg== 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=hqDYZ5n2dyVejHc1NuT3r259i2tT+NHNkNWT0oPocpM=; b=Oycwi13oLAgl5DlC2ZrdUo2GSCHlbYi+Ti7KrsnNHAKwSRrsmU08qrZe+ZKeeVrwDs OVdqDZMW8acvD9Mg4GC31By1oqXtPWswJNheGEqhZP0YpMFbk8YPxHiHhucOn18UlOnJ BuJshN64iPmFiXmKRofan6F1N7p4fAfD/qhvJcSeBBEntRhpAaD9UDyIDstyVUjdQr/f oV6HFpVB3psL0F5ash1RxX7OdB+zjcUXqMkFyIw6X39wtHkBKpsaq2QT681EiRPZQI8m ohsyPG6gRmTdQPL58hM7w3O6r0A5EQv9rW5CURPyeR7d55Eyn0n+ZgjAOhIuT7swh7/a 93iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=doY9Zt0A; 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 p22si10052664ota.43.2020.02.03.09.59.48; Mon, 03 Feb 2020 10:00:00 -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=doY9Zt0A; 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 S1728589AbgBCQCd (ORCPT + 99 others); Mon, 3 Feb 2020 11:02:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:56408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727869AbgBCQCd (ORCPT ); Mon, 3 Feb 2020 11:02:33 -0500 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (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 6A6D120721; Mon, 3 Feb 2020 16:02:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580745752; bh=ng4f3LBqSvC9IA75BiWlMTBK0oaU1qkTurbY5hi6jmU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=doY9Zt0A1fwTGeIE+xiu6Je684fdhKakhzIz5vjAegJNO84761iCkOGDNr2CnJ7RO 7RTKo8x0i5b+gFRhnzEkyVONsAqVsjD07QnYJDRvYAaiIQx8HHonZr2ApJS00tziUG yYqIxmsb5fQ8jX15h5CWOY4ylOYo3tqOPWIupZZE= Date: Mon, 3 Feb 2020 16:02:28 +0000 From: Will Deacon To: "Paul E. McKenney" Cc: David Laight , 'Eric Dumazet' , Peter Zijlstra , Thomas Gleixner , the arch/x86 maintainers , LKML , Marco Elver Subject: Re: Confused about hlist_unhashed_lockless() Message-ID: <20200203160227.GA7274@willie-the-truck> References: <20200131164308.GA5175@willie-the-truck> <20200131184322.GA11457@worktop.programming.kicks-ass.net> <26258e70c35e4c108173a27317e64a0b@AcuMS.aculab.com> <20200203155839.GK2935@paulmck-ThinkPad-P72> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200203155839.GK2935@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 Mon, Feb 03, 2020 at 07:58:39AM -0800, Paul E. McKenney wrote: > On Mon, Feb 03, 2020 at 03:45:54PM +0000, David Laight wrote: > > From: Eric Dumazet > > > Sent: 31 January 2020 18:53 > > > > > > On Fri, Jan 31, 2020 at 10:48 AM Eric Dumazet wrote: > > > > > > > > > > > This is nice, now with have data_race() > > > > > > > > Remember these patches were sent 2 months ago, at a time we were > > > > trying to sort out things. > > > > > > > > data_race() was merged a few days ago. > > > > > > Well, actually data_race() is not there yet anyway. > > > > Shouldn't it be NO_DATA_RACE() ?? > > No, because you use data_race() when there really are data races, but you > want KCSAN to ignore them. For example, diagnostic code that doesn't > participate in the actual concurrency design and that doesn't run all > that often might use data_race(). For another example, if a developer > knew that data races existed, but that the compiler could not reasonably > do anything untoward with those data races, that developer might well > choose to use data_race() instead of READ_ONCE(). Especially if the > access in question was on a fastpath where helpful compiler optimizations > would be prohibited by use of READ_ONCE(). Yes, and in this particular case I think we can remove some WRITE_ONCE()s from the non-RCU hlist code too (similarly for hlist_nulls). Will