Messages in this thread | | | Date | Wed, 12 Mar 2014 11:05:10 +0100 | From | Bart Van Assche <> | Subject | Re: [PATCH] percpu_ida: Handle out-of-tags gracefully |
| |
On 03/12/14 09:41, Alexander Gordeev wrote: > Still the hunk below (a) breaks the 'pool->percpu_max_size' threshold > and (b) somehow suboptimal, because you wake another thread while a > free tag was/is on this CPU. If it is still here we would better to > grab it. If not, it was stolen by another thread and we do not need > to wake one (not sure how could it be addressed, though). > > In fact, did you try to remove this hunk at all? A following call to > percpu_ida_free() both honors the threshold and wakes a thread, so > your extra wake could be unnecessary. > > @@ -189,6 +189,9 @@ int percpu_ida_alloc(struct percpu_ida *pool, int state) > spin_unlock(&pool->lock); > local_irq_restore(flags); > > + if (tags->nr_free) > + wake_up(&pool->wait); > + > if (tag >= 0 || state == TASK_RUNNING) > break; > >
Hello Alexander,
You are right, that hunk is not necessary and can be left out. That code was added while chasing another (unrelated) bug. I will resend this patch without that hunk.
Bart.
| |