Messages in this thread | | | Subject | Re: [RFC PATCH 4/6] kernel: faster queue spinlock implementation | From | Eric Dumazet <> | Date | Wed, 23 Jan 2013 16:18:14 -0800 |
| |
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.
| |