summaryrefslogtreecommitdiff
path: root/include/linux/futex.h
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2025-04-16 18:29:13 +0200
committerPeter Zijlstra <peterz@infradead.org>2025-05-03 12:02:08 +0200
commit7c4f75a21f636486d2969d9b6680403ea8483539 (patch)
tree7ba61bc8ba91244f8180bcd17e7f54679fe9e0aa /include/linux/futex.h
parent80367ad01d93ac781b0e1df246edaf006928002f (diff)
futex: Allow automatic allocation of process wide futex hash
Allocate a private futex hash with 16 slots if a task forks its first thread. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/20250416162921.513656-14-bigeasy@linutronix.de
Diffstat (limited to 'include/linux/futex.h')
-rw-r--r--include/linux/futex.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/futex.h b/include/linux/futex.h
index 8f1be08bef18..1d3f7555825e 100644
--- a/include/linux/futex.h
+++ b/include/linux/futex.h
@@ -80,6 +80,7 @@ long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout,
int futex_hash_prctl(unsigned long arg2, unsigned long arg3, unsigned long arg4);
#ifdef CONFIG_FUTEX_PRIVATE_HASH
+int futex_hash_allocate_default(void);
void futex_hash_free(struct mm_struct *mm);
static inline void futex_mm_init(struct mm_struct *mm)
@@ -88,6 +89,7 @@ static inline void futex_mm_init(struct mm_struct *mm)
}
#else /* !CONFIG_FUTEX_PRIVATE_HASH */
+static inline int futex_hash_allocate_default(void) { return 0; }
static inline void futex_hash_free(struct mm_struct *mm) { }
static inline void futex_mm_init(struct mm_struct *mm) { }
#endif /* CONFIG_FUTEX_PRIVATE_HASH */
@@ -107,6 +109,10 @@ static inline int futex_hash_prctl(unsigned long arg2, unsigned long arg3, unsig
{
return -EINVAL;
}
+static inline int futex_hash_allocate_default(void)
+{
+ return 0;
+}
static inline void futex_hash_free(struct mm_struct *mm) { }
static inline void futex_mm_init(struct mm_struct *mm) { }