Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3965601ybl; Mon, 3 Feb 2020 09:53:44 -0800 (PST) X-Google-Smtp-Source: APXvYqyu9dJr81zPKQ88bTjqJMkugxejJWZAcDIcUJFpj7lfy+8uJntHHa9lHsTn7Ari72h6iUSz X-Received: by 2002:a9d:7e90:: with SMTP id m16mr12258278otp.227.1580752423629; Mon, 03 Feb 2020 09:53:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580752423; cv=none; d=google.com; s=arc-20160816; b=Id58lqysDL+9Qox3yBqUcZmAsnZQp/ehTqGx2Yz9QyoFufOVhNA+9rL8ouVohQ4g2U 6zjteuNEyWhBoc72nlJLneOoQ+vfIXG+s/DwFaJ4U/DpW61S66WMpNNSEDBB0f4zda8U lhSLpp8IcNnmbyyL5gAKKYAfileYldpz24x/m0xd+kWfilJXyBlpYyaw0ml8DEDtiTYn Nzv2dWKn3oHsQf4D0DqASPNrSu0U9eSfoqIHp1j2IzNZ+EmevsGXxhQsCkS80K4dAQzk cxZFRtluf3bC8CTLuVyaZBhPZXB9/nPX5C550VVrMPPH3BKvgfzYBuNtfv/jqUNMRA+l Np2w== 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=APS1oMNVawVMI5sXMZskJCAFfoCM476FzzRuAfzZHQE=; b=0QbMLwM1MSfo7ye/7YAjmN/r0auHx00zNivDVov/2yJT8LahttN+vpibM1xnSNQnKO KV4xJDTMpkzUNw+8agvi0f2DvmWHj4JAyET69clkM5b3hN5jCyyrlK679rSAl58iqSqV HBclNWsAJA5mVwyFOfk9CAeGoQg+VVlUYImlvMAWxrVlMC9fLlF4LhhJvzSDx2rPlipW 3NsgXmMbGi8PCnoc68kjbxRg+FsFKQr+obZYOCjJDxijvKHvdOnsuCVW0i5929GW72Cr GKfKUbmbwDvgAMdDdN02+3s76UJJOzazfHCt70rl2U/jcz1/J+gbiMcBgnLAtGFTPmDs eP+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VpZjPV9q; 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 k202si8114710oih.244.2020.02.03.09.53.30; Mon, 03 Feb 2020 09:53:43 -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=VpZjPV9q; 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 S1728286AbgBCP6k (ORCPT + 99 others); Mon, 3 Feb 2020 10:58:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:55420 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727507AbgBCP6k (ORCPT ); Mon, 3 Feb 2020 10:58:40 -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 949B12087E; Mon, 3 Feb 2020 15:58:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580745519; bh=RHjlVOlmohcRY28alvHfcJe32q4TVF5P2eQ6qHs54Cs=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=VpZjPV9qofw2iE96np4AHC0ilA/Wqh8JQBr9+VsP2IdkjoK8RNbJolbw3QSjOWgbZ i7k6ZbP35rGfxn5/D5Tc9ZM4nWfygmiyN90lMfLlnFn/iFsXlP0itUr1oCbH0SwAS9 VXr4AyCsGoIVTshPhvZCktG6zkWEzFXoGh17H1hs= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 6C7793522718; Mon, 3 Feb 2020 07:58:39 -0800 (PST) Date: Mon, 3 Feb 2020 07:58:39 -0800 From: "Paul E. McKenney" To: David Laight Cc: 'Eric Dumazet' , Peter Zijlstra , Will Deacon , Thomas Gleixner , the arch/x86 maintainers , LKML , Marco Elver Subject: Re: Confused about hlist_unhashed_lockless() Message-ID: <20200203155839.GK2935@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20200131164308.GA5175@willie-the-truck> <20200131184322.GA11457@worktop.programming.kicks-ass.net> <26258e70c35e4c108173a27317e64a0b@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <26258e70c35e4c108173a27317e64a0b@AcuMS.aculab.com> 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 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(). Thanx, Paul