lkml.org 
[lkml]   [2013]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH 4/6] kernel: faster queue spinlock implementation
From
Date
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.




\
 
 \ /
  Last update: 2013-01-24 02:01    [W:0.133 / U:0.652 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site