Linux Device Mapper development
 help / color / mirror / Atom feed
From: Gui Jianfeng <guijianfeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
To: Vivek Goyal <vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: dhaval-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org,
	snitzer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org,
	agk-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	balbir-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org,
	paolo.valente-rcYM44yAMweonA0d6jMUrA@public.gmane.org,
	fernando-gVGce1chcLdL9jVzuh4AOg@public.gmane.org,
	jmoyer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	fchecconi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	righi.andrea-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: Re: [PATCH 16/20] io-controller: IO group refcounting support
Date: Mon, 08 Jun 2009 10:03:24 +0800	[thread overview]
Message-ID: <4A2C716C.8070808@cn.fujitsu.com> (raw)
In-Reply-To: <1243377729-2176-17-git-send-email-vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Vivek Goyal wrote:
...
>  
>  /**
> @@ -436,7 +443,6 @@ static void bfq_idle_insert(struct io_service_tree *st,
>  {
>  	struct io_entity *first_idle = st->first_idle;
>  	struct io_entity *last_idle = st->last_idle;
> -	struct io_queue *ioq = io_entity_to_ioq(entity);
>  
>  	if (first_idle == NULL || bfq_gt(first_idle->finish, entity->finish))
>  		st->first_idle = entity;
> @@ -444,10 +450,6 @@ static void bfq_idle_insert(struct io_service_tree *st,
>  		st->last_idle = entity;
>  
>  	bfq_insert(&st->idle, entity);
> -
> -	/* Add this queue to idle list */
> -	if (ioq)
> -		list_add(&ioq->queue_list, &ioq->efqd->idle_list);
>  }
>  
>  /**
> @@ -723,8 +725,26 @@ int __bfq_deactivate_entity(struct io_entity *entity, int requeue)
>  void bfq_deactivate_entity(struct io_entity *entity, int requeue)
>  {
>  	struct io_sched_data *sd;
> +	struct io_group *iog;
>  	struct io_entity *parent;
>  
> +	iog = container_of(entity->sched_data, struct io_group, sched_data);
> +
> +	/*
> +	 * Hold a reference to entity's iog until we are done. This function
> +	 * travels the hierarchy and we don't want to free up the group yet
> +	 * while we are traversing the hiearchy. It is possible that this
> +	 * group's cgroup has been removed hence cgroup reference is gone.
> +	 * If this entity was active entity, then its group will not be on
> +	 * any of the trees and it will be freed up the moment queue is
> +	 * freed up in __bfq_deactivate_entity().
> +	 *
> +	 * Hence, hold a reference, deactivate the hierarhcy of entities and
> +	 * then drop the reference which should free up the whole chain of
> +	 * groups.
> +	 */
> +	elv_get_iog(iog);
> +
>  	for_each_entity_safe(entity, parent) {
>  		sd = entity->sched_data;
>  
> @@ -736,21 +756,28 @@ void bfq_deactivate_entity(struct io_entity *entity, int requeue)
>  			 */
>  			break;
>  
> -		if (sd->next_active != NULL)
> +		if (sd->next_active != NULL) {
>  			/*
>  			 * The parent entity is still backlogged and
>  			 * the budgets on the path towards the root
>  			 * need to be updated.
>  			 */
> +			elv_put_iog(iog);
>  			goto update;
> +		}
>  
>  		/*
>  		 * If we reach there the parent is no more backlogged and
>  		 * we want to propagate the dequeue upwards.
> +		 *
> +		 * If entity's group has been marked for deletion, don't
> +		 * requeue the group in idle tree so that it can be freed.
>  		 */
> -		requeue = 1;
> +		if (!iog_deleting(iog))
> +			requeue = 1;

  Hi Vivek,

  IIUC, if the iog is marked deleting, all iogs in the hierarchy don't have a chance 
  to be requeued into idle trees. So, I wonder why do it like this? Why the upper iogs 
  can't be requeued to the idle tree?

-- 
Regards
Gui Jianfeng

  parent reply	other threads:[~2009-06-08  2:03 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-26 22:41 [RFC] IO scheduler based IO controller V3 Vivek Goyal
2009-05-26 22:41 ` [PATCH 01/20] io-controller: Documentation Vivek Goyal
2009-05-29 15:42   ` Balbir Singh
2009-05-29 15:53     ` Vivek Goyal
     [not found] ` <1243377729-2176-1-git-send-email-vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-05-26 22:41   ` [PATCH 02/20] io-controller: Common flat fair queuing code in elevaotor layer Vivek Goyal
2009-05-27 20:53     ` Nauman Rafique
2009-05-28  8:52       ` Fabio Checconi
2009-05-28 16:00       ` Vivek Goyal
2009-05-28 19:41         ` Nauman Rafique
2009-05-29 16:06           ` Vivek Goyal
2009-05-29 16:57             ` Fabio Checconi
2009-05-29 19:06               ` Nauman Rafique
2009-05-29 19:16                 ` Vivek Goyal
2009-06-08  1:08     ` Gui Jianfeng
2009-06-08 12:58       ` Vivek Goyal
     [not found]     ` <1243377729-2176-3-git-send-email-vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-06-08  7:44       ` Gui Jianfeng
2009-06-08 13:56         ` Vivek Goyal
2009-05-26 22:41   ` [PATCH 06/20] io-controller: cfq changes to use hierarchical " Vivek Goyal
2009-05-26 22:41   ` [PATCH 09/20] io-controller: Separate out queue and data Vivek Goyal
2009-05-26 22:41 ` [PATCH 03/20] io-controller: Charge for time slice based on average disk rate Vivek Goyal
2009-05-26 22:41 ` [PATCH 04/20] io-controller: Modify cfq to make use of flat elevator fair queuing Vivek Goyal
2009-05-26 22:41 ` [PATCH 05/20] io-controller: Common hierarchical fair queuing code in elevaotor layer Vivek Goyal
2009-06-05  9:36   ` Gui Jianfeng
2009-06-05 13:21     ` Vivek Goyal
2009-05-26 22:41 ` [PATCH 07/20] io-controller: Export disk time used and nr sectors dipatched through cgroups Vivek Goyal
2009-05-26 22:41 ` [PATCH 08/20] io-controller: idle for sometime on sync queue before expiring it Vivek Goyal
2009-05-26 22:41 ` [PATCH 10/20] io-conroller: Prepare elevator layer for single queue schedulers Vivek Goyal
2009-06-05  9:17   ` Gui Jianfeng
2009-06-05 13:22     ` Vivek Goyal
2009-05-26 22:42 ` [PATCH 11/20] io-controller: noop changes for hierarchical fair queuing Vivek Goyal
2009-05-26 22:42 ` [PATCH 12/20] io-controller: deadline " Vivek Goyal
2009-05-26 22:42 ` [PATCH 13/20] io-controller: anticipatory " Vivek Goyal
2009-05-26 22:42 ` [PATCH 14/20] blkio_cgroup patches from Ryo to track async bios Vivek Goyal
2009-05-26 22:42 ` [PATCH 15/20] io-controller: map async requests to appropriate cgroup Vivek Goyal
2009-05-28  9:27   ` Ryo Tsuruta
2009-05-28 16:57     ` Vivek Goyal
2009-05-28 18:04       ` Nauman Rafique
2009-05-29  3:17       ` Ryo Tsuruta
2009-05-29 13:38         ` Vivek Goyal
2009-06-01 11:25           ` Ryo Tsuruta
2009-05-26 22:42 ` [PATCH 16/20] io-controller: IO group refcounting support Vivek Goyal
     [not found]   ` <1243377729-2176-17-git-send-email-vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-06-08  2:03     ` Gui Jianfeng [this message]
2009-06-08 13:53       ` Vivek Goyal
2009-05-26 22:42 ` [PATCH 17/20] io-controller: Per cgroup request descriptor support Vivek Goyal
2009-05-26 22:42 ` [PATCH 18/20] io-controller: Support per cgroup per device weights and io class Vivek Goyal
2009-05-26 22:42 ` [PATCH 19/20] io-controller: Debug hierarchical IO scheduling Vivek Goyal
2009-05-26 22:42 ` [PATCH 20/20] io-controller: experimental debug patch for async queue wait before expiry Vivek Goyal

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=4A2C716C.8070808@cn.fujitsu.com \
    --to=guijianfeng-bthxqxjhjhxqfuhtdcdx3a@public.gmane.org \
    --cc=agk-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=balbir-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=dhaval-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
    --cc=dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=fchecconi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=fernando-gVGce1chcLdL9jVzuh4AOg@public.gmane.org \
    --cc=jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=jmoyer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=paolo.valente-rcYM44yAMweonA0d6jMUrA@public.gmane.org \
    --cc=righi.andrea-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=snitzer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.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