Linux Container Development
 help / color / mirror / Atom feed
  • [parent not found: <1298394776-9957-5-git-send-email-arighi@develer.com>]
  • [parent not found: <1298394776-9957-4-git-send-email-arighi@develer.com>]
  • [parent not found: <20110222193403.GG28269@redhat.com>]
  • * [PATCH 0/5] blk-throttle: writeback and swap IO control
    @ 2011-02-22 17:12 Andrea Righi
      0 siblings, 0 replies; 41+ messages in thread
    From: Andrea Righi @ 2011-02-22 17:12 UTC (permalink / raw)
      To: Vivek Goyal
      Cc: Jens Axboe,
    	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
    	Daisuke Nishimura, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
    	Hirokazu Takahashi, linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Ryo Tsuruta,
    	Andrew Morton, Wu Fengguang, Balbir Singh
    
    Currently the blkio.throttle controller only support synchronous IO requests.
    This means that we always look at the current task to identify the "owner" of
    each IO request.
    
    However dirty pages in the page cache can be wrote to disk asynchronously by
    the per-bdi flusher kernel threads or by any other thread in the system,
    according to the writeback policy.
    
    For this reason the real writes to the underlying block devices may
    occur in a different IO context respect to the task that originally
    generated the dirty pages involved in the IO operation. This makes the
    tracking and throttling of writeback IO more complicate respect to the
    synchronous IO from the blkio controller's perspective.
    
    The same concept is also valid for anonymous pages involed in IO operations
    (swap).
    
    This patch allow to track the cgroup that originally dirtied each page in page
    cache and each anonymous page and pass these informations to the blk-throttle
    controller. These informations can be used to provide a better service level
    differentiation of buffered writes swap IO between different cgroups.
    
    Testcase
    ========
    - create a cgroup with 1MiB/s write limit:
      # mount -t cgroup -o blkio none /mnt/cgroup
      # mkdir /mnt/cgroup/foo
      # echo 8:0 $((1024 * 1024)) > /mnt/cgroup/foo/blkio.throttle.write_bps_device
    
    - move a task into the cgroup and run a dd to generate some writeback IO
    
    Results:
      - 2.6.38-rc6 vanilla:
      $ cat /proc/$$/cgroup
      1:blkio:/foo
      $ dd if=/dev/zero of=zero bs=1M count=1024 &
      $ dstat -df
      --dsk/sda--
       read  writ
         0    19M
         0    19M
         0     0
         0     0
         0    19M
      ...
    
      - 2.6.38-rc6 + blk-throttle writeback IO control:
      $ cat /proc/$$/cgroup
      1:blkio:/foo
      $ dd if=/dev/zero of=zero bs=1M count=1024 &
      $ dstat -df
      --dsk/sda--
       read  writ
         0  1024
         0  1024
         0  1024
         0  1024
         0  1024
      ...
    
    TODO
    ====
     - lots of testing
    
    Any feedback is welcome.
    -Andrea
    
    [PATCH 1/5] blk-cgroup: move blk-cgroup.h in include/linux/blk-cgroup.h
    [PATCH 2/5] blk-cgroup: introduce task_to_blkio_cgroup()
    [PATCH 3/5] page_cgroup: make page tracking available for blkio
    [PATCH 4/5] blk-throttle: track buffered and anonymous pages
    [PATCH 5/5] blk-throttle: buffered and anonymous page tracking instrumentation
    
     block/Kconfig               |    2 +
     block/blk-cgroup.c          |   15 ++-
     block/blk-cgroup.h          |  335 ------------------------------------------
     block/blk-throttle.c        |   89 +++++++++++-
     block/cfq.h                 |    2 +-
     fs/buffer.c                 |    1 +
     include/linux/blk-cgroup.h  |  341 +++++++++++++++++++++++++++++++++++++++++++
     include/linux/blkdev.h      |   26 +++-
     include/linux/memcontrol.h  |    6 +
     include/linux/mmzone.h      |    4 +-
     include/linux/page_cgroup.h |   33 ++++-
     init/Kconfig                |    4 +
     mm/Makefile                 |    3 +-
     mm/bounce.c                 |    1 +
     mm/filemap.c                |    1 +
     mm/memcontrol.c             |    6 +
     mm/memory.c                 |    5 +
     mm/page-writeback.c         |    1 +
     mm/page_cgroup.c            |  129 +++++++++++++++--
     mm/swap_state.c             |    2 +
     20 files changed, 649 insertions(+), 357 deletions(-)
    
    ^ permalink raw reply	[flat|nested] 41+ messages in thread

    end of thread, other threads:[~2011-03-23 18:48 UTC | newest]
    
    Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <1298394776-9957-1-git-send-email-arighi@develer.com>
         [not found] ` <1298394776-9957-1-git-send-email-arighi-vWjgImWzx8FBDgjK7y7TUQ@public.gmane.org>
    2011-02-22 17:12   ` [PATCH 1/5] blk-cgroup: move blk-cgroup.h in include/linux/blk-cgroup.h Andrea Righi
    2011-02-22 17:12   ` [PATCH 2/5] blk-cgroup: introduce task_to_blkio_cgroup() Andrea Righi
    2011-02-22 17:12   ` [PATCH 3/5] page_cgroup: make page tracking available for blkio Andrea Righi
    2011-02-22 17:12   ` [PATCH 4/5] blk-throttle: track buffered and anonymous pages Andrea Righi
    2011-02-22 17:12   ` [PATCH 5/5] blk-throttle: buffered and anonymous page tracking instrumentation Andrea Righi
    2011-02-22 19:34   ` [PATCH 0/5] blk-throttle: writeback and swap IO control Vivek Goyal
    2011-02-24  6:08   ` Balbir Singh
         [not found] ` <1298394776-9957-5-git-send-email-arighi@develer.com>
         [not found]   ` <1298394776-9957-5-git-send-email-arighi-vWjgImWzx8FBDgjK7y7TUQ@public.gmane.org>
    2011-02-22 18:42     ` [PATCH 4/5] blk-throttle: track buffered and anonymous pages Chad Talbott
    2011-02-22 21:00     ` Vivek Goyal
         [not found]   ` <AANLkTinD2ZH3hw_iqVpvMjMRbUkXMBgttjd2NevvYq9x@mail.gmail.com>
         [not found]     ` <AANLkTinD2ZH3hw_iqVpvMjMRbUkXMBgttjd2NevvYq9x-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
    2011-02-22 19:12       ` Andrea Righi
    2011-02-22 20:49       ` Vivek Goyal
         [not found]     ` <20110222204928.GH28269@redhat.com>
         [not found]       ` <20110222204928.GH28269-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    2011-02-22 23:03         ` Andrea Righi
         [not found]   ` <20110222210030.GI28269@redhat.com>
         [not found]     ` <20110222210030.GI28269-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    2011-02-22 23:05       ` Andrea Righi
         [not found]     ` <20110222230534.GD23723@linux.develer.com>
         [not found]       ` <20110222230534.GD23723-fxUVXftIFDlZdMzt4l2sLQC/G2K4zDHf@public.gmane.org>
    2011-02-23  0:07         ` Vivek Goyal
         [not found]       ` <20110223000718.GN28269@redhat.com>
         [not found]         ` <20110223000718.GN28269-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    2011-02-23  8:37           ` Andrea Righi
         [not found] ` <1298394776-9957-4-git-send-email-arighi@develer.com>
         [not found]   ` <1298394776-9957-4-git-send-email-arighi-vWjgImWzx8FBDgjK7y7TUQ@public.gmane.org>
    2011-02-22 20:01     ` [PATCH 3/5] page_cgroup: make page tracking available for blkio Jonathan Corbet
    2011-02-22 21:22     ` Vivek Goyal
         [not found]   ` <20110222130145.37cb151e@bike.lwn.net>
         [not found]     ` <20110222130145.37cb151e-vw3g6Xz/EtPk1uMJSBkQmQ@public.gmane.org>
    2011-02-22 21:57       ` Vivek Goyal
    2011-02-22 23:01       ` Andrea Righi
         [not found]     ` <20110222230146.GB23723@linux.develer.com>
         [not found]       ` <20110222230146.GB23723-fxUVXftIFDlZdMzt4l2sLQC/G2K4zDHf@public.gmane.org>
    2011-02-22 23:06         ` Vivek Goyal
    2011-02-22 23:27         ` Jonathan Corbet
         [not found]       ` <20110222230630.GL28269@redhat.com>
         [not found]         ` <20110222230630.GL28269-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    2011-02-22 23:21           ` Jonathan Corbet
    2011-02-22 23:37           ` Andrea Righi
         [not found]         ` <20110222233718.GF23723@linux.develer.com>
         [not found]           ` <20110222233718.GF23723-fxUVXftIFDlZdMzt4l2sLQC/G2K4zDHf@public.gmane.org>
    2011-02-23  4:49             ` KAMEZAWA Hiroyuki
         [not found]           ` <20110223134910.abbdc931.kamezawa.hiroyu@jp.fujitsu.com>
         [not found]             ` <20110223134910.abbdc931.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
    2011-02-23  8:59               ` Andrea Righi
         [not found]             ` <20110223085911.GC2174@linux.develer.com>
         [not found]               ` <20110223085911.GC2174-fxUVXftIFDlZdMzt4l2sLQC/G2K4zDHf@public.gmane.org>
    2011-02-23 23:58                 ` KAMEZAWA Hiroyuki
         [not found]               ` <20110224085805.14766e93.kamezawa.hiroyu@jp.fujitsu.com>
         [not found]                 ` <20110224085805.14766e93.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
    2011-02-25  0:48                   ` Andrea Righi
         [not found]       ` <20110222162729.054fe596@bike.lwn.net>
         [not found]         ` <20110222162729.054fe596-vw3g6Xz/EtPk1uMJSBkQmQ@public.gmane.org>
    2011-02-22 23:48           ` Andrea Righi
         [not found]   ` <20110222212253.GJ28269@redhat.com>
         [not found]     ` <20110222212253.GJ28269-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    2011-02-22 23:08       ` Andrea Righi
         [not found] ` <20110222193403.GG28269@redhat.com>
         [not found]   ` <20110222193403.GG28269-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    2011-02-22 22:41     ` [PATCH 0/5] blk-throttle: writeback and swap IO control Andrea Righi
         [not found]   ` <20110222224141.GA23723@linux.develer.com>
         [not found]     ` <20110222224141.GA23723-fxUVXftIFDlZdMzt4l2sLQC/G2K4zDHf@public.gmane.org>
    2011-02-23  0:03       ` Vivek Goyal
         [not found]     ` <20110223000358.GM28269@redhat.com>
         [not found]       ` <20110223000358.GM28269-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    2011-02-23  8:32         ` Andrea Righi
         [not found]       ` <20110223083206.GA2174@linux.develer.com>
         [not found]         ` <20110223083206.GA2174-fxUVXftIFDlZdMzt4l2sLQC/G2K4zDHf@public.gmane.org>
    2011-02-23 15:23           ` Vivek Goyal
         [not found]         ` <20110223152354.GA2526@redhat.com>
         [not found]           ` <20110223152354.GA2526-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    2011-02-23 23:14             ` Andrea Righi
         [not found]           ` <20110223231410.GB1744@linux.develer.com>
         [not found]             ` <20110223231410.GB1744-fxUVXftIFDlZdMzt4l2sLQC/G2K4zDHf@public.gmane.org>
    2011-02-24  0:10               ` Vivek Goyal
         [not found]             ` <20110224001033.GF2526@redhat.com>
         [not found]               ` <20110224094039.89c07bea.kamezawa.hiroyu@jp.fujitsu.com>
         [not found]                 ` <20110224094039.89c07bea.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
    2011-02-24  2:01                   ` Greg Thelen
    2011-02-24 16:18                   ` Vivek Goyal
         [not found]                     ` <20110224161844.GD18494__23141.7772280567$1298564487$gmane$org-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    2011-03-23 18:48                       ` Daniel Poelzleithner
         [not found]               ` <20110224001033.GF2526-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    2011-02-24  0:40                 ` KAMEZAWA Hiroyuki
    2011-02-25  0:54                 ` Andrea Righi
    2011-02-22 17:12 Andrea Righi
    

    This is a public inbox, see mirroring instructions
    for how to clone and mirror all data and code used for this inbox