[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 <zhangweip...@didichuxing.com> --- 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

[PATCH] block: add io queue depth show

2017-07-07 Thread weiping zhang
show io queue depth. Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> --- 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/blo

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

[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 <zhangweip...@didichuxing.com> --- 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

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

2017-08-02 Thread weiping zhang
t 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 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 <zhangweip...@didichuxing.com> --- 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 inde

[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 <zhangweip...@didichuxing.com> --- block/blk-sysfs.c | 11 +++ include/linux/blkdev.h | 5 + 2 files chang

[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 <zhangweip...@didichuxing.com> --- 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/blo

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

2017-09-15 Thread weiping zhang
On Fri, Sep 01, 2017 at 10:16:45PM +0800, weiping zhang wrote: > 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

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

2017-09-21 Thread weiping zhang
On Tue, Sep 12, 2017 at 09:57:32PM +0800, weiping zhang wrote: > On Wed, Sep 06, 2017 at 01:00:44PM +, Bart Van Assche wrote: > > On Wed, 2017-09-06 at 15:34 +0800, weiping zhang wrote: > > > On Tue, Sep 05, 2017 at 03:42:45PM +, Bart Van Assche wrote: > > > &g

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

2017-09-21 Thread weiping zhang
On Thu, Sep 21, 2017 at 08:09:47AM -0600, Jens Axboe wrote: > On 09/21/2017 07:03 AM, weiping zhang wrote: > > On Tue, Sep 12, 2017 at 09:57:32PM +0800, weiping zhang wrote: > >> On Wed, Sep 06, 2017 at 01:00:44PM +, Bart Van Assche wrote: > >>> On Wed, 2017-09-06

[PATCH v2 2/2] blk-sysfs: return EINVAL when user modify nr_request less than BLKDEV_MIN_RQ

2017-09-21 Thread weiping zhang
Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> --- block/blk-sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index b8362c0..03a6e19 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -75,7

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

2017-09-21 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 <zhangweip...@didichuxing.com> --- block/blk-mq.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/block/blk-m

[PATCH v2 0/2] fix wrong value when user modify nr_request by sysfs

2017-09-21 Thread weiping zhang
ior with former patch, also return EINVAL when user write a value less than BLKDEV_MIN_RQ weiping zhang (2): blk-mq: fix nr_requests wrong value when modify it from sysfs blk-sysfs: return EINVAL when user modify nr_request less than BLKDEV_MIN_RQ block/blk-mq.c| 8 ++-- block/

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

2017-09-22 Thread weiping zhang
ue/scheduler echo 100 > /sys/block/nvme0n1/queue/nr_requests cat /sys/block/nvme0n1/queue/nr_requests 1000000 Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> --- Changes since v4: * fix typo in commit message(queue/ioscheduler => queue/scheduler) Changes since v3:

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

2017-09-21 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 <zhangweip...@didichuxing.com> --- block/blk-mq.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/blk-mq.c b/blo

Re: [PATCH v2 2/2] blk-sysfs: return EINVAL when user modify nr_request less than BLKDEV_MIN_RQ

2017-09-21 Thread weiping zhang
On Thu, Sep 21, 2017 at 10:38:22AM -0600, Jens Axboe wrote: > On 09/21/2017 09:17 AM, weiping zhang wrote: > > Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> > > --- > > block/blk-sysfs.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-

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

2017-09-21 Thread weiping zhang
On Thu, Sep 21, 2017 at 10:37:48AM -0600, Jens Axboe wrote: > On 09/21/2017 09:17 AM, 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

Re: [PATCH V2 3/3] blockcg: export latency info for each cgroup

2017-10-10 Thread weiping zhang
On Fri, Oct 06, 2017 at 05:56:01PM -0700, Shaohua Li wrote: > From: Shaohua Li > > Export the latency info to user. The latency is a good sign to indicate > if IO is congested or not. User can use the info to make decisions like > adjust cgroup settings. Hi Shaohua, How to check IO

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

2017-10-10 Thread weiping zhang
check pol->cpd_free_fn() instead of pol->cpd_alloc_fn() when free cpd. Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> --- 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 d3f56ba..e7

[PATCH] blkcg: add sanity check for blkcg policy operations

2017-10-10 Thread weiping zhang
blkcg policy should keep cpd/pd's alloc_fn and free_fn in pairs, otherwise policy would register fail. Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> --- block/blk-cgroup.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/block/blk-cgroup.c b/blo

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

2017-10-10 Thread weiping zhang
On Tue, Oct 10, 2017 at 09:04:39AM -0600, Jens Axboe wrote: > On 10/10/2017 08:53 AM, weiping zhang wrote: > > check pol->cpd_free_fn() instead of pol->cpd_alloc_fn() when free cpd. > > In practice this shouldn't make a difference, since if you have an > alloc_fn, you be

[PATCH 1/2] null_blk: update usage hints for submit_queues

2017-10-13 Thread weiping zhang
update the range of submits_queues, and correct usage hints. Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> --- Documentation/block/null_blk.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/block/null_blk.txt b/Documentation

[PATCH 0/2] Update the usage hints of submit_queues and

2017-10-13 Thread weiping zhang
lt, so update it's description. The second patch add usage hints for no_sched. weiping zhang (2): null_blk: update usage hints for submit_queues null_blk: add usage hints for no_sched Documentation/block/null_blk.txt | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) -- 2.14.2

[PATCH 2/2] null_blk: add usage hints for no_sched

2017-10-13 Thread weiping zhang
This parameter provide an option to disable io scheduler when nullb* in multi-queue mode. Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> --- Documentation/block/null_blk.txt | 4 1 file changed, 4 insertions(+) diff --git a/Documentation/block/null_blk.txt b/Documen

Re: [PATCH] blkcg: add sanity check for blkcg policy operations

2017-10-11 Thread weiping zhang
On Wed, Oct 11, 2017 at 09:58:33AM +0200, Johannes Thumshirn wrote: > On Wed, Oct 11, 2017 at 12:00:55AM +0800, weiping zhang wrote: > > + * blkcg_policy_check_ops - check policy's operations > > + * @pol: blkcg policy to check > > + * > > + * Make sure cpd/pd_alloc_fn

[PATCH v2] blkcg: add sanity check for blkcg policy operations

2017-10-11 Thread weiping zhang
blkcg policy should keep cpd/pd's alloc_fn and free_fn in pairs, otherwise policy would register fail. Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> --- block/blk-cgroup.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c

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

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

2017-09-12 Thread weiping zhang
On Wed, Sep 06, 2017 at 01:00:44PM +, Bart Van Assche wrote: > On Wed, 2017-09-06 at 15:34 +0800, weiping zhang wrote: > > 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

Re: [PATCH] null_blk: add "no_sched" module parameter

2017-09-29 Thread weiping zhang
On Fri, Sep 29, 2017 at 11:39:03PM +0200, Jens Axboe wrote: > On 09/29/2017 07:09 PM, weiping zhang wrote: > > add an option that disable io scheduler for null block device. > > > > Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> > > --- > > dri

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

2017-09-30 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] blk-mq: remove unused function hctx_allow_merges

2017-09-30 Thread weiping zhang
since 9bddeb2a5b981 "blk-mq: make per-sw-queue bio merge as default .bio_merge" there is no caller for this function. Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> --- block/blk-mq.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/block/blk-mq.c b/bloc

[PATCH v2] null_blk: add "no_sched" module parameter

2017-09-29 Thread weiping zhang
add an option that disable io scheduler for null block device. Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> --- drivers/block/null_blk.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c index bd92286..38f4a8c

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 <zhangweip...@didichuxing.com> > --- >

[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 <zhangweip...@didichuxing.com> --- block/bfq-iosched.c | 33 + block/cfq-iosched.c | 13 ++--- block/deadlin

[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 <zhangweip...@didichuxing.com> --- block/blk-cgroup.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 0480892..7

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 <zhangweip...@didichuxing.com> > --- &

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

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

2017-08-23 Thread weiping zhang
> 在 2017年8月24日,05:35,Jens Axboe <ax...@kernel.dk> 写道: > > 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, 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 <zhangweip...@didichuxing.com> > --- > block/bfq-iosched.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >

[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 <zhangweip...@didichuxing.com> --- block/blk-cgroup.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-)

[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 <zhangweip...@didichuxing.com> --- block/partition-generic.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/partition

[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 <zhangweip...@didichuxing.com> --- 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..0c

[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 <zhangweip...@didichuxing.com> --- block/blk-cgroup.c | 53 -- include/linux/blk-cgro

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

[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 <zhangweip...@didichuxing.com> --- block/blk-mq.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/block/blk-m

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: > > /*

[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 <zhangweip...@didichuxing.com> --- 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 0480

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

2017-10-07 Thread weiping zhang
On Sat, Sep 30, 2017 at 10:57:31PM +0800, weiping zhang wrote: > 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_dep

Re: [PATCH v2] blkcg: add sanity check for blkcg policy operations

2017-10-12 Thread weiping zhang
On Wed, Oct 11, 2017 at 10:51:32AM -0600, Jens Axboe wrote: > On 10/11/2017 03:46 AM, weiping zhang wrote: > > blkcg policy should keep cpd/pd's alloc_fn and free_fn in pairs, > > otherwise policy would register fail. > > > > Signed-off-by: weiping zhang &l

[PATCH v3] blkcg: add sanity check for blkcg policy operations

2017-10-12 Thread weiping zhang
blkcg policy should keep cpd/pd's alloc_fn and free_fn in pairs, otherwise policy would register fail. Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> --- block/blk-cgroup.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c

Re: [PATCH V2 3/3] blockcg: export latency info for each cgroup

2017-10-11 Thread weiping zhang
2017-10-11 2:23 GMT+08:00 Shaohua Li <s...@kernel.org>: > On Wed, Oct 11, 2017 at 01:35:51AM +0800, weiping zhang wrote: >> On Fri, Oct 06, 2017 at 05:56:01PM -0700, Shaohua Li wrote: >> > From: Shaohua Li <s...@fb.com> >> > >> > Export the

[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 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 <zhangweip...@didichuxing.com> --- 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 0

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

2017-11-23 Thread weiping zhang
Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> --- 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

[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 <zhangweip...@didichuxing.com> --- block/blk-wbt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/block/blk-wbt.c b/block/blk

[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 <zhangweip...@didichuxing.com> --- block/blk-sysfs.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/block/blk-sysfs.

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

2017-11-23 Thread weiping zhang
Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> --- 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 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 <zhangweip...@didichuxing.com> --- 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-thro

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

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 <br...@wolff.to>: > On Fri, Dec 15, 2017 at 09:22:21 +0800, > weiping zhang <zwp10...@gmail.com> wrote: >> >> >> Thanks your testing, but I cann't find WARN_ON in device_add_disk from >> this boot1.log, cou

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 <br...@wolff.to>: > On Thu, Dec 14, 2017 at 18:09:27 +0800, > weiping zhang <zhangweip...@didichuxing.com> wrote: >> >> >> It seems something wrong with bdi debugfs register, could you help >> test the fo

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 <br...@wolff.to>: > On Fri, Dec 15, 2017 at 10:04:32 +0800, > weiping zhang <zwp10...@gmail.com> wrote: >> >> I just want to know WARN_ON WHAT in device_add_disk, >> if bdi_register_owner return error code, it

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

2017-12-14 Thread weiping zhang
the forllowing debug patch, I add some debug log, no function change, thanks. >From d2728c07589e8b83115a51e0c629451bff7308db Mon Sep 17 00:00:00 2001 From: weiping zhang <zhangweip...@didichuxing.com> Date: Thu, 14 Dec 2017 17:56:22 +0800 Subject: [PATCH] bdi debugfs Signed-off-by: weiping z

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

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 <zhangweip...@didichuxing.com> --- block/blk-cgroup.c | 55 +---

[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 <zhangweip...@didichuxing.com> --- 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-thro

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

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 <zhangweip...@didichuxing.com&g

[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 <zhangweip...@didichuxing.com> --- mm/backing-dev.c | 5 - 1 file changed, 4 insertions(+), 1 de

[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 <j...@suse.cz> Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> --- mm/backing-dev.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/mm/backin

[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 <j...@suse.cz> Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> --- block/genhd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/genhd.c b/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

[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

[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 <zhangweip...@didichuxing.com> --- mm/backing

[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 <zhangweip...@didichuxing.com> --- 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 5072be

[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 <zhangweip...@didichuxing.com> --- mm/backing-dev.c | 7 ++- 1 file changed, 6 insertions

[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 <zhangweip...@didichuxing.com> --- block/genhd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/block/genhd.c b/block/genhd.c index dd305c65ffb0..cb55ee

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 <zwp10...@gmail.com> wrote: > >2017-12-22 12:53 GMT+08:00 Bruno Wolff III <br...@wolff.to>: > >>On Thu, Dec 21, 2017 at 17:16:03 -0600, >

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 <zwp10...@gmail.com> wrote: > >2017-12-22 12:53 GMT+08:00 Bruno Wolff III <br...@wolff.to>: > >>On Thu, Dec 21, 2017 at 17:16:03 -0600, >

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 <t...@kernel.org>: > 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 <zhangweip...@didichuxing.com> > > Acked-by: Tejun Heo &

[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 <zhangweip...@didichuxing.com> --- 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/b

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 <bart.vanass...@wdc.com>: > 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 <zhangweip...@didichuxing.com> >>

[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 <zhangweip...@didichuxing.com> --- 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/m

[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 <zhangweip...@didichuxing.com> --- 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

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 <t...@kernel.org>: > 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 <zhangweip...@didichuxing.com> > > Acked-by: Tejun Heo

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 <zhangweip...@didichuxing.com>: > bdi debugfs dir/file may create fail, add error log here. > > Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> > --- > V1->V2: > fix indentation and make log message more clear &g

[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 <zhangweip...@didichuxing.com> --- 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/blo

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 <ax...@kernel.dk>: > On 1/19/18 10:36 AM, weiping zhang wrote: >> 2018-01-11 0:36 GMT+08:00 weiping zhang <zhangweip...@didichuxing.com>: >>> bdi debugfs dir/file may create fail, add error log here. >>> >

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 <ax...@kernel.dk>: > On 1/19/18 10:40 AM, weiping zhang wrote: >> use queue_is_rq_based instead of open code. >> >> Signed-off-by: weiping zhang <zhangweip...@didichuxing.com> >> --- >> block/blk-throttle.c | 2 +- &

[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 <zhangweip...@didichuxing.com> --- 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/blo

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

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

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 <br...@wolff.to>: > On Thu, Dec 21, 2017 at 23:31:40 +0800, > weiping zhang <zwp10...@gmail.com> wrote: >> >> does every time boot fail can trigger WANRING in device_add_disk ? > > > Not that I see. But the messag

Re: [RFC PATCH 0/2] use larger max_request_size for virtio_blk

2018-04-07 Thread Weiping Zhang
2018-04-05 22:29 GMT+08:00 Jens Axboe <ax...@kernel.dk>: > On 4/5/18 4:09 AM, Weiping Zhang wrote: >> Hi, >> >> For virtio block device, actually there is no a hard limit for max request >> size, and virtio_blk driver set -1 to blk_queue_max_hw_sectors(q, -1U);

[RFC PATCH 2/2] virtio_blk: add new module parameter to set max request size

2018-04-05 Thread Weiping Zhang
Actually there is no upper limitation, so add new module parameter to provide a way to set a proper max request size for virtio block. Using a larger request size can improve sequence performance in theory, and reduce the interaction between guest and hypervisor. Signed-off-by: Weiping Zhang

[RFC PATCH 1/2] blk-setting: add new helper blk_queue_max_hw_sectors_no_limit

2018-04-05 Thread Weiping Zhang
There is a default upper limitation BLK_DEF_MAX_SECTORS, but for some virtual block device driver there is no such limitation. So add a new help to set max request size. Signed-off-by: Weiping Zhang <zhangweip...@didichuxing.com> --- block/blk-settings.c | 20 i

  1   2   >