Re: [PATCH 1/3] Percpu tag allocator

2013-06-08 Thread Oleg Nesterov
On 06/08, Nicholas A. Bellinger wrote: > > +unsigned tag_alloc(struct tag_pool *pool, bool wait) > +{ > + struct tag_cpu_freelist *tags; > + unsigned long flags; > + unsigned ret; > +retry: > + preempt_disable(); > + local_irq_save(flags); > + tags = this_cpu_ptr(pool->tag_c

[PATCH 1/3] Percpu tag allocator

2013-06-07 Thread Nicholas A. Bellinger
From: Kent Overstreet Allocates integers out of a predefined range - for use by e.g. a driver to allocate tags for communicating with the device. Signed-off-by: Kent Overstreet Cc: Tejun Heo Cc: Oleg Nesterov Cc: Christoph Lameter Cc: Ingo Molnar Cc: Michael S. Tsirkin Cc: Asias He Signed