[RFC] block: add io timeout to sysfs

2018-11-17 Thread Weiping Zhang
Give a interface to adjust io timeout by device. Signed-off-by: Weiping Zhang --- block/blk-sysfs.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 80eef48fddc8..0cabfb935e71 100644 --- a/block/blk-sysfs.c +++ b/block

[RFC PATCH v2] block: add io timeout to sysfs

2018-11-19 Thread Weiping Zhang
Give a interface to adjust io timeout by device. Signed-off-by: Weiping Zhang --- Changes since v1: * make sure timeout > 0 block/blk-sysfs.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 80eef48fddc8..90a927514

Re: [PATCH] block: don't show io_timeout if driver has no timeout handler

2019-03-31 Thread weiping zhang
On Tue, Jan 08, 2019 at 04:57:40PM -0800, Bart Van Assche wrote: Hi Bart, Sorry to reply so late. > On Mon, 2019-01-07 at 20:52 +0800, Weiping Zhang wrote: > > If the low level driver has no timerout han

Re: [PATCH] block: don't show io_timeout if driver has no timeout handler

2019-04-02 Thread Weiping Zhang
Bart Van Assche 于2019年4月2日周二 上午6:41写道: > > On Sun, 2019-03-31 at 23:28 +0800, weiping zhang wrote: > > On Tue, Jan 08, 2019 at 04:57:40PM -0800, Bart Van Assche wrote: > > > > @@ -942,6 +961,14 @@ int blk_register_queue(struct gendisk *disk) >

[PATCH v2] block: don't show io_timeout if driver has no timeout handler

2019-04-02 Thread Weiping Zhang
If the low level driver has no timeout handler, the /sys/block//queue/io_timeout will not be displayed. Signed-off-by: Weiping Zhang --- Changes since v1: * don't call sysfs_remove_group explicitly * also check q->mq_ops otherwise bug at md driver [2.094516] internal_create_gr

Re: [PATCH v2] block: don't show io_timeout if driver has no timeout handler

2019-04-03 Thread Weiping Zhang
Bart Van Assche 于2019年4月3日周三 上午1:10写道: > > On Tue, 2019-04-02 at 21:14 +0800, Weiping Zhang wrote: > > [ ... ] > > -static struct attribute *default_attrs[] = { > > +static struct attribute *queue_attrs[] = { > > &queue_requests_entry.at

Re: [PATCH v2] block: don't show io_timeout if driver has no timeout handler

2019-04-22 Thread Weiping Zhang
Hi Jens, Ping Bart Van Assche 于2019年4月4日周四 上午12:54写道: > > On Tue, 2019-04-02 at 21:14 +0800, Weiping Zhang wrote: > > If the low level driver has no timeout handler, the > > /sys/block//queue/io_timeout will not be displayed. > > Reviewed-by: Bart Van Assche > >

[RFC PATCH 2/2] null_blk: add support weighted round robin submition queue

2019-06-03 Thread Weiping Zhang
Signed-off-by: Weiping Zhang --- drivers/block/null_blk.h | 7 + drivers/block/null_blk_main.c | 294 -- 2 files changed, 288 insertions(+), 13 deletions(-) diff --git a/drivers/block/null_blk.h b/drivers/block/null_blk.h index 34b22d6523ba

[RFC PATCH 1/2] block: add weighted round robin for blkcgroup

2019-06-03 Thread Weiping Zhang
Each block cgroup can select a weighted round robin type to make its io requests go to the specified haredware queue. Now we support three round robin type high, medium, low like what nvme specification donse. Signed-off-by: Weiping Zhang --- block/blk-cgroup.c | 88

[RFC PATCH 0/2] blkcg: add support weighted round robin tagset map

2019-06-03 Thread Weiping Zhang
cgroup.procs echo `pidof fio2` > /sys/fs/cgroup/blkio/medium/cgroup.procs echo `pidof fio3` > /sys/fs/cgroup/blkio/low/cgroup.procs fio1: 260K fio2: 160K fio3: 60K we dispatch 8(high), 4(medium), 1(low) ios at time, to simulate weighted round robin policy. Weiping Zhang (2): block: add weighte

Re: [RFC PATCH v2] block: add io timeout to sysfs

2018-11-28 Thread Weiping Zhang
Hi Jens, It's useful if user want a short timeout when a disk doesn't work normally. Would you give some comments for this patch, Thanks a lot Weiping Zhang 于2018年11月19日周一 下午10:30写道: > > Give a interface to adjust io timeout by device. > > Signed-off-by: Weiping Zhang &

[PATCH v3] block: add io timeout to sysfs

2018-11-28 Thread Weiping Zhang
Give a interface to adjust io timeout(ms) by device. Signed-off-by: Weiping Zhang --- Changes since v2: * use msecs_to_jiffies and jiffies_to_msecs Changes since v1: * make sure timeout > 0 block/blk-sysfs.c | 27 +++ 1 file changed, 27 insertions(+) diff --gi

[PATCH] block: add documentation for io_timeout

2018-11-28 Thread Weiping Zhang
add documentation for /sys/block//queue/io_timeout Signed-off-by: Weiping Zhang --- Documentation/ABI/testing/sysfs-block | 9 + Documentation/block/queue-sysfs.txt | 6 ++ 2 files changed, 15 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-block b/Documentation/ABI

[PATCH v2] block: add documentation for io_timeout

2018-11-29 Thread Weiping Zhang
add documentation for /sys/block//queue/io_timeout Signed-off-by: Weiping Zhang --- Documentation/ABI/testing/sysfs-block | 9 + Documentation/block/queue-sysfs.txt | 6 ++ 2 files changed, 15 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-block b/Documentation/ABI

[PATCH v3] block: add documentation for io_timeout

2018-12-05 Thread Weiping Zhang
Add documentation for /sys/block//queue/io_timeout. Signed-off-by: Weiping Zhang --- Documentation/ABI/testing/sysfs-block | 10 ++ Documentation/block/queue-sysfs.txt | 7 +++ 2 files changed, 17 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-block b/Documentation

Re: [PATCH v3] block: add documentation for io_timeout

2018-12-05 Thread Weiping Zhang
enum blk_eh_timer_return ret; ret = req->q->mq_ops->timeout(req, reserved); if (ret == BLK_EH_DONE) return; WARN_ON_ONCE(ret != BLK_EH_RESET_TIMER); } blk_add_timer(req); } > On Wed, Dec 05, 20

