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

From: Peter Zijlstra
Date: Tue Dec 10 2013 - 11:24:38 EST


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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/