Re: [PATCH 04/24] fs: Provide infrastructure for dynamic BDIs in filesystems

2017-02-02 Thread Liu Bo
Hi, On Thu, Feb 02, 2017 at 06:34:02PM +0100, Jan Kara wrote: > Provide helper functions for setting up dynamically allocated > backing_dev_info structures for filesystems and cleaning them up on > superblock destruction. Just one concern, will this cause problems for multiple superblock cases

Re: [PATCH 04/24] fs: Provide infrastructure for dynamic BDIs in filesystems

2017-02-03 Thread Liu Bo
On Fri, Feb 03, 2017 at 02:50:42PM +0100, Jan Kara wrote: > On Thu 02-02-17 11:28:27, Liu Bo wrote: > > Hi, > > > > On Thu, Feb 02, 2017 at 06:34:02PM +0100, Jan Kara wrote: > > > Provide helper functions for setting up dynamically allocated > > > back

Re: [PATCH 08/24] btrfs: Convert to separately allocated bdi

2017-02-03 Thread Liu Bo
On Thu, Feb 02, 2017 at 06:34:06PM +0100, Jan Kara wrote: > Allocate struct backing_dev_info separately instead of embedding it > inside superblock. This unifies handling of bdi among users. Looks good. Reviewed-by: Liu Bo <bo.li@oracle.com> Thanks, -liubo > >

Re: [PATCH v2] btrfs: Correct assignment of pos

2017-07-10 Thread Liu Bo
@@ static ssize_t btrfs_file_write_iter(struct kiocb > *iocb, > inode_unlock(inode); > return -EAGAIN; > } > - } else > - inode_lock(inode); > - > - err = generic_write_checks(iocb, from); > - if (err <= 0) { > - inode_unlock(inode); > - return err; > } > > current->backing_dev_info = inode_to_bdi(inode); Reviewed-by: Liu Bo <bo.li@oracle.com> -liubo

Re: [PATCH] block: note about cloned bios and bio_for_each_segment_all