Re: [PATCH v3] block: add documentation for io_timeout

2018-12-05 Thread Weiping Zhang
Weiping Zhang 于2018年12月5日周三 下午10:49写道: > > Christoph Hellwig 于2018年12月5日周三 下午10:40写道: > > > > Can you please also send a patch to not show this attribute for > > drivers without a timeout handler? Thanks! > > Is there a simple way do that ? Shall we return -ENOT

[PATCH 0/2] get rid of BLK_MAX_TIMEOUT

2018-12-05 Thread Weiping Zhang
Get rid of BLK_MAX_TIMEOUT, since we want use io_timeout to control the maximun timeouts of a request, so remove this limitation. Weiping Zhang (2): block: get rid of BLK_MAX_TIMEOUT block: add BLK_DEF_TIMEOUT block/blk-mq.c | 2 +- block/blk-timeout.c | 13 + block/blk.h

[PATCH 2/2] block: add BLK_DEF_TIMEOUT

2018-12-05 Thread Weiping Zhang
Add an obvious definition for default request timeout. Signed-off-by: Weiping Zhang --- block/blk-mq.c | 2 +- block/blk.h| 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 900550594651..53337d5c37af 100644 --- a/block/blk-mq.c +++ b

[PATCH 1/2] block: get rid of BLK_MAX_TIMEOUT

2018-12-05 Thread Weiping Zhang
Since io_timeout was added to sysfs, the user can tune timeouts by that attribute, so kill this limitation. Signed-off-by: Weiping Zhang --- block/blk-timeout.c | 13 + block/blk.h | 4 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/block/blk-timeout.c

Re: [PATCH 1/2] block: get rid of BLK_MAX_TIMEOUT

2018-12-06 Thread Weiping Zhang
Bart Van Assche 于2018年12月5日周三 下午11:59写道: > > On Wed, 2018-12-05 at 23:37 +0800, Weiping Zhang wrote: > > @@ -130,7 +119,7 @@ void blk_add_timer(struct request *req) > >* than an existing one, modify the timer. Round up to next nearest > >* second. > &

Re: [PATCH v3] block: add documentation for io_timeout

2018-12-25 Thread Weiping Zhang
Bart Van Assche 于2018年12月7日周五 上午12:22写道: > > On Wed, 2018-12-05 at 22:17 +0800, Weiping Zhang wrote: > > +Description: > > + io_timeout is a request’s timeouts at block layer in > > + milliseconds. When the underlying driver starts processing >

[PATCH v4] block: add documentation for io_timeout

2018-12-25 Thread Weiping Zhang
Add documentation for /sys/block//queue/io_timeout. Signed-off-by: Weiping Zhang --- Documentation/ABI/testing/sysfs-block | 9 + Documentation/block/queue-sysfs.txt | 7 +++ 2 files changed, 16 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-block b/Documentation/ABI

[PATCH] block: don't show io_timeout if driver has no timeout handler

2019-01-07 Thread Weiping Zhang
If the low level driver has no timerout handler, the /sys/block//queue/io_timeout will not be displayed. Signed-off-by: Weiping Zhang --- block/blk-sysfs.c | 33 +++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/block/blk-sysfs.c b/block/blk

[PATCH] loop: check loop_add's return value

2017-10-25 Thread weiping zhang
do cleanup if loop_add fail. Signed-off-by: weiping zhang --- drivers/block/loop.c | 30 -- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index bc8e61506968..9bea70a7da16 100644 --- a/drivers/block/loop.c

