Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2922495ybb; Mon, 30 Mar 2020 16:08:55 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuKcW+1T7mIDUe+8YSx/Vbd2Qb055Jg0Gl0+GsFqMiGWYxY9rVAkLhYlCDhQAC3nWhwj1+i X-Received: by 2002:a05:6808:abc:: with SMTP id r28mr284461oij.161.1585609735640; Mon, 30 Mar 2020 16:08:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585609735; cv=none; d=google.com; s=arc-20160816; b=drHAgMOOp2CjIVf2jiYwjXbv5Zwx6HGev4glFuQk3xMTd28NschnHQ6Swed99Y3KJV ZE3ZkXvAtgIIYfd1ZW6o/moMivvz2m2Z9GdwvxHuB96L5KpuOlESr+HklaIoef9Ya3Rq eL6MWHbQAKw57yXiqixrJul9AniA3eOwX4F14SuXD3oMMWGfzHTb1qv9V75NjRMRLITh FLKaaTFKv6ZNKwdLKWFcOSdVS64M2ipls0uz/9uWA7rqKGgM8Mb2AV8VfkgJHxfSCJEV IBM/LXYuZ0+D0Kr572zy8BzFOl6SjJbP2HdjlrWNgP+7eS1C6roRsMw1ZP7/oZ1F2Pc6 JWGQ== 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=MkL9dV0R1A3tw8SqUxYVdSxkrSC33cV1NqJzODvfhB0=; b=eCkQc62KiNLxu2eV1L7hkTMszwV+B70EJT2YjPblMPQ7VPiTMBXXedf2vhf+vEh6Ub J1OgPOkf8zodWqxItjRNpga3qOwWmpAOxVOEPyrnwRo5gCXsligUrv457Y+APvXpPaUB XDtUj5x/DHSEvz3c4r7cSMpC0jqwntNsZ7BvxUy3PX1lzgyYSiqySVy+P21I9bbR9tOX KoGkt8llPPtcUg+shrYJWVViImNlpYM2orUGGPIGNJC/VS0ZI34mvKmxx9WUZtyPPNTa F7PYzcjbipiFaLrGXUB6k4SI2i0Yu+Vz2bZ0nvHBxAdSsDrfGJI4lcg3Yapw/2oJcRMU U4kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eaMgIeH6; 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 r25si3861200otq.113.2020.03.30.16.08.42; Mon, 30 Mar 2020 16:08:55 -0700 (PDT) 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=eaMgIeH6; 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 S1730011AbgC3XHx (ORCPT + 99 others); Mon, 30 Mar 2020 19:07:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:60484 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729024AbgC3XHw (ORCPT ); Mon, 30 Mar 2020 19:07:52 -0400 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 6516420771; Mon, 30 Mar 2020 23:07:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585609672; bh=4AVexlNiYtLyPvD8KLzOZUsgxdPsZ/3OqrKRBK5t78U=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=eaMgIeH63FPjbwbmlPJ1EDvOTFm3tqCkT0ss3Y+WINaDPNQ/I4KjnasBeJbiDOt2L 5MGtBK1edC6BncMz8rT8XPOqspWxPMHbLCCJF+s2hhVMeB1/VazpACz3WjycFJQy2X c2AXDCapRXA5Sjy7/HLSbURBVhd4l+B3/Wh9AUd8= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 3F4403523140; Mon, 30 Mar 2020 16:07:52 -0700 (PDT) Date: Mon, 30 Mar 2020 16:07:52 -0700 From: "Paul E. McKenney" To: Will Deacon Cc: linux-kernel@vger.kernel.org, Eric Dumazet , Jann Horn , Kees Cook , Maddie Stone , Marco Elver , Peter Zijlstra , Thomas Gleixner , kernel-team@android.com, kernel-hardening@lists.openwall.com Subject: Re: [RFC PATCH 02/21] list: Remove hlist_nulls_unhashed_lockless() Message-ID: <20200330230752.GY19865@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20200324153643.15527-1-will@kernel.org> <20200324153643.15527-3-will@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200324153643.15527-3-will@kernel.org> 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, Mar 24, 2020 at 03:36:24PM +0000, Will Deacon wrote: > Commit 02b99b38f3d9 ("rcu: Add a hlist_nulls_unhashed_lockless() function") > introduced the (as yet unused) hlist_nulls_unhashed_lockless() function > to avoid KCSAN reports when an RCU reader checks the 'hashed' status > of an 'hlist_nulls' concurrently undergoing modification. > > Remove the unused function and add a READ_ONCE() to hlist_nulls_unhashed(), > just like we do already for hlist_nulls_empty(). > > Cc: Paul E. McKenney > Cc: Peter Zijlstra > Signed-off-by: Will Deacon Well, I guess that the added docbook comment might be seen as worthwhile. Acked-by: Paul E. McKenney > --- > include/linux/list_nulls.h | 14 -------------- > 1 file changed, 14 deletions(-) > > diff --git a/include/linux/list_nulls.h b/include/linux/list_nulls.h > index fa6e8471bd22..3a9ff01e9a11 100644 > --- a/include/linux/list_nulls.h > +++ b/include/linux/list_nulls.h > @@ -65,20 +65,6 @@ static inline unsigned long get_nulls_value(const struct hlist_nulls_node *ptr) > * but hlist_nulls_del() does not. > */ > static inline int hlist_nulls_unhashed(const struct hlist_nulls_node *h) > -{ > - return !h->pprev; > -} > - > -/** > - * hlist_nulls_unhashed_lockless - Has node been removed and reinitialized? > - * @h: Node to be checked > - * > - * Not that not all removal functions will leave a node in unhashed state. > - * For example, hlist_del_init_rcu() leaves the node in unhashed state, > - * but hlist_nulls_del() does not. Unlike hlist_nulls_unhashed(), this > - * function may be used locklessly. > - */ > -static inline int hlist_nulls_unhashed_lockless(const struct hlist_nulls_node *h) > { > return !READ_ONCE(h->pprev); > } > -- > 2.20.1 >