Re: [RFC PATCH 4/6] kernel: faster queue spinlock implementation

From: Eric Dumazet
Date: Wed Jan 23 2013 - 19:18:10 EST


On Tue, 2013-01-22 at 15:13 -0800, Michel Lespinasse wrote:
> {
> - __q_spin_unlock(lock, node);
> - preempt_enable_no_resched();
> - local_bh_enable_ip((unsigned long)__builtin_return_address(0));
> + unsigned int cpu, i;
> + struct q_spinlock_token *token;
> + for_each_possible_cpu(cpu)
> + for (i = 0; i < 2; i++) {
> + token = kmalloc(sizeof(struct q_spinlock_alloc_token),
> + GFP_KERNEL);
> + BUG_ON(!token);
> + token->wait = false;
> + per_cpu(q_spinlock_token[i], cpu) = token;
> + }

You might use kmalloc_node(... , cpu_to_node(cpu)) to spread these
tokens on all nodes.


--
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/