[PATCH 0/4] add error handle for bdi debugfs register

2017-10-26 Thread weiping zhang
this series add error handle for bdi debugfs register flow, the first three patches try to convert void function to int and do some cleanup if create dir or file fail. the fourth patch only add a WARN_ON in device_add_disk, no function change. weiping zhang (4): bdi: add check for

[PATCH 1/4] bdi: add check for bdi_debug_root

2017-10-26 Thread weiping zhang
this patch add a check for bdi_debug_root and do error handle for it. we should make sure it was created success, otherwise when add new block device's bdi folder(eg, 8:0) will be create a debugfs root directory. Signed-off-by: weiping zhang --- mm/backing-dev.c | 17 ++--- 1

[PATCH 2/4] bdi: convert bdi_debug_register to int

2017-10-26 Thread weiping zhang
Convert bdi_debug_register to int and then do error handle for it. Signed-off-by: weiping zhang --- mm/backing-dev.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 5072be19d9b2..e9d6a1ede12b 100644 --- a/mm

[PATCH 3/4] bdi: add error handle for bdi_debug_register

2017-10-26 Thread weiping zhang
In order to make error handle more cleaner we call bdi_debug_register before set state to WB_registered, that we can avoid call bdi_unregister in release_bdi(). Signed-off-by: weiping zhang --- mm/backing-dev.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mm/backing

[PATCH 4/4] block: add WARN_ON if bdi register fail

2017-10-26 Thread weiping zhang
device_add_disk need do more safety error handle, so this patch just add WARN_ON. Signed-off-by: weiping zhang --- block/genhd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/block/genhd.c b/block/genhd.c index dd305c65ffb0..cb55eea821eb 100644 --- a/block/genhd.c +++ b

Re: [PATCH 1/4] bdi: add check for bdi_debug_root

2017-10-31 Thread weiping zhang
On Mon, Oct 30, 2017 at 02:00:28PM +0100, Jan Kara wrote: > On Fri 27-10-17 01:35:36, weiping zhang wrote: > > this patch add a check for bdi_debug_root and do error handle for it. > > we should make sure it was created success, otherwise when add new > > block device's b

Re: [PATCH 3/4] bdi: add error handle for bdi_debug_register

2017-10-31 Thread weiping zhang
On Mon, Oct 30, 2017 at 02:10:16PM +0100, Jan Kara wrote: > On Fri 27-10-17 01:36:14, weiping zhang wrote: > > In order to make error handle more cleaner we call bdi_debug_register > > before set state to WB_registered, that we can avoid call bdi_unregister > > in release_b

Re: [PATCH 4/4] block: add WARN_ON if bdi register fail

2017-10-31 Thread weiping zhang
On Mon, Oct 30, 2017 at 02:14:30PM +0100, Jan Kara wrote: > On Fri 27-10-17 01:36:42, weiping zhang wrote: > > device_add_disk need do more safety error handle, so this patch just > > add WARN_ON. > > > > Signed-off-by: weiping zhang > > --- > > block/

[PATCH v2 0/3] add error handle for bdi debugfs register

2017-10-31 Thread weiping zhang
_owner->bdi_register, this call stack need more safety cleanup, so patch3 add an WARN_ON. weiping zhang (3): bdi: convert bdi_debug_register to int bdi: add error handle for bdi_debug_register block: add WARN_ON if bdi register fail block/genhd.c| 2 +- mm/backing-dev.c | 22

[PATCH v2 2/3] bdi: add error handle for bdi_debug_register

2017-10-31 Thread weiping zhang
In order to make error handle more cleaner we call bdi_debug_register before set state to WB_registered, that we can avoid call bdi_unregister in release_bdi(). Signed-off-by: weiping zhang --- mm/backing-dev.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mm/backing

[PATCH v2 1/3] bdi: convert bdi_debug_register to int

2017-10-31 Thread weiping zhang
Convert bdi_debug_register to int and then do error handle for it. Reviewed-by: Jan Kara Signed-off-by: weiping zhang --- mm/backing-dev.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 74b52dfd5852..b5f940ce0143

[PATCH v2 3/3] block: add WARN_ON if bdi register fail

2017-10-31 Thread weiping zhang
device_add_disk need do more safety error handle, so this patch just add WARN_ON. Reviewed-by: Jan Kara Signed-off-by: weiping zhang --- block/genhd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/genhd.c b/block/genhd.c index dd305c65ffb0..52834433878c 100644 --- a

Re: [PATCH v4] blk-mq: fix nr_requests wrong value when modify it from sysfs

2017-11-03 Thread weiping zhang
On Fri, Sep 22, 2017 at 11:36:28PM +0800, weiping zhang wrote: > if blk-mq use "none" io scheduler, nr_request get a wrong value when > input a number > tag_set->queue_depth. blk_mq_tag_update_depth will get > the smaller one min(nr, set->queue_depth), and then q->

