lkml.org 
[lkml]   [2014]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.


\
 
 \ /
  Last update: 2014-03-12 11:41    [W:0.155 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site