linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Tejun Heo <tj@kernel.org>
Cc: axboe@kernel.dk, ctalbott@google.com, rni@google.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH UPDATED 11/11] blkcg: unify blkg's for blkcg policies
Date: Fri, 3 Feb 2012 14:41:05 -0500	[thread overview]
Message-ID: <20120203194105.GA12616@redhat.com> (raw)
In-Reply-To: <20120202003730.GC19837@google.com>

On Wed, Feb 01, 2012 at 04:37:30PM -0800, Tejun Heo wrote:
> Currently, blkg is per cgroup-queue-policy combination.  This is
> unnatural and leads to various convolutions in partially used
> duplicate fields in blkg, config / stat access, and general management
> of blkgs.
> 
> This patch make blkg's per cgroup-queue and let them serve all
> policies.  blkgs are now created and destroyed by blkcg core proper.
> This will allow further consolidation of common management logic into
> blkcg core and API with better defined semantics and layering.
> 
> As a transitional step to untangle blkg management, elvswitch and
> policy [de]registration, all blkgs except the root blkg are being shot
> down during elvswitch and bypass.  This patch adds blkg_root_update()
> to update root blkg in place on policy change.  This is hacky and racy
> but should be good enough as interim step until we get locking
> simplified and switch over to proper in-place update for all blkgs.

- So we don't shoot down root group over elevator switch and policy
  changes because we are not sure if we will be able to alloc new
  group? It is not like elevator where we don't free the old one till
  we have made sure that new one is allocated and initialized properly.

- I am assuming that we will change  blkg_destroy_all() later to also
  take policy as argument and only destroy policy data of respective
  policy and not the whole group. (Well I guess we can destroy the whole
  group if it was only policy on the group). 


[..]
>  static struct blkio_group *blkg_alloc(struct blkio_cgroup *blkcg,
> -				      struct request_queue *q,
> -				      struct blkio_policy_type *pol)
> +				      struct request_queue *q)

Comment before this function still mentions "pol" as function argument.


[..]
> @@ -776,43 +786,49 @@ blkiocg_reset_stats(struct cgroup *cgrou
>  #endif
>  
>  	blkcg = cgroup_to_blkio_cgroup(cgroup);
> +	spin_lock(&blkio_list_lock);
>  	spin_lock_irq(&blkcg->lock);

Isn't blkcg lock enough to protect against policy registration/deregistration.
A policy can not add/delete a group to cgroup list without blkcg list. 

Thanks
Vivek

  reply	other threads:[~2012-02-03 19:41 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-01 21:19 [PATCHSET] blkcg: unify blkgs for different policies Tejun Heo
2012-02-01 21:19 ` [PATCH 01/11] blkcg: let blkio_group point to blkio_cgroup directly Tejun Heo
2012-02-02 20:03   ` Vivek Goyal
2012-02-02 20:33     ` Tejun Heo
2012-02-02 20:55       ` Vivek Goyal
2012-02-01 21:19 ` [PATCH 02/11] block: relocate elevator initialized test from blk_cleanup_queue() to blk_drain_queue() Tejun Heo
2012-02-02 20:20   ` Vivek Goyal
2012-02-02 20:35     ` Tejun Heo
2012-02-02 20:37       ` Vivek Goyal
2012-02-02 20:38         ` Tejun Heo
2012-02-01 21:19 ` [PATCH 03/11] blkcg: add blkcg_{init|drain|exit}_queue() Tejun Heo
2012-02-01 21:19 ` [PATCH 04/11] blkcg: clear all request_queues on blkcg policy [un]registrations Tejun Heo
2012-02-01 21:19 ` [PATCH 05/11] blkcg: let blkcg core handle policy private data allocation Tejun Heo
2012-02-01 21:19 ` [PATCH 06/11] blkcg: move refcnt to blkcg core Tejun Heo
2012-02-02 22:07   ` Vivek Goyal
2012-02-02 22:11     ` Tejun Heo
2012-02-01 21:19 ` [PATCH 07/11] blkcg: make blkg->pd an array and move configuration and stats into it Tejun Heo
2012-02-01 21:19 ` [PATCH 08/11] blkcg: don't use blkg->plid in stat related functions Tejun Heo
2012-02-01 21:19 ` [PATCH 09/11] blkcg: move per-queue blkg list heads and counters to queue and blkg Tejun Heo
2012-02-02 22:47   ` Vivek Goyal
2012-02-02 22:47     ` Tejun Heo
2012-02-01 21:19 ` [PATCH 10/11] blkcg: let blkcg core manage per-queue blkg list and counter Tejun Heo
2012-02-01 21:19 ` [PATCH 11/11] blkcg: unify blkg's for blkcg policies Tejun Heo
2012-02-02  0:37   ` [PATCH UPDATED " Tejun Heo
2012-02-03 19:41     ` Vivek Goyal [this message]
2012-02-03 20:59       ` Tejun Heo
2012-02-03 21:44         ` Vivek Goyal
2012-02-03 21:47           ` Tejun Heo
2012-02-03 21:53             ` Vivek Goyal
2012-02-03 22:14               ` Tejun Heo
2012-02-03 22:23                 ` Vivek Goyal
2012-02-03 22:28                   ` Tejun Heo
2012-02-03 21:06     ` Vivek Goyal
2012-02-03 21:09       ` Tejun Heo
2012-02-03 21:10         ` Tejun Heo
2012-02-14  1:33     ` [PATCH UPDATED2 " Tejun Heo
2012-02-15 17:02       ` Vivek Goyal
2012-02-16 22:42         ` Tejun Heo
2012-02-02 19:29 ` [PATCHSET] blkcg: unify blkgs for different policies Vivek Goyal
2012-02-02 20:36   ` Tejun Heo
2012-02-02 20:43     ` Vivek Goyal
2012-02-02 20:59       ` Tejun Heo

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=20120203194105.GA12616@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=ctalbott@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rni@google.com \
    --cc=tj@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;
as well as URLs for NNTP newsgroup(s).