From: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
To: Chad Talbott <ctalbott@google.com>,
vgoyal@redhat.com, jens.axboe@oracle.com
Cc: mrubin@google.com, Li Zefan <lizf@cn.fujitsu.com>,
linux-kernel@vger.kernel.org, dpshah@google.com,
Nauman Rafique <nauman@google.com>
Subject: Re: [PATCH 0/4] io-controller: Use names rather than major:minor
Date: Fri, 26 Mar 2010 09:31:41 +0800 [thread overview]
Message-ID: <4BAC0E7D.9080305@cn.fujitsu.com> (raw)
In-Reply-To: <20100325180310.25299.64877.stgit@meat.mtv.corp.google.com>
Chad Talbott wrote:
> This stack (which includes Gui's patch for per-device weights),
> changes the various blkio.* stats to use the disks' names (sda, sdb,
> etc.) rather than major:minor pairs when printing statistics.
Hi Chad,
I have the same concern with Vivek. We'v already exported device number
pair to user since 2.6.33, It's better to keep the original ABI.
> Additionally setting a per-device policy can be done via the disk's
> name.
To keep things simple, can we add new API in block layer to lookup
device name by device number as following.
+int blk_lookup_devname(dev_t devt, char *name)
+{
+ struct class_dev_iter iter;
+ struct device *dev;
+ struct gendisk *disk;
+
+ class_dev_iter_init(&iter, &block_class, NULL, &disk_type);
+ while ((dev = class_dev_iter_next(&iter))) {
+ if (dev->devt != devt)
+ continue;
+
+ disk = dev_to_disk(dev);
+
+ disk_name(disk, 0, name);
+
+ return 0;
+ }
+ class_dev_iter_exit(&iter);
+
+ return 1;
+}
+EXPORT_SYMBOL(blk_lookup_devname);
+
So we can keep dev_t in blkio layer, and export to user a device name by calling
this function. Also, we retrive device number by calling blk_lookup_devt().
This change might keep things much simple. Jens, do you have any thoughts?
Thanks,
Gui
>
> This has the side effect of fixing the "root cgroup shows no stats"
> problem that Ricky mentioned.
>
> Chad
>
> ---
>
> Chad Talbott (4):
> blkio_group key change: void * -> request_queue *
> Adds an RCU-protected pointer to request_queue that makes it easy to
> io-controller: Add a new interface "weight_device" for IO-Controller
> Use disk-names to set blkio.weight_device policy
>
>
> block/blk-cgroup.c | 224 +++++++++++++++++++++++++++++++++++++++++++++---
> block/blk-cgroup.h | 23 ++++-
> block/blk-sysfs.c | 4 +
> block/cfq-iosched.c | 27 ++----
> include/linux/blkdev.h | 6 +
> 5 files changed, 248 insertions(+), 36 deletions(-)
>
>
>
>
next prev parent reply other threads:[~2010-03-26 1:32 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-25 18:04 [PATCH 0/4] io-controller: Use names rather than major:minor Chad Talbott
2010-03-25 18:04 ` [PATCH 1/4] blkio_group key change: void * -> request_queue * Chad Talbott
2010-03-25 23:25 ` Vivek Goyal
2010-03-26 0:17 ` Chad Talbott
2010-03-25 18:04 ` [PATCH 2/4] Adds an RCU-protected pointer to request_queue that makes it easy to Chad Talbott
2010-03-25 23:02 ` Vivek Goyal
2010-03-25 18:04 ` [PATCH 3/4] io-controller: Add a new interface "weight_device" for IO-Controller Chad Talbott
2010-03-25 18:04 ` [PATCH 4/4] Use disk-names to set blkio.weight_device policy Chad Talbott
2010-03-26 1:31 ` Gui Jianfeng [this message]
2010-03-26 15:20 ` [PATCH 0/4] io-controller: Use names rather than major:minor Vivek Goyal
2010-03-26 22:54 ` Chad Talbott
2010-03-26 23:21 ` Divyesh Shah
2010-03-27 0:28 ` Vivek Goyal
2010-03-27 0:20 ` Vivek Goyal
2010-03-27 0:24 ` Vivek Goyal
2010-03-27 0:30 ` 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=4BAC0E7D.9080305@cn.fujitsu.com \
--to=guijianfeng@cn.fujitsu.com \
--cc=ctalbott@google.com \
--cc=dpshah@google.com \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=mrubin@google.com \
--cc=nauman@google.com \
--cc=vgoyal@redhat.com \
/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