From patchwork Sat Sep 28 13:51:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13814687 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 B02DFCF6491 for ; Sat, 28 Sep 2024 13:53:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 87CA06B0202; Sat, 28 Sep 2024 09:53:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 781686B0205; Sat, 28 Sep 2024 09:53:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5B7E86B0201; Sat, 28 Sep 2024 09:53:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 3C9596B0201 for ; Sat, 28 Sep 2024 09:53:56 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id C738281275 for ; Sat, 28 Sep 2024 13:53:55 +0000 (UTC) X-FDA: 82614290430.03.CF801DB Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf28.hostedemail.com (Postfix) with ESMTP id 1B8E6C0010 for ; Sat, 28 Sep 2024 13:53:52 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b="q/B77HSh"; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf28.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727531615; a=rsa-sha256; cv=none; b=C9rQj/S2OtXLYPFJ8aUDIvOl8ETbqNKFs/8Xlml8aFZUHswrx8BgUVWctg+gTukVRiYluP bFleeNjbG/hDWrvvZ2e5qoPCVgxlVAZXYLECkWAes+5+ulBFe0FQ/gb7ZRawZ5KQ+QkDCk WtRZdJajA48y+YfyjPvQDI2+TTokmq8= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b="q/B77HSh"; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf28.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727531615; 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=iyynJ6TYIeUj7MCz8F/mjixmYVW7Rr6A41IzTn2aUs4=; b=0lcJTiXvsUFMvMHGM/QaYVCm4BSNHFjXNQZF5ZIAeIGDl6c5R7XZAzOhuBCo02XJuIiziM JmL/4orDg+j2cLCDTp8V9BdRYU38dTEToDoCyMDXs/S87bg9byAPDNM2p/2OCfAOv9FlnE wbzqejk19KP4GETSUpfm1K9jZfPV0oU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1727531631; bh=AXylBb84Gi4ZLn9QbdSfWz1bezylh9IXiXx7KEkTzjs=; h=From:To:Cc:Subject:Date:From; b=q/B77HShFdxTc/U7T2Q1s8y3U5mDSC/aRDqgMJJThc8YVccivPQM/rgth9IwRaxeH q44c9RUC6wckcPus36YKTqUj1+84amth0u/vDFEvEQ0i0txruTuKX+tWl5zQpyUmJN OJMnFaAtEfrx7mGTm8fj3CL1xhf60KrptOGMvyMB0hretwuZvD1wx03r/DMWurATlj 4XxAH5Xr44Pp7louBaDrFRsxAym3fVPLVypG5LFyDLOkGXPcftZJtVB/F601kzYnxd LNm7L2NJlaPKAiykaompuGpW35Qmu3DuVs5TkzZZoDOhU2wHjHNU+7DVOemv/7SU+z QvayCYLOM8vnA== Received: from thinkos.internal.efficios.com (unknown [IPv6:2606:6d00:100:4000:cacb:9855:de1f:ded2]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4XG82754zDz1bpl; Sat, 28 Sep 2024 09:53:51 -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 Subject: [PATCH 0/2] Introduce ptr_eq() to preserve address dependency Date: Sat, 28 Sep 2024 09:51:26 -0400 Message-Id: <20240928135128.991110-1-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: jjs139nadhfbzfrbkddherp5puiqix1r X-Rspamd-Queue-Id: 1B8E6C0010 X-Rspamd-Server: rspam02 X-HE-Tag: 1727531632-439344 X-HE-Meta: U2FsdGVkX1+vS58ZSXaqftUUZyuy2yMjy+t/AkWTQUxiuEjLP94geSO3nzovhjtRNatkr6QvrAWqOZ+DJp1uHKZNX7JHkqbn+qnsjswR8Kl+FTFlXejb/z4eRpWIlCvDgjvMiXalhe0wZYEHK/WB4IV/lZOHSwSx17uskWi4O7e/xiOuwE26oF7Ln9WDW6AXExMG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Xg+DpmTTJPe7/no8g4+nAbHXo4zI1TPTUWL4xthpcvqdz75cHGEF/I1oNnDRbGGAkCgqGwjTfQUtI5NjRLOTonULJp+GhylhalFVbWn0u5fxdAcSXKMPExtsm85XtHF8QHm4L53TI/Wo9mLy5eHXm9pus2Q8dqZg89d7AiIE2AE8VzHlDTyV6odLBnUYZiaWqW6UFGl3z6j//CmV84mK4DUsR8axlOOhBCuD/7GfcPUXP55qAzUEhGiuu8vTkjCqB8SlN0QCoTV8r/+tCPyvbtuWuwGfmy20Jdi3SlQiylH+BLbMk8whxyhUpKdzAKYEW4W5jUWOaJhcZKG/N7ZeC3v/QK9K0H8CAcEBAnSVGVc+bmBoY2ZkgSw50WHFeIJIZD3Guj1Ds0bwXYElD509Wjpq/p2eYOPQBv2f8vfpfhC1gJBerGTbl5g5/jK6XJxmmadNRkOC5Qn/J87i2ec0EFgl/nrArHvfAShsbrzMvrhYb914SX8BRqk8sXf3/OtEQ63YVT3h7T9k3/nb2uTCJ8j4K4gFqnvATGkQ2vV1m+W7KbjLeodC8sKNeu6TEdHJ86au2QJhe+fmiXRpBjVoTQ0xqq2DoQ1ur/yVd2rMSw+56Ue8qUY4HD5My2W1a09k0IfqW3ktKNrAZw3NwxxqALla276gUEDer2+RY6zn5LNsgIcVml+w96Y TdV4flLz IVzRWt1qKnQG4V5qP3Cf1w== 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 Mathieu Desnoyers (2): compiler.h: Introduce ptr_eq() to preserve address dependency Documentation: RCU: Refer to ptr_eq() Documentation/RCU/rcu_dereference.rst | 34 ++++++++++++--- include/linux/compiler.h | 62 +++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 5 deletions(-)