[PATCH] blkcg: add wrappers for struct blkcg_policy operations

2017-11-09 Thread weiping zhang
Some blkcg policies may not implement all operations in struct blkcg_policy, there are lots of "if (pol->xxx)", add wrappers for these pol->xxx_fn. Signed-off-by: weiping zhang --- block/blk-cgroup.c | 55 +-- include/linux/b

Re: [PATCH v2 2/3] bdi: add error handle for bdi_debug_register

2017-11-17 Thread weiping zhang
On Wed, Nov 01, 2017 at 02:47:22PM +0100, Jan Kara wrote: > On Tue 31-10-17 18:38:24, weiping zhang wrote: > > In order to make error handle more cleaner we call bdi_debug_register > > before set state to WB_registered, that we can avoid call bdi_unregister > > in release_b

[PATCH 0/5] cleanup for blk-wbt

2017-11-23 Thread weiping zhang
Hi Jens, several cleanup for blk-wbt, no function change, thanks weiping zhang (5): blk-wbt: remove duplicated setting in wbt_init blk-wbt: cleanup comments to one line blk-sysfs: remove NULL pointer checking in queue_wb_lat_store blk-wbt: move wbt_clear_stat to common place in wbt_done

[PATCH 1/5] blk-wbt: remove duplicated setting in wbt_init

2017-11-23 Thread weiping zhang
rwb->wc and rwb->queue_depth were overwritten by wbt_set_write_cache and wbt_set_queue_depth, remove the default setting. Signed-off-by: weiping zhang --- block/blk-wbt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/block/blk-wbt.c b/block/blk-wbt.c index e59d59c..edb09e93 100644

[PATCH 3/5] blk-sysfs: remove NULL pointer checking in queue_wb_lat_store

2017-11-23 Thread weiping zhang
wbt_init doesn't set q->rq_wb to NULL, if wbt_init return 0, so check return value is enough, remove NULL checking. Signed-off-by: weiping zhang --- block/blk-sysfs.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index

[PATCH 2/5] blk-wbt: cleanup comments to one line

