[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <174782916844.406.17946927892328892389.tip-bot2@tip-bot2>
Date: Wed, 21 May 2025 12:06:08 -0000
From: "tip-bot2 for Sebastian Andrzej Siewior" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject:
[tip: locking/futex] futex: Use RCU_INIT_POINTER() in futex_mm_init().
The following commit has been merged into the locking/futex branch of tip:
Commit-ID: 279f2c2c8e2169403d01190f042efa6e41731578
Gitweb: https://git.kernel.org/tip/279f2c2c8e2169403d01190f042efa6e41731578
Author: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
AuthorDate: Sat, 17 May 2025 17:14:53 +02:00
Committer: Peter Zijlstra <peterz@...radead.org>
CommitterDate: Wed, 21 May 2025 13:57:41 +02:00
futex: Use RCU_INIT_POINTER() in futex_mm_init().
There is no need for an explicit NULL pointer initialisation plus a
comment why it is okay. RCU_INIT_POINTER() can be used for NULL
initialisations and it is documented.
This has been build tested with gcc version 9.3.0 (Debian 9.3.0-22) on a
x86-64 defconfig.
Fixes: 094ac8cff7858 ("futex: Relax the rcu_assign_pointer() assignment of mm->futex_phash in futex_mm_init()")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Link: https://lore.kernel.org/r/20250517151455.1065363-4-bigeasy@linutronix.de
---
include/linux/futex.h | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/include/linux/futex.h b/include/linux/futex.h
index 168ffd5..005b040 100644
--- a/include/linux/futex.h
+++ b/include/linux/futex.h
@@ -88,14 +88,7 @@ void futex_hash_free(struct mm_struct *mm);
static inline void futex_mm_init(struct mm_struct *mm)
{
- /*
- * No need for rcu_assign_pointer() here, as we can rely on
- * tasklist_lock write-ordering in copy_process(), before
- * the task's MM becomes visible and the ->futex_phash
- * becomes externally observable:
- */
- mm->futex_phash = NULL;
-
+ RCU_INIT_POINTER(mm->futex_phash, NULL);
mutex_init(&mm->futex_hash_lock);
}
Powered by blists - more mailing lists