[PATCH v5 8/8] futex: Use runtime constants for __futex_hash() hot path

Charlie Jenkins thecharlesjenkins at gmail.com
Fri Jul 10 00:52:39 PDT 2026


On Tue, 30 Jun 2026 04:55:31 +0000, K Prateek Nayak <kprateek.nayak at amd.com> wrote:
> Runtime constify the read-only after init data  __futex_shift(shift_32),
> __futex_mask(mask_32), and __futex_queues(ptr) used in __futex_hash()
> hot path to avoid referencing global variable.
> 
> This also allows __futex_queues to be allocated dynamically to
> "nr_node_ids" slots instead of reserving config dependent MAX_NUMNODES
> (1 << CONFIG_NODES_SHIFT) worth of slots upfront.
> 
> [...]

Reviewed-by: Charlie Jenkins <thecharlesjenkins at gmail.com>
Tested-by: Charlie Jenkins <thecharlesjenkins at gmail.com>

-- 
- Charlie




More information about the linux-riscv mailing list