2017-11-23 Thread weiping zhang
Signed-off-by: weiping zhang --- block/blk-wbt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/block/blk-wbt.c b/block/blk-wbt.c index edb09e93..0fb65f0 100644 --- a/block/blk-wbt.c +++ b/block/blk-wbt.c @@ -729,9 +729,7 @@ int wbt_init(struct request_queue *q

[PATCH 4/5] blk-wbt: move wbt_clear_stat to common place in wbt_done

2017-11-23 Thread weiping zhang
wbt_done call wbt_clear_stat no matter current stat was tracked or not, move it to common place. Signed-off-by: weiping zhang --- block/blk-wbt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/blk-wbt.c b/block/blk-wbt.c index 0fb65f0..cd9a20a 100644 --- a/block/blk

[PATCH 5/5] blk-wbt: fix comments typo

2017-11-23 Thread weiping zhang
Signed-off-by: weiping zhang --- block/blk-wbt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-wbt.c b/block/blk-wbt.c index cd9a20a..9f4ef9c 100644 --- a/block/blk-wbt.c +++ b/block/blk-wbt.c @@ -481,7 +481,7 @@ static inline unsigned int get_limit(struct rq_wb

[RFC PATCH] blk-throttle: export io_serviced_recursive, io_service_bytes_recursive

2017-11-27 Thread weiping zhang
export these two interface for cgroup-v1. Signed-off-by: weiping zhang --- block/blk-throttle.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 96ad326..1d7637f 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c

[RFC] blk-throttle: export io_serviced_recursive, io_service_bytes_recursive

2017-12-11 Thread weiping zhang
export these two interface for cgroup-v1. Signed-off-by: weiping zhang --- block/blk-throttle.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 96ad326..1d7637f 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c

Re: Regression with a0747a859ef6 ("bdi: add error handle for bdi_debug_register")

2017-12-14 Thread weiping zhang
ebug patch, I add some debug log, no function change, thanks. >From d2728c07589e8b83115a51e0c629451bff7308db Mon Sep 17 00:00:00 2001 From: weiping zhang Date: Thu, 14 Dec 2017 17:56:22 +0800 Subject: [PATCH] bdi debugfs Signed-off-by: weiping zhang --- mm/backing-dev.c | 28 ++

Re: Regression with a0747a859ef6 ("bdi: add error handle for bdi_debug_register")

2017-12-14 Thread weiping zhang
2017-12-14 23:41 GMT+08:00 Bruno Wolff III : > On Thu, Dec 14, 2017 at 18:09:27 +0800, > weiping zhang wrote: >> >> >> It seems something wrong with bdi debugfs register, could you help >> test the forllowing debug patch, I add some debug log, no function >>

Re: Regression with a0747a859ef6 ("bdi: add error handle for bdi_debug_register")

2017-12-14 Thread weiping zhang
2017-12-15 9:44 GMT+08:00 Bruno Wolff III : > On Fri, Dec 15, 2017 at 09:22:21 +0800, > weiping zhang wrote: >> >> >> Thanks your testing, but I cann't find WARN_ON in device_add_disk from >> this boot1.log, could you help reproduce that issue? And does this is

Re: Regression with a0747a859ef6 ("bdi: add error handle for bdi_debug_register")

2017-12-15 Thread weiping zhang
2017-12-15 19:10 GMT+08:00 Bruno Wolff III : > On Fri, Dec 15, 2017 at 10:04:32 +0800, > weiping zhang wrote: >> >> I just want to know WARN_ON WHAT in device_add_disk, >> if bdi_register_owner return error code, it may fail at any step of >> following: > > &g

Re: Regression with a0747a859ef6 ("bdi: add error handle for bdi_debug_register")

2017-12-17 Thread weiping zhang
2017-12-17 0:32 GMT+08:00 Bruno Wolff III : > On Fri, Dec 15, 2017 at 13:51:22 -0600, > Bruno Wolff III wrote: >> >> >> I do not know what is different. Do you have any ideas? Most likely I >> won't be able to test any more kernels until Monday (unless I can use most >> of my most recent build ov

Re: Regression with a0747a859ef6 ("bdi: add error handle for bdi_debug_register")

2017-12-21 Thread weiping zhang
2017-12-21 21:00 GMT+08:00 Bruno Wolff III : > After today, I won't have physical access to the problem machine until > January 2nd. So if you guys have any testing suggestions I need them soon if > they are to get done before my vacation. > I do plan to try booting to level 1 to see if I can get a

Re: Regression with a0747a859ef6 ("bdi: add error handle for bdi_debug_register")

2017-12-21 Thread weiping zhang
2017-12-21 23:18 GMT+08:00 Bruno Wolff III : > On Thu, Dec 21, 2017 at 22:01:33 +0800, > weiping zhang wrote: >> >> Hi, >> how do you do bisect ?build all kernel commit one by one ? >> as you did before: >> https://bugzilla.redhat.com/show_bug.cgi?id=1520982 &

Re: Regression with a0747a859ef6 ("bdi: add error handle for bdi_debug_register")

2017-12-21 Thread weiping zhang
2017-12-21 23:36 GMT+08:00 Bruno Wolff III : > On Thu, Dec 21, 2017 at 23:31:40 +0800, > weiping zhang wrote: >> >> does every time boot fail can trigger WANRING in device_add_disk ? > > > Not that I see. But the message could scroll off the screen. The boot gets >

Re: Regression with a0747a859ef6 ("bdi: add error handle for bdi_debug_register")

2017-12-21 Thread weiping zhang
2017-12-22 1:02 GMT+08:00 Jens Axboe : > On 12/21/17 9:42 AM, Bruno Wolff III wrote: >> On Thu, Dec 21, 2017 at 23:48:19 +0800, >> weiping zhang wrote: >>>> output you want. I never saw it for any kernels I compiled myself. Only >>>> when >>

Re: Regression with a0747a859ef6 ("bdi: add error handle for bdi_debug_register")

2017-12-22 Thread weiping zhang
2017-12-22 12:53 GMT+08:00 Bruno Wolff III : > On Thu, Dec 21, 2017 at 17:16:03 -0600, > Bruno Wolff III wrote: >> >> >> Enforcing mode alone isn't enough as I tested that one one machine at home >> and it didn't trigger the problem. I'll try another machine late tonight. > > > I got the problem

Re: Regression with a0747a859ef6 ("bdi: add error handle for bdi_debug_register")

2017-12-29 Thread weiping zhang
On Fri, Dec 22, 2017 at 08:04:23AM -0600, Bruno Wolff III wrote: > On Fri, Dec 22, 2017 at 21:20:10 +0800, > weiping zhang wrote: > >2017-12-22 12:53 GMT+08:00 Bruno Wolff III : > >>On Thu, Dec 21, 2017 at 17:16:03 -0600, > >> Bruno Wolff III wrote: > >>

Re: Regression with a0747a859ef6 ("bdi: add error handle for bdi_debug_register")

2017-12-29 Thread weiping zhang
On Fri, Dec 22, 2017 at 08:04:23AM -0600, Bruno Wolff III wrote: > On Fri, Dec 22, 2017 at 21:20:10 +0800, > weiping zhang wrote: > >2017-12-22 12:53 GMT+08:00 Bruno Wolff III : > >>On Thu, Dec 21, 2017 at 17:16:03 -0600, > >> Bruno Wolff III wrote: > >>

Re: [RFC] blk-throttle: export io_serviced_recursive, io_service_bytes_recursive

2017-12-29 Thread weiping zhang
2017-12-11 23:17 GMT+08:00 Tejun Heo : > On Mon, Dec 11, 2017 at 10:56:25PM +0800, weiping zhang wrote: >> export these two interface for cgroup-v1. >> >> Signed-off-by: weiping zhang > > Acked-by: Tejun Heo > > Thanks. > Hi Jens, these two interface are use

[PATCH] bdi: show error log when fail to create bdi debugfs entry

2018-01-10 Thread weiping zhang
bdi debugfs dir/file may create fail, add error log here. Signed-off-by: weiping zhang --- mm/backing-dev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/backing-dev.c b/mm/backing-dev.c index b5f940c..9117c21 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c

Re: [PATCH] bdi: show error log when fail to create bdi debugfs entry

2018-01-10 Thread weiping zhang
2018-01-11 0:10 GMT+08:00 Bart Van Assche : > On Wed, 2018-01-10 at 23:18 +0800, weiping zhang wrote: >> bdi debugfs dir/file may create fail, add error log here. >> >> Signed-off-by: weiping zhang >> --- >> mm/backing-dev.c | 3 ++- >> 1 file changed, 2

[PATCH v2] bdi: show error log when fail to create bdi debugfs entry

2018-01-10 Thread weiping zhang
bdi debugfs dir/file may create fail, add error log here. Signed-off-by: weiping zhang --- V1->V2: fix indentation and make log message more clear mm/backing-dev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/backing-dev.c b/mm/backing-dev.c index b5f940c..0a49

[RFC PATCH] blktrace: fail earlier if blk_trace in use

2018-01-15 Thread weiping zhang
add a check before allocate resource for blk_trace, if it's in use. Signed-off-by: weiping zhang --- kernel/trace/blktrace.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 987d9a9a..16c 100644 --- a/kernel/trace/blktr

Re: [RFC] blk-throttle: export io_serviced_recursive, io_service_bytes_recursive

2018-01-18 Thread weiping zhang
2017-12-11 23:17 GMT+08:00 Tejun Heo : > On Mon, Dec 11, 2017 at 10:56:25PM +0800, weiping zhang wrote: >> export these two interface for cgroup-v1. >> >> Signed-off-by: weiping zhang > > Acked-by: Tejun Heo > Hi Jens, Have you got time to check this patch ? Thanks > Thanks. > > -- > tejun

Re: [PATCH v2] bdi: show error log when fail to create bdi debugfs entry

2018-01-19 Thread weiping zhang
2018-01-11 0:36 GMT+08:00 weiping zhang : > bdi debugfs dir/file may create fail, add error log here. > > Signed-off-by: weiping zhang > --- > V1->V2: > fix indentation and make log message more clear > > mm/backing-dev.c | 4 +++- > 1 file changed, 3 insertions(+)

[PATCH] blk-throttle: use queue_is_rq_based

2018-01-19 Thread weiping zhang
use queue_is_rq_based instead of open code. Signed-off-by: weiping zhang --- block/blk-throttle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 96ad326..457e985 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c

[PATCH v2] blk-throttle: use queue_is_rq_based

2018-01-19 Thread weiping zhang
use queue_is_rq_based instead of open code. Signed-off-by: weiping zhang --- block/blk-throttle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index e136f5e..c475f0f 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c

Re: [PATCH] blk-throttle: use queue_is_rq_based

2018-01-19 Thread weiping zhang
2018-01-20 3:58 GMT+08:00 Jens Axboe : > On 1/19/18 10:40 AM, weiping zhang wrote: >> use queue_is_rq_based instead of open code. >> >> Signed-off-by: weiping zhang >> --- >> block/blk-throttle.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) &g

Re: [PATCH v2] bdi: show error log when fail to create bdi debugfs entry

2018-01-19 Thread weiping zhang
2018-01-20 3:54 GMT+08:00 Jens Axboe : > On 1/19/18 10:36 AM, weiping zhang wrote: >> 2018-01-11 0:36 GMT+08:00 weiping zhang : >>> bdi debugfs dir/file may create fail, add error log here. >>> >>> Signed-off-by: weiping zhang >>> --- >>>

[PATCH] block: add io queue depth show

2017-07-07 Thread weiping zhang
show io queue depth. Signed-off-by: weiping zhang --- block/blk-sysfs.c | 11 +++ include/linux/blkdev.h | 5 + 2 files changed, 16 insertions(+) diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 27aceab..66cba2b 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c

[PATCH] blk-mq-debugfs: add mapping show for hw queue to cpu

2017-07-12 Thread weiping zhang
A mapping show as following: hctxcpus hctx0 0 1 hctx1 2 hctx2 3 hctx3 4 5 Signed-off-by: weiping zhang --- block/blk-mq-debugfs.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/block/blk-mq-debugfs.c b

Re: [PATCH] blk-mq-debugfs: add mapping show for hw queue to cpu

2017-07-12 Thread weiping zhang
On Wed, Jul 12, 2017 at 10:57:37AM -0600, Jens Axboe wrote: > On 07/12/2017 10:54 AM, weiping zhang wrote: > > A mapping show as following: > > > > hctxcpus > > hctx0 0 1 > > hctx1 2 > > hctx2

Re: [PATCH] blk-mq-debugfs: add mapping show for hw queue to cpu

2017-07-13 Thread weiping zhang
On Wed, Jul 12, 2017 at 11:25:12AM -0600, Jens Axboe wrote: > On 07/12/2017 11:13 AM, weiping zhang wrote: > > On Wed, Jul 12, 2017 at 10:57:37AM -0600, Jens Axboe wrote: > >> On 07/12/2017 10:54 AM, weiping zhang wrote: > >>> A mapping show as following: >

[PATCH] blk-mq: only alloc hctx point as many as nr_hw_queues

2017-07-13 Thread weiping zhang
one hw queue only has one hctx, reduce it's number same as nr_hw_queues. Signed-off-by: weiping zhang --- block/blk-mq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 05dfa3f..8c98f59 100644 --- a/block/blk-mq.c +++ b/bloc

Re: [PATCH] blk-mq: only alloc hctx point as many as nr_hw_queues

2017-07-13 Thread weiping zhang
On Thu, Jul 13, 2017 at 10:14:31AM -0600, Jens Axboe wrote: > On 07/13/2017 10:10 AM, weiping zhang wrote: > > one hw queue only has one hctx, reduce it's number same as nr_hw_queues. > > What happens if a device registers with eg 4 hw queues, then later > calls blk

[PATCH 2/2] null_blk: make sure submit_queues > 0

2017-08-02 Thread weiping zhang
set submit_queues to 1 by default, and make sure it's value > 0. Signed-off-by: weiping zhang --- drivers/block/null_blk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c index 72e2bc5..f1d0ca0 100644 --- a

[PATCH 0/2] null_blk: make sure submit_queues > 0

2017-08-02 Thread weiping zhang
r what user want, otherwise kmalloc has a negtive parameters. weiping zhang (2): null_blk: simplify logic for use_per_node_hctx null_blk: make sure submit_queues > 0 drivers/block/null_blk.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) -- 2.9.4

