public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Alexander Gordeev <agordeev@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>, Kent Overstreet <kmo@daterainc.com>,
	Shaohua Li <shli@kernel.org>, Christoph Hellwig <hch@lst.de>,
	Mike Christie <michaelc@cs.wisc.edu>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] percpu_ida: Handle out-of-tags gracefully
Date: Wed, 12 Mar 2014 11:05:10 +0100	[thread overview]
Message-ID: <53203156.4090902@acm.org> (raw)
In-Reply-To: <20140312084152.GA8838@dhcp-26-207.brq.redhat.com>

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.

  reply	other threads:[~2014-03-12 10:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-10 14:12 [PATCH] percpu_ida: Handle out-of-tags gracefully Bart Van Assche
2014-03-11 13:51 ` Alexander Gordeev
2014-03-11 18:10   ` Bart Van Assche
2014-03-11 20:48     ` Alexander Gordeev
2014-03-12  7:22       ` Bart Van Assche
2014-03-12  8:41         ` Alexander Gordeev
2014-03-12 10:05           ` Bart Van Assche [this message]
2014-03-12 15:21         ` Alexander Gordeev
2014-03-12 16:16           ` Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53203156.4090902@acm.org \
    --to=bvanassche@acm.org \
    --cc=agordeev@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=kmo@daterainc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    --cc=shli@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox