diff options
| author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2025-05-17 18:14:53 +0300 |
|---|---|---|
| committer | Peter Zijlstra <peterz@infradead.org> | 2025-05-21 14:57:41 +0300 |
| commit | 279f2c2c8e2169403d01190f042efa6e41731578 (patch) | |
| tree | d122f1475bdf3f5d08331c4986e32609171994bc /include/linux | |
| parent | 7d4f494767918c80f2a99831728159b2aa398872 (diff) | |
| download | linux-279f2c2c8e2169403d01190f042efa6e41731578.tar.xz | |
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@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250517151455.1065363-4-bigeasy@linutronix.de
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/futex.h | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/include/linux/futex.h b/include/linux/futex.h index 168ffd5996b4..005b040c4791 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); } |