[PATCH 1/2] null_blk: simplify logic for use_per_node_hctx

2017-08-02 Thread weiping zhang
make sure submit_queues equal nr_online_nodes. Signed-off-by: weiping zhang --- drivers/block/null_blk.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c index 85c24ca..72e2bc5 100644 --- a/drivers/block/null_blk.c

Re: [PATCH 0/2] null_blk: make sure submit_queues > 0

2017-08-07 Thread weiping zhang
On Thu, Aug 03, 2017 at 12:26:00AM +0800, weiping zhang wrote: > Hi, > > two misc patch for null_blk, > > null_blk: simplify logic for use_per_node_hctx > simplify code logic, if use_per_node_hctx set submit_queues same as > nr_online_nodes. > > null_blk: make s

[PATCH] blk-sysfs: add io queue depth show

2017-08-09 Thread weiping zhang
show max io queue depth, it may doesn't reflect the real hardware's max queue depth which was reduced by some software designs. Signed-off-by: weiping zhang --- block/blk-sysfs.c | 11 +++ include/linux/blkdev.h | 5 + 2 files changed, 16 insertions(+) diff --git a

[PATCH] block: remove blk_free_devt in add_partition

2017-08-18 Thread weiping zhang
put_device(pdev) will call pdev->type->release finally, and blk_free_devt has been called in part_release(), so remove it. Signed-off-by: weiping zhang --- block/partition-generic.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/partition-generic.c b/block/partition-generic.c