2017-07-14 Thread Liu Bo
On Fri, Jul 14, 2017 at 08:22:31AM -0600, Jens Axboe wrote: > On 07/14/2017 07:47 AM, Ming Lei wrote: > >> @@ -156,6 +156,9 @@ static inline void *bio_data(struct bio *bio) > >> /* > >> * drivers should _never_ use the all version - the bio may have been > >> split > >> * before it got to

Re: [PATCH v2 14/51] btrfs: avoid to access bvec table directly for a cloned bio

2017-06-26 Thread Liu Bo
to retrieve the 1st bvec. > Looks good to me. Reviewed-by: Liu Bo <bo.li@oracle.com> -liubo > Cc: Chris Mason <c...@fb.com> > Cc: Josef Bacik <jba...@fb.com> > Cc: David Sterba <dste...@suse.com> > Cc: linux-bt...@vger.kernel.org > Cc: Liu Bo

Re: [PATCH v4 05/27] btrfs: btrfs_wait_tree_block_writeback can be void return

2017-05-18 Thread Liu Bo
On Tue, May 09, 2017 at 11:49:08AM -0400, Jeff Layton wrote: > Nothing checks its return value. Reviewed-by: Liu Bo <bo.li@oracle.com> -liubo > > Signed-off-by: Jeff Layton <jlay...@redhat.com> > --- > fs/btrfs/disk-io.c | 6 +++--- > fs/btrfs/disk-io.

Re: [PATCH] Btrfs: avoid losing data raid profile when deleting a device

2017-10-09 Thread Liu Bo
Please ignore this, I put the wrong ML. Thanks, -liubo On Mon, Oct 09, 2017 at 11:38:09AM -0600, Liu Bo wrote: > We've avoided data losing raid profile when doing balance, but it > turns out that deleting a device could also result in the same > problem. > > This fixes the prob

[PATCH] Btrfs: avoid losing data raid profile when deleting a device

2017-10-09 Thread Liu Bo
the time so their raid profile is persistent. Reported-by: James Alandt <james.ala...@wdc.com> Signed-off-by: Liu Bo <bo.li@oracle.com> --- fs/btrfs/volumes.c | 87 ++ 1 file changed, 68 insertions(+), 19 deletions(-) diff --gi

Re: [PATCH] badblocks: fix wrong return value in badblocks_set if badblocks are disabled

2017-09-28 Thread Liu Bo
On Thu, Sep 28, 2017 at 09:57:41AM +0800, Guoqing Jiang wrote: > > > On 09/28/2017 06:13 AM, Liu Bo wrote: > > MD's rdev_set_badblocks() expects that badblocks_set() returns 1 if > > badblocks are disabled, otherwise, rdev_set_badblocks() will record > > superblock

[PATCH] badblocks: fix wrong return value in badblocks_set if badblocks are disabled

2017-09-27 Thread Liu Bo
in commit 9e0e252a048b ("badblocks: Add core badblock management code"). Signed-off-by: Liu Bo <bo.li@oracle.com> --- block/badblocks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/badblocks.c b/block/badblocks.c index 43c7116..91f7bcf 100644 --- a/b

[PATCH RFC] Block/blk-wbt: do not let background writes block sync writes

2017-08-25 Thread Liu Bo
max) limit returned by get_limit(). Signed-off-by: Liu Bo <bo.li@oracle.com> --- - Besides the above problem, it seems waitqueue_active() also requires a smp_mb(). block/blk-wbt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/blk-wbt.c b/block/blk-wb

Re: [PATCH RFC] Block/blk-wbt: do not let background writes block sync writes

2017-08-28 Thread Liu Bo
On Sun, Aug 27, 2017 at 11:14:20AM -0600, Jens Axboe wrote: > On 08/25/2017 06:14 PM, Liu Bo wrote: > > While using blk-wbt, sometimes sync writes are blocked by background > > writes, for example, > > > > a) a background write reaches the (background) limit returned

Re: [PATCH RFC] Block/blk-wbt: do not let background writes block sync writes

2017-08-28 Thread Liu Bo
On Mon, Aug 28, 2017 at 11:45:31AM -0600, Liu Bo wrote: > On Sun, Aug 27, 2017 at 11:14:20AM -0600, Jens Axboe wrote: > > On 08/25/2017 06:14 PM, Liu Bo wrote: > > > While using blk-wbt, sometimes sync writes are blocked by background > > > writes, for example, > &g

Re: [PATCH 1/6] btrfs: index check-integrity state hash by a dev_t

2017-08-23 Thread Liu Bo
On Wed, Aug 23, 2017 at 07:10:27PM +0200, Christoph Hellwig wrote: > We won't have the struct block_device available in the bio soon, so switch > to the numerical dev_t instead of the block_device pointer for looking up > the check-integrity state. Reviewed-by: Liu Bo <bo.li...

About btrfs on top of wb_throttle

2017-08-30 Thread Liu Bo
Hi, While playing with btrfs on top of wb_throttle, an interesting thing is that writeback from btrfs always falls into %rwb->wb_background even if there're no other writers. The peculiarity of btrfs is that, it owns the ability of mananging disks so that it creates a private bdi stored in

Re: [PATCH] badblocks: fix wrong return value in badblocks_set if badblocks are disabled

2017-11-03 Thread Liu Bo
Hi Shaohua, Given it's related to md, can you please take this thru your tree? Thanks, -liubo On Wed, Sep 27, 2017 at 04:13:17PM -0600, Liu Bo wrote: > MD's rdev_set_badblocks() expects that badblocks_set() returns 1 if > badblocks are disabled, otherwise, rdev_set_badblocks() will

[PATCH RESEND] badblocks: fix wrong return value in badblocks_set if badblocks are disabled

2017-11-03 Thread Liu Bo
in commit 9e0e252a048b ("badblocks: Add core badblock management code"). Signed-off-by: Liu Bo <bo.li@oracle.com> Acked-by: Guoqing Jiang <gqji...@suse.com> --- block/badblocks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/badblocks.c b/b

[PATCH] Block: null_blk: add blocking description and remove lightnvm

2018-05-25 Thread Liu Bo
- The description of 'blocking' is missing in null_blk.txt - The 'lightnvm' parameter has been removed in null_blk.c This updates both in null_blk.txt. Signed-off-by: Liu Bo <bo@linux.alibaba.com> --- Documentation/block/null_blk.txt | 9 ++--- 1 file changed, 6 insertions

[PATCH RESEND] blk-throttle: fix potential NULL pointer dereference in throtl_select_dispatch

2018-05-29 Thread Liu Bo
tg in throtl_select_dispatch is used first and then do check. Since tg may be NULL, it has potential NULL pointer dereference risk. So fix it. Signed-off-by: Joseph Qi Signed-off-by: Liu Bo --- block/blk-throttle.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/blk

Re: [PATCH] Block: initialize bio_cnt_ret_time for the first time

2018-06-29 Thread Liu Bo
Hi Jens, This one is kind of obvious, could you please also take it thru your tree? thanks, liubo On Wed, Jun 20, 2018 at 8:07 PM, Liu Bo wrote: > When a new tg is created, tg->bio_cnt_ret_time is 0, so if the first > IO going thru this tg turns out to be a bad one, we fail

Re: [PATCH] Block: initialize bio_cnt_ret_time for the first time

2018-06-29 Thread Liu Bo
On Fri, Jun 29, 2018 at 02:00:01PM -0600, Jens Axboe wrote: > On 6/20/18 9:07 PM, Liu Bo wrote: > > When a new tg is created, tg->bio_cnt_ret_time is 0, so if the first > > IO going thru this tg turns out to be a bad one, we fail to record it > > in tg->bad_bio_

Re: [PATCH] Block: initialize bio_cnt_ret_time for the first time

2018-06-29 Thread Liu Bo
On Fri, Jun 29, 2018 at 02:26:07PM -0600, Jens Axboe wrote: > On 6/29/18 2:23 PM, Liu Bo wrote: > > On Fri, Jun 29, 2018 at 02:00:01PM -0600, Jens Axboe wrote: > >> On 6/20/18 9:07 PM, Liu Bo wrote: > >>> When a new tg is created, tg->bio_cnt_ret_time is 0, so

Re: [PATCH] Block: initialize bio_cnt_ret_time for the first time

2018-06-29 Thread Liu Bo
On Fri, Jun 29, 2018 at 02:46:27PM -0600, Jens Axboe wrote: > On 6/29/18 2:43 PM, Liu Bo wrote: > > On Fri, Jun 29, 2018 at 02:26:07PM -0600, Jens Axboe wrote: > >> On 6/29/18 2:23 PM, Liu Bo wrote: > >>> On Fri, Jun 29, 2018 at 02:00:01PM -0600, Jens Axboe wrote: >

[PATCH] Block: initialize bio_cnt_ret_time for the first time

2018-06-20 Thread Liu Bo
When a new tg is created, tg->bio_cnt_ret_time is 0, so if the first IO going thru this tg turns out to be a bad one, we fail to record it in tg->bad_bio_cnt as if (jiffies > bio_cnt_ret_time) { tg->bad_bio_cnt /= 2; } Signed-off-by: Liu Bo --- block/blk-throttle.c |

[PATCH] blk-mq: remove confusing comment of blk_mq_sched_dispatch_requests

2018-01-05 Thread Liu Bo
Commit de1482974080 ("blk-mq: introduce .get_budget and .put_budget in blk_mq_ops") changes the function to return bool type, and then commit 1f460b63d4b3 ("blk-mq: don't restart queue when .get_budget returns BLK_STS_RESOURCE") changes it back to void, but the comment remains.

Re: [LSF/MM TOPIC] get_user_pages() and filesystems

2018-02-02 Thread Liu Bo
Hi Jan, On Thu, Jan 25, 2018 at 12:57:27PM +0100, Jan Kara wrote: > Hello, > > this is about a problem I have identified last month and for which I still > don't have good solution. Some discussion of the problem happened here [1] > where also technical details are posted but culprit of the

Re: [PATCH RESEND] blk-throttle: avoid double counted

2018-02-21 Thread Liu Bo
been counted, then it is split > and resubmitted to the block throttle layer. It also has the flag > BIO_THROTTLED but should not be counted again. > > So we add another flag BIO_THROTL_COUNTED to avoid double counted. > The patch looks good and safe to me. Reviewed-by: Liu Bo <bo.li@ora

[PATCH RESEND] Blk-throttle: reduce tail io latency when iops limit is enforced

2018-08-09 Thread Liu Bo
[12125], 99.95th=[12125], | 99.99th=[12387] Signed-off-by: Liu Bo --- Rebase against branch for-4.19/block. block/blk-throttle.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index caaabbe8a7a5..a3eede00d302 100644 --- a/bloc

Re: [PATCH] Blk-throttle: reduce tail io latency when iops limit is enforced

2018-08-09 Thread Liu Bo
On Thu, Aug 9, 2018 at 10:22 AM, Jens Axboe wrote: > On 7/20/18 6:29 PM, Liu Bo wrote: >> When an application's iops has exceeded its cgroup's iops limit, surely it >> is throttled and kernel will set a timer for dispatching, thus IO latency >> includes the delay. >&g

Re: [PATCH] Blk-throttle: reduce tail io latency when iops limit is enforced

2018-08-09 Thread Liu Bo
ping? On Fri, Jul 20, 2018 at 5:29 PM, Liu Bo wrote: > When an application's iops has exceeded its cgroup's iops limit, surely it > is throttled and kernel will set a timer for dispatching, thus IO latency > includes the delay. > > However, the dispatch delay which is calculat

[PATCH] Blk-throttle: update to use rbtree with leftmost node cached

2018-08-20 Thread Liu Bo
As rbtree has native support of caching leftmost node, i.e. rb_root_cached, no need to do the caching by ourselves. Signed-off-by: Liu Bo --- block/blk-throttle.c | 41 +++-- 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/block/blk-throttle.c

[PATCH] Blk-throttle: reduce tail io latency when iops limit is enforced

2018-07-20 Thread Liu Bo
[12125], 99.95th=[12125], | 99.99th=[12387] Signed-off-by: Liu Bo --- block/blk-throttle.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 26ddbe5286f8..3ca9a98748be 100644 --- a/block/blk-throttle.c +++ b/block/blk-throt

[PATCH] Block: blk-throttle: skip bad bio counting if io.low is not in use

2018-07-13 Thread Liu Bo
When only io.max is in use, tg->target_latency is set to the default value, if that's the case, bad_bio_cnt is not checking at all, so it makes no sense to check latency and do bad_bio_cnt counting in blk_throtl_bio_endio(). Signed-off-by: Liu Bo --- block/blk-throttle.c | 5 + 1 f

[PATCH] null_blk: remove NULLB_DEV_FL_CONFIGURED on turning off nullb device

2018-07-05 Thread Liu Bo
that mbps knob can be reset when power knob is off, e.g. echo 0 > /config/nullb/a/power echo 40 > /config/nullb/a/mbps echo 1 > /config/nullb/a/power So does other knobs under /config/nullb/a. Signed-off-by: Liu Bo --- drivers/block/null_blk.c | 1 + 1 file changed, 1 insertion(+) d

[PATCH] Block: blk-throttle: skip wait time calculation if not asked

2018-07-10 Thread Liu Bo
tg_may_dispatch() uses @wait to retrieve how long the next bio can be dispatched, but if it doesn't ask for that, it's OK for tg_with_in_{bps,iops}_limit() to return immediately. Signed-off-by: Liu Bo --- block/blk-throttle.c | 12 1 file changed, 8 insertions(+), 4 deletions

[PATCH] Blktrace: bail out early if block debugfs is not configured

2018-06-28 Thread Liu Bo
Since @blk_debugfs_root couldn't be configured dynamically, we can save a few memory allocation if it's not there. Signed-off-by: Liu Bo --- kernel/trace/blktrace.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index

Re: [PATCH] Blk-throttle: update to use rbtree with leftmost node cached

2018-09-20 Thread Liu Bo
ping? thanks, liubo On Mon, Aug 20, 2018 at 2:21 PM, Liu Bo wrote: > As rbtree has native support of caching leftmost node, > i.e. rb_root_cached, no need to do the caching by ourselves. > > Signed-off-by: Liu Bo > --- > block/b