[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53203156.4090902@acm.org>
Date: Wed, 12 Mar 2014 11:05:10 +0100
From: Bart Van Assche <bvanassche@....org>
To: Alexander Gordeev <agordeev@...hat.com>
CC: Jens Axboe <axboe@...nel.dk>, Kent Overstreet <kmo@...erainc.com>,
Shaohua Li <shli@...nel.org>, Christoph Hellwig <hch@....de>,
Mike Christie <michaelc@...wisc.edu>,
linux-kernel <linux-kernel@...r.kernel.org>
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists