Re: [PATCH v2 4/4] futex: Avoid taking hb lock if nothing to wakeup

Peter Zijlstra
2013-12-10T16:24:36Z

On Tue, Dec 03, 2013 at 01:45:27AM -0800, Davidlohr Bueso wrote:
> @@ -203,6 +221,9 @@ static const struct futex_q futex_q_init = {
> * waiting on a futex.
> */
> struct futex_hash_bucket {
> +#ifdef CONFIG_SMP
> + atomic_t waiters;
> +#endif
> spinlock_t lock;
> struct plist_head chain;
> } ____cacheline_aligned_in_smp;

> @@ -2805,6 +2906,9 @@ static int __init futex_init(void)
> for (i = 0; i < futex_hashsize; i++) {
> plist_head_init(&futex_queues[i].chain);
> spin_lock_init(&futex_queues[i].lock);
> +#ifdef CONFIG_SMP
> + atomic_set(&futex_queues[i].waiters, 0);
> +#endif
> }
>
> return 0;

Just remove those two #ifdefs, its not like the data structure size
matters at this point.