Re: [patch V4 03/14] futex: Move futex related mm_struct data into a struct
From: Nam Cao
Date: Thu Apr 09 2026 - 07:12:11 EST
Thomas Gleixner <tglx@xxxxxxxxxx> writes:
> --- a/include/linux/futex_types.h
> +++ b/include/linux/futex_types.h
> @@ -29,8 +29,41 @@ struct futex_sched_data {
> struct mutex exit_mutex;
> unsigned int state;
> };
> -#else
> +
> +#ifdef CONFIG_FUTEX_PRIVATE_HASH
> +/**
> + * struct futex_mm_phash - Futex private hash related per MM data
> + * @lock: Mutex to protect the private hash operations
> + * @hash: RCU managed pointer to the private hash
> + * @hash_new: Pointer to a newly allocated private hash
> + * @batches: Batch state for RCU synchronization
> + * @rcu: RCU head for call_rcu()
> + * @atomic: Aggregate value for @hash_ref
> + * @ref: Per CPU reference counter for a private hash
> + */
> +struct futex_mm_phash {
> + struct mutex lock;
> + struct futex_private_hash __rcu *hash;
> + struct futex_private_hash *hash_new;
> + unsigned long batches;
> + struct rcu_head rcu;
> + atomic_long_t atomic;
> + unsigned int __percpu *ref;
> +};
Riscv build breaks horribly. This fixes it:
diff --git a/include/linux/futex_types.h b/include/linux/futex_types.h
index 288666fb37b6..eb9f9cc0ffc6 100644
--- a/include/linux/futex_types.h
+++ b/include/linux/futex_types.h
@@ -5,6 +5,7 @@
#ifdef CONFIG_FUTEX
#include <linux/mutex_types.h>
#include <linux/types.h>
+#include <asm/percpu.h>
struct compat_robust_list_head;
struct futex_pi_state;
Nam