From patchwork Sun Sep 29 11:16:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13815061 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC44BCF6495 for ; Sun, 29 Sep 2024 11:18:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8E37E8D0009; Sun, 29 Sep 2024 07:18:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 829F38E0002; Sun, 29 Sep 2024 07:18:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 501FC8D0009; Sun, 29 Sep 2024 07:18:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 2BC8C8D000C for ; Sun, 29 Sep 2024 07:18:26 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id C131881BF1 for ; Sun, 29 Sep 2024 11:18:25 +0000 (UTC) X-FDA: 82617527370.11.7B29440 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf03.hostedemail.com (Postfix) with ESMTP id 5538420008 for ; Sun, 29 Sep 2024 11:18:23 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=NBKotQif; spf=pass (imf03.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com; dmarc=pass (policy=none) header.from=efficios.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727608538; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=+iqrVbdhFnX56e6oip/5y57bqzkuTQEDcO7gVezFLVY=; b=ppX3nJw3OGqKrCftd4Dr5bccDcg4wzvJUP9v5dxHQARamdbvhYqHRJiCCNl0nb6W5Dcggt QiKgXBdorIOcCNhJ8TGVV7fOTNHvylyd3W1h7kuWvGSBsVca3HY7/n4uT8pwNlbl1woaUy GCPRA6DULY/zsjm+2ru3o/JvEe9KCF0= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=NBKotQif; spf=pass (imf03.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com; dmarc=pass (policy=none) header.from=efficios.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727608538; a=rsa-sha256; cv=none; b=Pozr+P//DUXE3xK7R9lfeHaqofiZJwPTOdeOlGMBQY7JBxcEAnuZbztCSAsaaqO+sZvTsw i+aN3UFKHkfjdWJcfMegqeI7wOtdCNglqI8szgmLiXZlg2bjtZgUC2Dg3PCljbLa1z1Tty yUpOE1VwkC9FckEZxpK8qV/bVAcjbUA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1727608702; bh=G7PuCyjYWpXG0rrDP36eNUASlKrzStIDA2+lcE9u1O4=; h=From:To:Cc:Subject:Date:From; b=NBKotQifR8pYpUQXsmZ2eqaf1ZBzpwQyTu3zYgLcLpFioqKIHJsuzShlIq6VY+gM0 rk9wBXqWwa65Y8qikre3fK30ktPdsm2Gpbj3tXhhM5VLxNnXhWB+lIvm8gfErUnikq G83xVtBiinVsPhQP4M1eGihVU5trQwcHUZh4X6XwtNhiOfsxPWMunTNusq91qROlUl ptLX0KHvL76WAcN7EUhfBSR7pmRCOSvs5HsIVRB5faz+XZoyIF1yuc8Es9zDq5RV9Y grPBNkJcvwoILvxF/g1KZ5Ys3DdIBeFQuSq4G3+8P4vxTjn8aJRaKHr1bpgvA8X3OY UjD79nlVO2vgw== Received: from thinkos.internal.efficios.com (unknown [IPv6:2606:6d00:100:4000:cacb:9855:de1f:ded2]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4XGhXG1dxhz695; Sun, 29 Sep 2024 07:18:22 -0400 (EDT) From: Mathieu Desnoyers To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Greg Kroah-Hartman , Sebastian Andrzej Siewior , "Paul E. McKenney" , Will Deacon , Peter Zijlstra , Boqun Feng , Alan Stern , John Stultz , Neeraj Upadhyay , Frederic Weisbecker , Joel Fernandes , Josh Triplett , Uladzislau Rezki , Steven Rostedt , Lai Jiangshan , Zqiang , Ingo Molnar , Waiman Long , Mark Rutland , Thomas Gleixner , Vlastimil Babka , maged.michael@gmail.com, Mateusz Guzik , Gary Guo , Jonas Oberhauser , rcu@vger.kernel.org, linux-mm@kvack.org, lkmm@lists.linux.dev, Nikita Popov , llvm@lists.linux.dev Subject: [PATCH v1 0/2] Introduce ptr_eq() to preserve address dependency Date: Sun, 29 Sep 2024 07:16:06 -0400 Message-Id: <20240929111608.1016757-1-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 5538420008 X-Stat-Signature: t9zo1y3wrxg4bgt8f7d4757zjhm9qjep X-Rspam-User: X-HE-Tag: 1727608703-394579 X-HE-Meta: U2FsdGVkX1+SU4DpLGI5LtdBJv3YCqtyNXpnKvaQkwxVfUZd9V37+idg3qq3JkDkCmf9xuJNkMZKXMot6SRNjl0+xardB4R6XnWgoT/4R9pc+bFEWC76K+dx6vfNsn1r3CAqXyyE5AaERdUUhnYY8PxmuK0MqcYA2iz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HrY9ORzljOUxTmAwtzHfzVv2aZvEEGs4z7ZSkUmerriVmr3MOHm6rCOc8phjiOBDC3zQvN7jI1UCmhjdrMKGovph27LsbTlRTn1lF0XpmM4FVDhH65O4ENLCdqAyMrAby++KQv9fPAS045jAxTf1Qjg84uAuBY/hFsThWGY75B2nSyd0DaidaDoKTCHi85BGEZehJvAegCts+zwIS8x1wx24SJnCajfz2TIYdTi9Qdf6OPJr7hgZ0dW+mPtuYCQks5ChjO2q14+Vuybwo4YjxM/wWxvmmyn8smfKPiOea1Pyv4BOQ6GUI8ydkoYjPE6TMvbHx8HwXSHx6D846DXXkmZnf3tgtSnbtKQY0zuE/V07EfpBPz7zY/7LXxxmvbcANx6Ur0TugNoeJTD0+S0hKMIlb4tqtfuIF7jZjWfETzwL1TVRTj11D1v1G1HtmQjp/y7Hc/IPHXksbv9HX+UYfEYUsHUkA4E8Ng+nPtQbjQdP0ZWBA3Ei6E9lz+YZ+zmqgVWbrMu5roIg33vrAg595mqdbmCQUtmR7tUggbPkSKRvtuF5TQwXdUif3Mz7ZpCsIKMHSewucQsXsI0N+CmbV038ZiXiLCjlVBJv/gXMyoRCv3xCqyNMTvLXfIsiNbe3dfU8q7wlHRq0lgLRzVCn0shcqUbs3q94b+K0ZGTPKJkGH5sQCfAUDETN7V//T27gFI5Vbq1zc5v3mShmrCF9IaSw3 7KwjX0VQ x5hgnjG8bD9h+sCBMVRzlqB0HGhuQD15GxHGMusd3iychvZzp5JEZkAY+dlgoKAmsb2smgqT8NYpEJR9z+ujoQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Introduce ptr_eq() to compare two addresses while preserving the address dependencies for later use of the address. It should be used when comparing an address returned by rcu_dereference(). Thanks, Mathieu Cc: Greg Kroah-Hartman Cc: Sebastian Andrzej Siewior Cc: "Paul E. McKenney" Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Alan Stern Cc: John Stultz Cc: Neeraj Upadhyay Cc: Boqun Feng Cc: Frederic Weisbecker Cc: Joel Fernandes Cc: Josh Triplett Cc: Uladzislau Rezki Cc: Steven Rostedt Cc: Lai Jiangshan Cc: Zqiang Cc: Ingo Molnar Cc: Waiman Long Cc: Mark Rutland Cc: Thomas Gleixner Cc: Vlastimil Babka Cc: maged.michael@gmail.com Cc: Mateusz Guzik Cc: Gary Guo Cc: Jonas Oberhauser Cc: rcu@vger.kernel.org Cc: linux-mm@kvack.org Cc: lkmm@lists.linux.dev Cc: Nikita Popov Cc: llvm@lists.linux.dev Mathieu Desnoyers (2): compiler.h: Introduce ptr_eq() to preserve address dependency Documentation: RCU: Refer to ptr_eq() Documentation/RCU/rcu_dereference.rst | 32 +++++++++++--- include/linux/compiler.h | 63 +++++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 5 deletions(-) Acked-by: Alan Stern