LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: Vivek Goyal <vgoyal@redhat.com>
Cc: linux kernel mailing list <linux-kernel@vger.kernel.org>,
	Jens Axboe <axboe@kernel.dk>
Subject: Re: [PATCH] blkio-throttle: Avoid calling blkiocg_lookup_group() for root group
Date: Mon, 31 Jan 2011 14:20:57 -0500	[thread overview]
Message-ID: <x49ei7sq3qe.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <20110126185729.GD6713@redhat.com> (Vivek Goyal's message of "Wed, 26 Jan 2011 13:57:29 -0500")

Vivek Goyal <vgoyal@redhat.com> writes:

> On Mon, Jan 17, 2011 at 04:56:06PM -0500, Vivek Goyal wrote:
>> o Jeff Moyer was doing some testing on a RAM backed disk and
>>   blkiocg_lookup_group() showed up high overhead after memcpy(). Similarly
>>   somebody else reported that blkiocg_lookup_group() is eating 6% extra
>>   cpu. Though looking at the code I can't think why the overhead of
>>   this function is so high. One thing is that it is called with very high
>>   frequency (once for every IO).
>> 
>> o For lot of folks blkio controller will be compiled in but they might
>>   not have actually created cgroups. Hence optimize the case of root
>>   cgroup where we can avoid calling blkiocg_lookup_group() if IO is happening
>>   in root group (common case).
>> 
>> Reported-by: Jeff Moyer <jmoyer@redhat.com>
>> Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
>
> Hi Jens,
>
> Do you have any concerns regarding this patch?

Acked-by: Jeff Moyer <jmoyer@redhat.com>

Jens, this is a pretty easy performance regression fixup.  I think it
should be pulled in sooner rather than later.  We've also witnessed this
slowdown on big performance testing rigs, so it's not just a ramdisk
issue.

Cheers,
Jeff

>> ---
>>  block/blk-throttle.c |   10 +++++++++-
>>  1 file changed, 9 insertions(+), 1 deletion(-)
>> 
>> Index: linux-2.6/block/blk-throttle.c
>> ===================================================================
>> --- linux-2.6.orig/block/blk-throttle.c	2011-01-17 16:23:37.041280712 -0500
>> +++ linux-2.6/block/blk-throttle.c	2011-01-17 16:36:09.362940975 -0500
>> @@ -168,7 +168,15 @@ static struct throtl_grp * throtl_find_a
>>  	 * tree of blkg (instead of traversing through hash list all
>>  	 * the time.
>>  	 */
>> -	tg = tg_of_blkg(blkiocg_lookup_group(blkcg, key));
>> +
>> +	/*
>> +	 * This is the common case when there are no blkio cgroups.
>> + 	 * Avoid lookup in this case
>> + 	 */
>> +	if (blkcg == &blkio_root_cgroup)
>> +		tg = &td->root_tg;
>> +	else
>> +		tg = tg_of_blkg(blkiocg_lookup_group(blkcg, key));
>>  
>>  	/* Fill in device details for root group */
>>  	if (tg && !tg->blkg.dev && bdi->dev && dev_name(bdi->dev)) {
>> 

  reply	other threads:[~2011-01-31 19:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-17 21:56 Vivek Goyal
2011-01-17 22:00 ` Jeff Moyer
2011-01-26 18:57 ` Vivek Goyal
2011-01-31 19:20   ` Jeff Moyer [this message]
2011-01-31 19:24     ` Jens Axboe
2011-01-31 19:25       ` Jens Axboe
2011-01-31 19:30         ` Jeff Moyer

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=x49ei7sq3qe.fsf@segfault.boston.devel.redhat.com \
    --to=jmoyer@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vgoyal@redhat.com \
    --subject='Re: [PATCH] blkio-throttle: Avoid calling blkiocg_lookup_group() for root group' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).