public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Divyesh Shah <dpshah@google.com>
Cc: linux-kernel@vger.kernel.org, jens.axboe@oracle.com,
	nauman@google.com, lizf@cn.fujitsu.com, ryov@valinux.co.jp,
	fernando@oss.ntt.co.jp, s-uchida@ap.jp.nec.com,
	taka@valinux.co.jp, guijianfeng@cn.fujitsu.com,
	jmoyer@redhat.com, righi.andrea@gmail.com, m-ikeda@ds.jp.nec.com,
	czoccolo@gmail.com, Alan.Brunelle@hp.com
Subject: Re: [PATCH 06/21] blkio: Introduce blkio controller cgroup interface
Date: Wed, 2 Dec 2009 10:27:22 -0500	[thread overview]
Message-ID: <20091202152722.GD31715@redhat.com> (raw)
In-Reply-To: <af41c7c40911301604k1580bcafg9ef7aa7445ba5d17@mail.gmail.com>

On Tue, Dec 01, 2009 at 05:34:37AM +0530, Divyesh Shah wrote:
> On Mon, Nov 30, 2009 at 8:29 AM, Vivek Goyal <vgoyal@redhat.com> wrote:
> > o This is basic implementation of blkio controller cgroup interface. This is
> >  the common interface visible to user space and should be used by different
> >  IO control policies as we implement those.
> >
> > Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
> > ---
> >  block/Kconfig                 |   13 +++
> >  block/Kconfig.iosched         |    1 +
> >  block/Makefile                |    1 +
> >  block/blk-cgroup.c            |  177 +++++++++++++++++++++++++++++++++++++++++
> >  block/blk-cgroup.h            |   58 +++++++++++++
> >  include/linux/cgroup_subsys.h |    6 ++
> >  include/linux/iocontext.h     |    4 +
> >  7 files changed, 260 insertions(+), 0 deletions(-)
> >  create mode 100644 block/blk-cgroup.c
> >  create mode 100644 block/blk-cgroup.h
> >
> > diff --git a/block/Kconfig b/block/Kconfig
> > index 9be0b56..6ba1a8e 100644
> > --- a/block/Kconfig
> > +++ b/block/Kconfig
> > @@ -77,6 +77,19 @@ config BLK_DEV_INTEGRITY
> >        T10/SCSI Data Integrity Field or the T13/ATA External Path
> >        Protection.  If in doubt, say N.
> >
> > +config BLK_CGROUP
> > +       bool
> > +       depends on CGROUPS
> > +       default n
> > +       ---help---
> > +       Generic block IO controller cgroup interface. This is the common
> > +       cgroup interface which should be used by various IO controlling
> > +       policies.
> > +
> > +       Currently, CFQ IO scheduler uses it to recognize task groups and
> > +       control disk bandwidth allocation (proportional time slice allocation)
> > +       to such task groups.
> > +
> >  endif # BLOCK
> >
> >  config BLOCK_COMPAT
> > diff --git a/block/Kconfig.iosched b/block/Kconfig.iosched
> > index 8bd1051..be0280d 100644
> > --- a/block/Kconfig.iosched
> > +++ b/block/Kconfig.iosched
> > @@ -23,6 +23,7 @@ config IOSCHED_DEADLINE
> >
> >  config IOSCHED_CFQ
> >        tristate "CFQ I/O scheduler"
> > +       select BLK_CGROUP
> >        default y
> >        ---help---
> >          The CFQ I/O scheduler tries to distribute bandwidth equally
> > diff --git a/block/Makefile b/block/Makefile
> > index 7914108..cb2d515 100644
> > --- a/block/Makefile
> > +++ b/block/Makefile
> > @@ -8,6 +8,7 @@ obj-$(CONFIG_BLOCK) := elevator.o blk-core.o blk-tag.o blk-sysfs.o \
> >                        blk-iopoll.o ioctl.o genhd.o scsi_ioctl.o
> >
> >  obj-$(CONFIG_BLK_DEV_BSG)      += bsg.o
> > +obj-$(CONFIG_BLK_CGROUP)       += blk-cgroup.o
> >  obj-$(CONFIG_IOSCHED_NOOP)     += noop-iosched.o
> >  obj-$(CONFIG_IOSCHED_DEADLINE) += deadline-iosched.o
> >  obj-$(CONFIG_IOSCHED_CFQ)      += cfq-iosched.o
> > diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
> > new file mode 100644
> > index 0000000..4f6afd7
> > --- /dev/null
> > +++ b/block/blk-cgroup.c
> > @@ -0,0 +1,177 @@
> > +/*
> > + * Common Block IO controller cgroup interface
> > + *
> > + * Based on ideas and code from CFQ, CFS and BFQ:
> > + * Copyright (C) 2003 Jens Axboe <axboe@kernel.dk>
> > + *
> > + * Copyright (C) 2008 Fabio Checconi <fabio@gandalf.sssup.it>
> > + *                   Paolo Valente <paolo.valente@unimore.it>
> > + *
> > + * Copyright (C) 2009 Vivek Goyal <vgoyal@redhat.com>
> > + *                   Nauman Rafique <nauman@google.com>
> > + */
> > +#include <linux/ioprio.h>
> > +#include "blk-cgroup.h"
> > +
> > +struct blkio_cgroup blkio_root_cgroup = { .weight = 2*BLKIO_WEIGHT_DEFAULT };
> 
> This should use BLKIO_WEIGHT_MAX as 2*BLKIO_WEIGHT_DEFAULT is same as
> BLKIO_WEIGHT_MAX unless there is a reason why you would want the value
> to remain as a multiple of default_weight instead of max in case the
> constants change later.
> 

Hi Divyesh,