[PATCH] block, bfq: fix error handle in bfq_init

2017-08-18 Thread weiping zhang
if elv_register fail, bfq_pool should be free. Signed-off-by: weiping zhang --- block/bfq-iosched.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 436b6ca..bdb072f 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c

[PATCH] blkcg: add a cleanup when active policy fail

2017-08-21 Thread weiping zhang
if alloc memory fail, all cpds which were allocated before should be cleaned up. Signed-off-by: weiping zhang --- block/blk-cgroup.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 0480892..7e21c4b 100644 --- a/block/blk-cgroup.c

Re: [PATCH] block, bfq: fix error handle in bfq_init

2017-08-23 Thread weiping zhang
On Sat, Aug 19, 2017 at 12:37:20AM +0800, weiping zhang wrote: > if elv_register fail, bfq_pool should be free. > > Signed-off-by: weiping zhang > --- > block/bfq-iosched.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/block/bfq-iosched

Re: [PATCH] block, bfq: fix error handle in bfq_init

2017-08-23 Thread weiping zhang
> 在 2017年8月24日,05:35,Jens Axboe 写道: > > On 08/18/2017 10:37 AM, weiping zhang wrote: >> if elv_register fail, bfq_pool should be free. > > Looks correct to me, I'll add it. Thanks. > > -- > Jens Axboe > Jens, Thanks a lot

Re: [PATCH] block: remove blk_free_devt in add_partition

