linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
Cc: Nauman Rafique <nauman@google.com>,
	dpshah@google.com, lizf@cn.fujitsu.com, mikew@google.com,
	fchecconi@gmail.com, paolo.valente@unimore.it,
	jens.axboe@oracle.com, ryov@valinux.co.jp,
	fernando@oss.ntt.co.jp, s-uchida@ap.jp.nec.com,
	taka@valinux.co.jp, jmoyer@redhat.com, dhaval@linux.vnet.ibm.com,
	balbir@linux.vnet.ibm.com, linux-kernel@vger.kernel.org,
	containers@lists.linux-foundation.org, righi.andrea@gmail.com,
	agk@redhat.com, dm-devel@redhat.com, snitzer@redhat.com,
	m-ikeda@ds.jp.nec.com, akpm@linux-foundation.org
Subject: Re: [PATCH] io-controller: Add io group reference handling for request
Date: Fri, 15 May 2009 10:01:13 -0400	[thread overview]
Message-ID: <20090515140113.GA19350@redhat.com> (raw)
In-Reply-To: <4A0D1C55.9040700@cn.fujitsu.com>

On Fri, May 15, 2009 at 03:40:05PM +0800, Gui Jianfeng wrote:
> Vivek Goyal wrote:
> ...
> > Ok, here is the patch which gets rid of rq->iog and rq->rl fields. Good to
> > see some code and data structures trimming. It seems to be working fine for me.
> > 
> > 
> > o Get rid of rq->iog field and rq->rl fields. request descriptor stores
> >   the pointer the the queue it belongs to (rq->ioq) and from the io queue one
> >   can determine the group queue belongs to hence request belongs to. Thanks
> >   to Nauman for the idea.
> > 
> > o There are couple of places where rq->ioq information is not present yet
> >   as request and queue are being setup. In those places "bio" is passed 
> >   around as function argument to determine the group rq will go into. I
> >   did not pass "iog" as function argument becuase when memory is scarce,
> >   we can release queue lock and sleep to wait for memory to become available
> >   and once we wake up, it is possible that io group is gone. Passing bio
> >   around helps that one shall have to remap bio to right group after waking
> >   up. 
> > 
> > o Got rid of io_lookup_io_group_current() function and merged it with
> >   io_get_io_group() to also take care of looking for group using current
> >   task info and not from bio.
> 
> Hi Vivek,
> 
> This patch gets rid of "curr" from io_get_io_group, and seems to be 
> working fine for me.
> 

Thanks Gui. Can't think of a reason why "curr" should be a separate
function argument. I could only find blk_get_request() to be calling
io_get_io_group() without any bio passed. I think even in that case
determining the group from task should not hurt, I guess.

I will apply the patch.  Couple of comments inline.

> Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
> ---
>  block/cfq-iosched.c |   12 ++++++------
>  block/elevator-fq.c |   16 ++++++++--------
>  block/elevator-fq.h |    2 +-
>  3 files changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
> index c0bb8db..bf87843 100644
> --- a/block/cfq-iosched.c
> +++ b/block/cfq-iosched.c
> @@ -196,7 +196,7 @@ static struct cfq_queue *cic_bio_to_cfqq(struct cfq_data *cfqd,
>  		 * async bio tracking is enabled and we are not caching
>  		 * async queue pointer in cic.
>  		 */
> -		iog = io_get_io_group(cfqd->queue, bio, 0, 0);
> +		iog = io_get_io_group(cfqd->queue, bio, 0);
>  		if (!iog) {
>  			/*
>  			 * May be this is first rq/bio and io group has not
> @@ -1294,7 +1294,7 @@ static void changed_cgroup(struct io_context *ioc, struct cfq_io_context *cic)
>  
>  	spin_lock_irqsave(q->queue_lock, flags);
>  
> -	iog = io_get_io_group(q, NULL, 0, 1);
> +	iog = io_get_io_group(q, NULL, 0);
>  
>  	if (async_cfqq != NULL) {
>  		__iog = cfqq_to_io_group(async_cfqq);
> @@ -1346,9 +1346,9 @@ retry:
>  	 * back.
>  	 */
>  	if (bio)
> -		iog = io_get_io_group(q, bio, 1, 0);
> +		iog = io_get_io_group(q, bio, 1);
>  	else
> -		iog = io_get_io_group(q, NULL, 1, 1);
> +		iog = io_get_io_group(q, NULL, 1);
>  

Can we now change above to single statement

		io_get_io_group(q, bio, 1);
if bio is present, we will determine the group from that otherwise from
curret task context.


>  	cic = cfq_cic_lookup(cfqd, ioc);
>  	/* cic always exists here */
> @@ -1469,9 +1469,9 @@ cfq_get_queue(struct cfq_data *cfqd, struct bio *bio, int is_sync,
>  	struct io_group *iog = NULL;
>  
>  	if (bio)
> -		iog = io_get_io_group(cfqd->queue, bio, 1, 0);
> +		iog = io_get_io_group(cfqd->queue, bio, 1);
>  	else
> -		iog = io_get_io_group(cfqd->queue, NULL, 1, 1);
> +		iog = io_get_io_group(cfqd->queue, NULL, 1);
>  

Same here. Get rid of "if" condition.

>  	if (!is_sync) {
>  		async_cfqq = io_group_async_queue_prio(iog, ioprio_class,
> diff --git a/block/elevator-fq.c b/block/elevator-fq.c
> index 9b7319e..951c163 100644
> --- a/block/elevator-fq.c
> +++ b/block/elevator-fq.c
> @@ -1006,7 +1006,7 @@ struct request_list *io_group_get_request_list(struct request_queue *q,
>  {
>  	struct io_group *iog;
>  
> -	iog = io_get_io_group(q, bio, 1, 0);
> +	iog = io_get_io_group(q, bio, 1);
>  	BUG_ON(!iog);
>  	return &iog->rl;
>  }
> @@ -1470,7 +1470,7 @@ struct io_cgroup *get_iocg_from_bio(struct bio *bio)
>   *
>   */
>  struct io_group *io_get_io_group(struct request_queue *q, struct bio *bio,
> -					int create, int curr)
> +					int create)
>  {
>  	struct cgroup *cgroup;
>  	struct io_group *iog;
> @@ -1478,7 +1478,7 @@ struct io_group *io_get_io_group(struct request_queue *q, struct bio *bio,
>  
>  	rcu_read_lock();
>  
> -	if (curr)
> +	if (!bio)
>  		cgroup = task_cgroup(current, io_subsys_id);
>  	else
>  		cgroup = get_cgroup_from_bio(bio);
> @@ -1959,7 +1959,7 @@ int io_group_allow_merge(struct request *rq, struct bio *bio)
>  		return 1;
>  
>  	/* Determine the io group of the bio submitting task */
> -	iog = io_get_io_group(q, bio, 0, 0);
> +	iog = io_get_io_group(q, bio, 0);
>  	if (!iog) {
>  		/* May be task belongs to a differet cgroup for which io
>  		 * group has not been setup yet. */
> @@ -2000,9 +2000,9 @@ int elv_fq_set_request_ioq(struct request_queue *q, struct request *rq,
>  retry:
>  	/* Determine the io group request belongs to */
>  	if (bio)
> -		iog = io_get_io_group(q, bio, 1, 0);
> +		iog = io_get_io_group(q, bio, 1);
>  	else
> -		iog = io_get_io_group(q, bio, 1, 1);
> +		iog = io_get_io_group(q, NULL, 1);
>  

"if" not required now.

Thanks
Vivek

  reply	other threads:[~2009-05-15 14:05 UTC|newest]

Thread overview: 133+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-05 19:58 IO scheduler based IO Controller V2 Vivek Goyal
2009-05-05 19:58 ` [PATCH 01/18] io-controller: Documentation Vivek Goyal
2009-05-06  3:16   ` Gui Jianfeng
2009-05-06 13:31     ` Vivek Goyal
2009-05-05 19:58 ` [PATCH 02/18] io-controller: Common flat fair queuing code in elevaotor layer Vivek Goyal
2009-05-22  6:43   ` Gui Jianfeng
2009-05-22 12:32     ` Vivek Goyal
2009-05-23 20:04       ` Jens Axboe
2009-05-05 19:58 ` [PATCH 03/18] io-controller: Charge for time slice based on average disk rate Vivek Goyal
2009-05-05 19:58 ` [PATCH 04/18] io-controller: Modify cfq to make use of flat elevator fair queuing Vivek Goyal
2009-05-22  8:54   ` Gui Jianfeng
2009-05-22 12:33     ` Vivek Goyal
2009-05-05 19:58 ` [PATCH 05/18] io-controller: Common hierarchical fair queuing code in elevaotor layer Vivek Goyal
2009-05-07  7:42   ` Gui Jianfeng
2009-05-07  8:05     ` Li Zefan
2009-05-08 12:45     ` Vivek Goyal
2009-05-08 21:09   ` Andrea Righi
2009-05-08 21:17     ` Vivek Goyal
2009-05-05 19:58 ` [PATCH 06/18] io-controller: cfq changes to use " Vivek Goyal
2009-05-05 19:58 ` [PATCH 07/18] io-controller: Export disk time used and nr sectors dipatched through cgroups Vivek Goyal
2009-05-13  2:39   ` Gui Jianfeng
2009-05-13 14:51     ` Vivek Goyal
2009-05-14  7:53       ` Gui Jianfeng
2009-05-05 19:58 ` [PATCH 08/18] io-controller: idle for sometime on sync queue before expiring it Vivek Goyal
2009-05-13 15:00   ` Vivek Goyal
2009-06-09  7:56   ` Gui Jianfeng
2009-06-09 17:51     ` Vivek Goyal
2009-06-10  1:30       ` Gui Jianfeng
2009-06-10 13:26         ` Vivek Goyal
2009-06-11  1:22           ` Gui Jianfeng
2009-05-05 19:58 ` [PATCH 09/18] io-controller: Separate out queue and data Vivek Goyal
2009-05-05 19:58 ` [PATCH 10/18] io-conroller: Prepare elevator layer for single queue schedulers Vivek Goyal
2009-05-05 19:58 ` [PATCH 11/18] io-controller: noop changes for hierarchical fair queuing Vivek Goyal
2009-05-05 19:58 ` [PATCH 12/18] io-controller: deadline " Vivek Goyal
2009-05-05 19:58 ` [PATCH 13/18] io-controller: anticipatory " Vivek Goyal
2009-05-05 19:58 ` [PATCH 14/18] blkio_cgroup patches from Ryo to track async bios Vivek Goyal
2009-05-05 19:58 ` [PATCH 15/18] io-controller: map async requests to appropriate cgroup Vivek Goyal
2009-05-05 19:58 ` [PATCH 16/18] io-controller: Per cgroup request descriptor support Vivek Goyal
2009-05-05 19:58 ` [PATCH 17/18] io-controller: IO group refcounting support Vivek Goyal
2009-05-08  2:59   ` Gui Jianfeng
2009-05-08 12:44     ` Vivek Goyal
2009-05-05 19:58 ` [PATCH 18/18] io-controller: Debug hierarchical IO scheduling Vivek Goyal
2009-05-06 21:40   ` IKEDA, Munehiro
2009-05-06 21:58     ` Vivek Goyal
2009-05-06 22:19       ` IKEDA, Munehiro
2009-05-06 22:24         ` Vivek Goyal
2009-05-06 23:01           ` IKEDA, Munehiro
2009-05-05 20:24 ` IO scheduler based IO Controller V2 Andrew Morton
2009-05-05 22:20   ` Peter Zijlstra
2009-05-06  3:42     ` Balbir Singh
2009-05-06 10:20       ` Fabio Checconi
2009-05-06 17:10         ` Balbir Singh
2009-05-06 18:47       ` Divyesh Shah
2009-05-06 20:42       ` Andrea Righi
2009-05-06  2:33   ` Vivek Goyal
2009-05-06 17:59     ` Nauman Rafique
2009-05-06 20:07     ` Andrea Righi
2009-05-06 21:21       ` Vivek Goyal
2009-05-06 22:02         ` Andrea Righi
2009-05-06 22:17           ` Vivek Goyal
2009-05-06 20:32     ` Vivek Goyal
2009-05-06 21:34       ` Andrea Righi
2009-05-06 21:52         ` Vivek Goyal
2009-05-06 22:35           ` Andrea Righi
2009-05-07  1:48             ` Ryo Tsuruta
2009-05-07  9:04           ` Andrea Righi
2009-05-07 12:22             ` Andrea Righi
2009-05-07 14:11             ` Vivek Goyal
2009-05-07 14:45               ` Vivek Goyal
2009-05-07 15:36                 ` Vivek Goyal
2009-05-07 15:42                   ` Vivek Goyal
2009-05-07 22:19                   ` Andrea Righi
2009-05-08 18:09                     ` Vivek Goyal
2009-05-08 20:05                       ` Andrea Righi
2009-05-08 21:56                         ` Vivek Goyal
2009-05-09  9:22                           ` Peter Zijlstra
2009-05-14 10:31                           ` Andrea Righi
2009-05-14 16:43                           ` Dhaval Giani
2009-05-07 22:40                 ` Andrea Righi
2009-05-07  0:18     ` Ryo Tsuruta
2009-05-07  1:25       ` Vivek Goyal
2009-05-11 11:23         ` Ryo Tsuruta
2009-05-11 12:49           ` Vivek Goyal
2009-05-08 14:24       ` Rik van Riel
2009-05-11 10:11         ` Ryo Tsuruta
2009-05-06  3:41   ` Balbir Singh
2009-05-06 13:28     ` Vivek Goyal
2009-05-06  8:11 ` Gui Jianfeng
2009-05-06 16:10   ` Vivek Goyal
2009-05-07  5:36     ` Li Zefan
2009-05-08 13:37       ` Vivek Goyal
2009-05-11  2:59         ` Gui Jianfeng
2009-05-07  5:47     ` Gui Jianfeng
2009-05-08  9:45 ` [PATCH] io-controller: Add io group reference handling for request Gui Jianfeng
2009-05-08 13:57   ` Vivek Goyal
2009-05-08 17:41     ` Nauman Rafique
2009-05-08 18:56       ` Vivek Goyal
2009-05-08 19:06         ` Nauman Rafique
2009-05-11  1:33       ` Gui Jianfeng
2009-05-11 15:41         ` Vivek Goyal
2009-05-15  5:15           ` Gui Jianfeng
2009-05-15  7:48             ` Andrea Righi
2009-05-15  8:16               ` Gui Jianfeng
2009-05-15 14:09                 ` Vivek Goyal
2009-05-15 14:06               ` Vivek Goyal
2009-05-17 10:26                 ` Andrea Righi
2009-05-18 14:01                   ` Vivek Goyal
2009-05-18 14:39                     ` Andrea Righi
2009-05-26 11:34                       ` Ryo Tsuruta
2009-05-27  6:56                         ` Ryo Tsuruta
2009-05-27  8:17                           ` Andrea Righi
2009-05-27 11:53                             ` Ryo Tsuruta
2009-05-27 17:32                           ` Vivek Goyal
2009-05-19 12:18                     ` Ryo Tsuruta
2009-05-15  7:40           ` Gui Jianfeng
2009-05-15 14:01             ` Vivek Goyal [this message]
2009-05-13  2:00 ` [PATCH] IO Controller: Add per-device weight and ioprio_class handling Gui Jianfeng
2009-05-13 14:44   ` Vivek Goyal
2009-05-14  0:59     ` Gui Jianfeng
2009-05-13 15:29   ` Vivek Goyal
2009-05-14  1:02     ` Gui Jianfeng
2009-05-13 15:59   ` Vivek Goyal
2009-05-14  1:51     ` Gui Jianfeng
2009-05-14  2:25     ` Gui Jianfeng
2009-05-13 17:17   ` Vivek Goyal
2009-05-14  1:24     ` Gui Jianfeng
2009-05-13 19:09   ` Vivek Goyal
2009-05-14  1:35     ` Gui Jianfeng
2009-05-14  7:26     ` Gui Jianfeng
2009-05-14 15:15       ` Vivek Goyal
2009-05-18 22:33       ` IKEDA, Munehiro
2009-05-20  1:44         ` Gui Jianfeng
2009-05-20 15:41           ` IKEDA, Munehiro

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=20090515140113.GA19350@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=agk@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=containers@lists.linux-foundation.org \
    --cc=dhaval@linux.vnet.ibm.com \
    --cc=dm-devel@redhat.com \
    --cc=dpshah@google.com \
    --cc=fchecconi@gmail.com \
    --cc=fernando@oss.ntt.co.jp \
    --cc=guijianfeng@cn.fujitsu.com \
    --cc=jens.axboe@oracle.com \
    --cc=jmoyer@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=m-ikeda@ds.jp.nec.com \
    --cc=mikew@google.com \
    --cc=nauman@google.com \
    --cc=paolo.valente@unimore.it \
    --cc=righi.andrea@gmail.com \
    --cc=ryov@valinux.co.jp \
    --cc=s-uchida@ap.jp.nec.com \
    --cc=snitzer@redhat.com \
    --cc=taka@valinux.co.jp \
    /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;
as well as URLs for NNTP newsgroup(s).