Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4972576ybb; Tue, 24 Mar 2020 08:37:30 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvc45l8RPbrdTxQ3CZ0uJjClRUMIldCfx08wAqjSRzW2Avy6QBTTpNAYsgQ3ikLyymLq2Wl X-Received: by 2002:aca:5596:: with SMTP id j144mr3931705oib.62.1585064250835; Tue, 24 Mar 2020 08:37:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585064250; cv=none; d=google.com; s=arc-20160816; b=J8MdU7JaXBPNuvFqy/sUBg3flzfSJPWU0NiGDfY+po/vNjM71dxkfaG+YJW/1h2WzI tGkiKGfAS1pu7lcPAFKkiGHSFk/wroxxeJqWq3KxEzFRfcSGL3PNEB4+1UCYwRrMegST ztMEeSo5kzEwvkOeEM4C/GYc+yzR+yBBjFCR7kywwzhbBfoKhqdroRBaimicGMCuB10M 5hbjTEgp0Bql2QcG5RDn2UBwhUdxPE9aQVcuz+3zyzlChalIRQ08mkC2qnJC8ltjZnX9 fffS1Z+dVzSguXrABL6POS4Bs8oF4/8rXH+HLus+LTb7xdCH8DwIlpf+uefyz6bsQxLL b2uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JYQcp3KeiOJ7JSFSmXojsy9B79H5YChGPxZg+w0BDAk=; b=m6b6tcE4akd4v5rmztH3NsVXvVUQIPLI30nEeaMgNiAJT5unX8yIQ5/owmHsKOtxH+ IPyc3Hw8qZ9MksLU1OdMIjr7Y5W5fLgN9g00HB7K8ZbOy5FcgdKxwlHK90/w+s1QYnbR uS7+UAGNeRFhf2Y6Ab6YB/7rWZQlb9Hlzq54q1Q1zjHQWP4oC5ilPK570lXyz2atxq+h /jltZ4rbw21dxZvrab0BL7kIMUtcV7XRq0mnJLtAjageFBRH+hadNxg4+3a4q3JNi1GT izjcnVlBRUb4PCF/YLxKO9GLTJY9kwsDEsFznIfjPbCkO1hi1fOSvY+YiXzp/zH+Uaja dSAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=g5YPnlnl; 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 u10si9342409otj.235.2020.03.24.08.37.18; Tue, 24 Mar 2020 08:37:30 -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=g5YPnlnl; 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 S1728274AbgCXPg5 (ORCPT + 99 others); Tue, 24 Mar 2020 11:36:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:59490 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727216AbgCXPg4 (ORCPT ); Tue, 24 Mar 2020 11:36:56 -0400 Received: from localhost.localdomain (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 287812080C; Tue, 24 Mar 2020 15:36:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585064216; bh=neEUpG858SvJc0NfbvvctYu868B2urEcRa1OZnEdi/g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g5YPnlnldLX5FxEmCV5nU6OMxrr4aQRvL63Qf/IymntooM+N8SKCiS315iO4HYjLS OSzRmaE590qXuylBXKE8gVCA5Jq25Oq6QiB5CSl7fB4nqiXo+JVZM5bCw8OL+TYUfr xw+cubwn5lk1k1QcAZQqIPrJzxXq/tib0vsm0DRQ= From: Will Deacon To: linux-kernel@vger.kernel.org Cc: Will Deacon , Eric Dumazet , Jann Horn , Kees Cook , Maddie Stone , Marco Elver , "Paul E . McKenney" , Peter Zijlstra , Thomas Gleixner , kernel-team@android.com, kernel-hardening@lists.openwall.com Subject: [RFC PATCH 02/21] list: Remove hlist_nulls_unhashed_lockless() Date: Tue, 24 Mar 2020 15:36:24 +0000 Message-Id: <20200324153643.15527-3-will@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200324153643.15527-1-will@kernel.org> References: <20200324153643.15527-1-will@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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