2017-08-24 Thread weiping zhang
On Fri, Aug 18, 2017 at 11:54:45PM +0800, weiping zhang wrote: > put_device(pdev) will call pdev->type->release finally, and blk_free_devt > has been called in part_release(), so remove it. > > Signed-off-by: weiping zhang > --- > block/partition-generic.c | 1 - >

[PATCH] block, scheduler: convert xxx_var_store to void

2017-08-24 Thread weiping zhang
The last parameter "count" never be used in xxx_var_store, convert these functions to void. Signed-off-by: weiping zhang --- block/bfq-iosched.c | 33 + block/cfq-iosched.c | 13 ++--- block/deadline-iosched.c | 9 - block/mq-

[PATCH] blkcg: avoid free blkcg_root when failed to alloc blkcg policy

2017-08-25 Thread weiping zhang
this patch fix two errors, firstly avoid kfree blk_root, secondly not free(blkcg) ,if blkcg alloc fail(blkcg == NULL), just unlock that mutex; Signed-off-by: weiping zhang --- block/blk-cgroup.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/block/blk-cgroup.c b

Re: [PATCH] block, scheduler: convert xxx_var_store to void

2017-08-28 Thread weiping zhang
On Fri, Aug 25, 2017 at 01:11:33AM +0800, weiping zhang wrote: > The last parameter "count" never be used in xxx_var_store, > convert these functions to void. > > Signed-off-by: weiping zhang > --- > block/bfq-iosched.c | 33 +---

Re: [PATCH] block, scheduler: convert xxx_var_store to void

2017-08-28 Thread weiping zhang
On Mon, Aug 28, 2017 at 10:00:46AM -0600, Jens Axboe wrote: > On 08/28/2017 06:22 AM, weiping zhang wrote: > > On Fri, Aug 25, 2017 at 01:11:33AM +0800, weiping zhang wrote: > >> The last parameter "count" never be used in xxx_var_store, > >> convert these func

[PATCH] blkcg: check pol->cpd_free_fn before free cpd

2017-08-29 Thread weiping zhang
check pol->cpd_free_fn() instead of pol->cpd_alloc_fn() when free cpd. Signed-off-by: weiping zhang --- block/blk-cgroup.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 0480892..adcbc3e 100644 --- a/block/blk-cg

[PATCH v2 0/2] Add wrapper for blkcg policy operatins

2017-09-01 Thread weiping zhang
The first patch is the V2 of [PATCH] blkcg: check pol->cpd_free_fn before free cpd, it fixs a checking before free cpd. The second patch add some wrappers for struct blkcg_policy->xxx_fn, because not every block cgroup policy implement all operations. weiping zhang (2): blkcg: che

[PATCH v2 1/2] blkcg: check pol->cpd_free_fn before free cpd

2017-09-01 Thread weiping zhang
check pol->cpd_free_fn() instead of pol->cpd_alloc_fn() when free cpd. Signed-off-by: weiping zhang --- block/blk-cgroup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 0480892..0c45870 100644 --- a/block/blk-cgroup.c

[PATCH v2 2/2] blkcg: add wrappers for struct blkcg_policy operations

2017-09-01 Thread weiping zhang
Some blkcg policies may not implement all operations in struct blkcg_policy, add wrappers for these pol->xxx_fn. Signed-off-by: weiping zhang --- block/blk-cgroup.c | 53 -- include/linux/blk-cgroup.h | 72 ++

Re: [PATCH 3/5] bfq: Check kstrtoul() return value

2017-09-01 Thread weiping zhang
2017-09-02 1:14 GMT+08:00 Paolo Valente : > >> Il giorno 30 ago 2017, alle ore 20:42, Bart Van Assche >> ha scritto: >> >> Make sysfs writes fail for invalid numbers instead of storing >> uninitialized data copied from the stack. This patch removes >> all uninitialized_var() occurrences from the

Re: [PATCH 3/5] bfq: Check kstrtoul() return value

2017-09-01 Thread weiping zhang
> Sorry but I do not like this proposal because: > * If invalid input is provided writing into a sysfs attribute should fail > instead of ignoring the invalid input silently. > * simple_strtoul() is considered obsolete and must not be used in new code. > From include/linux/kernel.h: > > /* Obso

[PATCH] blk-mq: fix nr_requests wrong value when modify it from sysfs

2017-09-03 Thread weiping zhang
n1/queue/ioscheduler echo 100 > /sys/block/nvme0n1/queue/nr_requests cat /sys/block/nvme0n1/queue/nr_requests 1000000 Signed-off-by: weiping zhang --- block/blk-mq.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index f84d145..8303e5e

Re: [PATCH] blk-mq: fix nr_requests wrong value when modify it from sysfs

2017-09-06 Thread weiping zhang
On Tue, Sep 05, 2017 at 03:42:45PM +, Bart Van Assche wrote: > On Sun, 2017-09-03 at 21:46 +0800, weiping zhang wrote: > > if blk-mq use "none" io scheduler, nr_request get a wrong value when > > input a number > tag_set->queue_depth. blk_mq_tag_update_depth will

  1   2   >