Every new group gets the weight as BLKIO_WEIGHT_DEFAULT. For root group by 
default I wanted to give it double the weight to begin with as it will
have all the async queues, will also have all the sync-noidle queues 
(in case of group_isolation=0) and will be doing all the system IO.

That's a different thing that 2*BLKIO_WEIGHT_DEFAULT happens to be same
as BLKIO_WEIGHT_MAX.

So functionality wise it does not change anything. It is just a matter of
what is more intutive as a root group default.

To me 2*BLKIO_WEIGHT_DEFAULT looks just fine. So I will keep it as it is,
unless you really think that it is not intutive and BLKIO_WEIGHT_MAX is
more intutive.

Thanks
Vivek

  reply	other threads:[~2009-12-02 15:29 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-30  2:59 Block IO Controller V4 Vivek Goyal
2009-11-30  2:59 ` [PATCH 01/21] blkio: Set must_dispatch only if we decided to not dispatch the request Vivek Goyal
2009-12-02 14:06   ` Jeff Moyer
2009-11-30  2:59 ` [PATCH 02/21] blkio: Introduce the notion of cfq groups Vivek Goyal
2009-11-30  2:59 ` [PATCH 03/21] blkio: Implement macro to traverse each idle tree in group Vivek Goyal
2009-11-30 20:13   ` Divyesh Shah
2009-11-30 22:24     ` Vivek Goyal
2009-11-30  2:59 ` [PATCH 04/21] blkio: Keep queue on service tree until we expire it Vivek Goyal
2009-11-30  2:59 ` [PATCH 05/21] blkio: Introduce the root service tree for cfq groups Vivek Goyal
2009-11-30 23:55   ` Divyesh Shah
2009-12-02 15:42     ` Vivek Goyal
2009-12-02 15:49   ` Vivek Goyal
2009-11-30  2:59 ` [PATCH 06/21] blkio: Introduce blkio controller cgroup interface Vivek Goyal
2009-12-01  0:04   ` Divyesh Shah
2009-12-02 15:27     ` Vivek Goyal [this message]
2009-11-30  2:59 ` [PATCH 07/21] blkio: Introduce per cfq group weights and vdisktime calculations Vivek Goyal
2009-12-02 15:50   ` Vivek Goyal
2009-11-30  2:59 ` [PATCH 08/21] blkio: Implement per cfq group latency target and busy queue avg Vivek Goyal
2009-11-30  2:59 ` [PATCH 09/21] blkio: Group time used accounting and workload context save restore Vivek Goyal
2009-11-30  2:59 ` [PATCH 10/21] blkio: Dynamic cfq group creation based on cgroup tasks belongs to Vivek Goyal
2009-11-30  2:59 ` [PATCH 11/21] blkio: Take care of cgroup deletion and cfq group reference counting Vivek Goyal
2009-11-30  2:59 ` [PATCH 12/21] blkio: Some debugging aids for CFQ Vivek Goyal
2009-11-30  2:59 ` [PATCH 13/21] blkio: Export disk time and sectors used by a group to user space Vivek Goyal
2009-11-30  2:59 ` [PATCH 14/21] blkio: Provide some isolation between groups Vivek Goyal
2009-11-30  2:59 ` [PATCH 15/21] blkio: Drop the reference to queue once the task changes cgroup Vivek Goyal
2009-11-30  2:59 ` [PATCH 16/21] blkio: Propagate cgroup weight updation to cfq groups Vivek Goyal
2009-11-30  2:59 ` [PATCH 17/21] blkio: Wait for cfq queue to get backlogged if group is empty Vivek Goyal
2009-11-30  2:59 ` [PATCH 18/21] blkio: Determine async workload length based on total number of queues Vivek Goyal
2009-11-30  2:59 ` [PATCH 19/21] blkio: Implement group_isolation tunable Vivek Goyal
2009-11-30  2:59 ` [PATCH 20/21] blkio: Wait on sync-noidle queue even if rq_noidle = 1 Vivek Goyal
2009-11-30  2:59 ` [PATCH 21/21] blkio: Documentation Vivek Goyal
2009-11-30 15:34 ` Block IO Controller V4 Corrado Zoccolo
2009-11-30 16:00   ` Vivek Goyal
2009-11-30 21:34     ` Corrado Zoccolo
2009-11-30 21:58       ` Vivek Goyal
2009-11-30 22:00       ` Alan D. Brunelle
2009-11-30 22:56         ` Vivek Goyal
2009-11-30 23:50           ` Alan D. Brunelle
2009-12-02 19:12             ` Vivek Goyal
2009-12-08 15:17           ` Alan D. Brunelle
2009-12-08 16:32             ` Vivek Goyal
2009-12-08 18:05               ` Alan D. Brunelle
2009-12-10  3:44                 ` Vivek Goyal
2009-12-01 22:27 ` Vivek Goyal
2009-12-02  1:51 ` Gui Jianfeng
2009-12-02 14:25   ` Vivek Goyal
2009-12-03  8:41     ` Gui Jianfeng
2009-12-03 14:36       ` Vivek Goyal
2009-12-03 18:10         ` Vivek Goyal
2009-12-03 23:51           ` Vivek Goyal
2009-12-07  8:45             ` Gui Jianfeng
2009-12-07 15:25               ` Vivek Goyal
2009-12-07  1:35         ` Gui Jianfeng
2009-12-07  8:41           ` Gui Jianfeng

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=20091202152722.GD31715@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=Alan.Brunelle@hp.com \
    --cc=czoccolo@gmail.com \
    --cc=dpshah@google.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=nauman@google.com \
    --cc=righi.andrea@gmail.com \
    --cc=ryov@valinux.co.jp \
    --cc=s-uchida@ap.jp.nec.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