On Fri, May 25, 2018 at 11:45:48AM +0800, Ming Lei wrote:
> Hi,
>
> This patchset brings multipage bvec into block layer:
patch series looks sane to me. goddamn that's a lot of renaming.
Things are going to get interesting when we start sticking compound pages in the
page cache, there'll be
On Fri, May 25, 2018 at 11:46:00AM +0800, Ming Lei wrote:
> There are still cases in which we need to use bio_segments() for get the
> number of segment, so introduce it.
>
> Signed-off-by: Ming Lei
> ---
> include/linux/bio.h | 25 -
> 1 file
It is a tree-wide mechanical replacement since both bio_for_each_segment()
and bio_for_each_segment_all() never returns real segment at all, and
both just return one page per bvec and deceive us for long time, so fix
their names.
This is a pre-patch for supporting multipage bvec. Once multipage
rq_for_each_segment() still deceives us since this helper only returns
one page in each bvec, so fixes its name.
Signed-off-by: Ming Lei
---
Documentation/block/biodoc.txt | 6 +++---
block/blk-core.c | 2 +-
drivers/block/floppy.c | 4 ++--
There is one use case(DM) which requires to clone bio segment by
segement, so introduce this API.
Signed-off-by: Ming Lei
---
block/bio.c | 56 +++--
include/linux/bio.h | 1 +
2 files changed, 43 insertions(+), 14
Firstly it is more efficient to use bio_for_each_segment() in both
blk_bio_segment_split() and __blk_recalc_rq_segments() to compute how many
segments there are in the bio.
Secondaly once bio_for_each_segment() is used, the bvec may need to
be splitted because its length can be very longer than
iov_iter is implemented with bvec itererator, so it is safe to pass
segment to it, and this way is much more efficient than passing one
page in each bvec.
Signed-off-by: Ming Lei
---
drivers/block/loop.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff
There are still cases in which rq_for_each_segment() is required, for
example, loop.
Signed-off-by: Ming Lei
---
include/linux/blkdev.h | 4
1 file changed, 4 insertions(+)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 1e8e9b430008..0b15bc625bd7
The incoming bio will become very big after multipage bvec is enabled,
so we can't clone bio page by page.
This patch uses the introduced bio_clone_seg_bioset(), so the incoming
bio can be cloned successfully. This way is safe because device mapping
won't modify the bio vector on the cloned
BTRFS and guard_bio_eod() need to get the last page from one segment, so
introduce this helper to make them happy.
Signed-off-by: Ming Lei
---
include/linux/bvec.h | 22 ++
1 file changed, 22 insertions(+)
diff --git a/include/linux/bvec.h
This patch introduces helpers of 'bvec_iter_segment_*' for multipage
bvec(segment) support.
The introduced interfaces treate one bvec as real multipage segment,
for example, .bv_len is the total length of the multipage segment.
The existed helpers of bvec_iter_* are interfaces for supporting
This helper is used to iterate multipage bvec for bio spliting/merge,
and it is required in bio_clone_bioset() too, so introduce it.
Signed-off-by: Ming Lei
---
include/linux/bio.h | 34 +++---
include/linux/bvec.h | 36
This patch introduces bio_for_each_page_all2(), which is for replacing
bio_for_each_page_all() in case that the returned bvec has to be single
page bvec.
Given the interface type has to be changed for passing one local iterator
variable of 'bvec_iter_all', and doing all changes in one single
In bch_bio_alloc_pages(), bio_for_each_segment() is fine because this
helper can only be used on a freshly new bio.
For other cases, we conver to bio_for_each_page_all2() since they needn't
to update bvec table.
bio_for_each_page_all() can't be used any more after multipage bvec is
enabled, so
We have to convert to bio_for_each_page_all2() for iterating page by
page.
bio_for_each_page_all() can't be used any more after multipage bvec is
enabled.
Signed-off-by: Ming Lei
---
block/bio.c | 18 --
block/blk-zoned.c | 5 +++--
In bio_check_pages_dirty(), bvec->bv_page is used as flag for marking
if the page has been dirtied & released, and if no, it will be dirtied
in deferred workqueue.
With multipage bvec, we can't do that any more, so change the logic into
checking all pages in one mp bvec, and only release all
bio_for_each_page_all() can't be used any more after multipage bvec is
enabled, so we have to convert to bio_for_each_page_all2().
Signed-off-by: Ming Lei
---
fs/btrfs/compression.c | 3 ++-
fs/btrfs/disk-io.c | 3 ++-
fs/btrfs/extent_io.c | 9 ++---
bio_for_each_page_all() can't be used any more after multipage bvec is
enabled, so we have to convert to bio_for_each_page_all2().
Given bvec can't be changed under bio_for_each_page_all2(), this patch
marks the bvec parameter as 'const' for xfs_finish_page_writeback().
Signed-off-by: Ming Lei
bio_for_each_page_all() can't be used any more after multipage bvec is
enabled, so we have to convert to bio_for_each_page_all2().
Signed-off-by: Ming Lei
---
fs/exofs/ore.c | 3 ++-
fs/exofs/ore_raid.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff
bio_for_each_page_all() can't be used any more after multipage bvec is
enabled, so we have to convert to bio_for_each_page_all2().
Signed-off-by: Ming Lei
---
fs/f2fs/data.c | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/fs/f2fs/data.c
Under some situations, such as block direct I/O, we can't use
bio_add_page() for merging pages into multipage bvec, so
a new function is implemented for converting page array into one
segment array, then these cases can benefit from multipage bvec
too.
Signed-off-by: Ming Lei
This patch pulls the trigger for multipage bvecs.
Now any request queue which supports queue cluster will see multipage
bvecs.
Signed-off-by: Ming Lei
---
block/bio.c | 13 +
1 file changed, 13 insertions(+)
diff --git a/block/bio.c b/block/bio.c
index
Now bio_for_each_page_all() is gone, we can reuse the name to iterate
bio page by page, which is done via bio_for_each_page_all2() now.
Signed-off-by: Ming Lei
---
block/bio.c | 14 +++---
block/blk-zoned.c | 4 ++--
block/bounce.c
No one uses it any more, so kill it and we can reuse this helper
name.
Signed-off-by: Ming Lei
---
include/linux/bio.h | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 5ae2bc876295..c5e692d43f23
Now multipage bvec is supported, and some helpers may return page by
page, and some may return segment by segment, this patch documents the
usage for helping us use them correctly.
Signed-off-by: Ming Lei
---
Documentation/block/biovecs.txt | 32
Now multipage bvec can cover CONFIG_THP_SWAP, so we don't need to
increase BIO_MAX_PAGES for it.
Signed-off-by: Ming Lei
---
include/linux/bio.h | 8
1 file changed, 8 deletions(-)
diff --git a/include/linux/bio.h b/include/linux/bio.h
index
bio_for_each_page_all() can't be used any more after multipage bvec is
enabled, so we have to convert to bio_for_each_page_all2().
Signed-off-by: Ming Lei
---
fs/ext4/page-io.c | 3 ++-
fs/ext4/readpage.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff
As multipage bvec will be enabled soon, bio->bi_vcnt isn't same with
page count in the bio any more, so use bio_for_each_page_all() to
compute the number.
Signed-off-by: Ming Lei
---
include/linux/bio.h | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff
Preparing for supporting multipage bvec.
Cc: Chris Mason
Cc: Josef Bacik
Cc: David Sterba
Cc: linux-bt...@vger.kernel.org
Signed-off-by: Ming Lei
---
fs/btrfs/compression.c | 5 -
fs/btrfs/extent_io.c | 5 +++--
2 files
It is more efficient to use bio_for_each_segment() to map sg, meantime
we have to consider splitting multipage bvec as done in blk_bio_segment_split().
Signed-off-by: Ming Lei
---
block/blk-merge.c | 72 +++
1 file
Hi,
This patchset brings multipage bvec into block layer:
1) what is multipage bvec?
Multipage bvecs means that one 'struct bio_bvec' can hold multiple pages
which are physically contiguous instead of one single page used in linux
kernel for long time.
2) why is multipage bvec introduced?
On Thu, May 24, 2018 at 11:44:41PM +0200, David Sterba wrote:
> On Thu, May 24, 2018 at 05:01:15PM +0800, Ming Lei wrote:
> > Preparing for supporting multipage bvec.
>
> Could you please also CC the cover letter so we have a chance to learn
> what multipage bvec means or what are the changes
On Thu, May 24, 2018 at 05:01:15PM +0800, Ming Lei wrote:
> Preparing for supporting multipage bvec.
Could you please also CC the cover letter so we have a chance to learn
what multipage bvec means or what are the changes between the
iterations? I found it in the archives, but a copy to
On 5/24/18 7:01 AM, Joe Perches wrote:
> On Thu, 2018-05-24 at 06:47 -0600, Jens Axboe wrote:
>> On 5/23/18 4:35 PM, Joe Perches wrote:
>>> On Wed, 2018-05-23 at 15:27 -0600, Jens Axboe wrote:
On 5/23/18 2:05 PM, Joe Perches wrote:
> Convert the S_ symbolic permissions to their octal
On Thu, May 24, 2018 at 1:00 AM, Christoph Hellwig wrote:
> On Wed, May 23, 2018 at 03:14:19PM -0600, Jens Axboe wrote:
>> Ugh, so that would necessitate a change there too. As I said before,
>> I don't really care where it lives. I know the SCSI folks seem bothered
>> by
On 5/24/18 10:52 AM, Omar Sandoval wrote:
> On Thu, May 24, 2018 at 03:49:10PM +0800, Ming Lei wrote:
>> When the allocation process is scheduled back and the mapped hw queue is
>> changed, fake one extra wake up on previous queue for compensating wake up
>> miss, so other allocations on the
On Thu, May 24, 2018 at 03:49:10PM +0800, Ming Lei wrote:
> When the allocation process is scheduled back and the mapped hw queue is
> changed, fake one extra wake up on previous queue for compensating wake up
> miss, so other allocations on the previous queue won't be starved.
>
> This patch
On Wed, May 16, 2018 at 12:03:04PM +0800, Ming Lei wrote:
> +static void nvme_set_host_mem_end_io(struct request *rq, blk_status_t sts)
> +{
> + struct completion *waiting = rq->end_io_data;
> +
> + rq->end_io_data = NULL;
> + blk_mq_free_request(rq);
> +
> + /*
> + * complete
During sequential workloads we can met the case
when almost all the lines are fully written with data.
In that case rate limiter will significantly
reduce the max number of requests for user IOs.
Unfortunately in the case when round buffer is
flushed to drive and the entries are not yet
removed
On Thu, 2018-05-24 at 06:47 -0600, Jens Axboe wrote:
> On 5/23/18 4:35 PM, Joe Perches wrote:
> > On Wed, 2018-05-23 at 15:27 -0600, Jens Axboe wrote:
> > > On 5/23/18 2:05 PM, Joe Perches wrote:
> > > > Convert the S_ symbolic permissions to their octal equivalents as
> > > > using octal and not
Hi Linus,
Two fixes that should go into this release:
- A loop writeback error clearing fix from Jeff.
- The sr sense fix from myself.
Please pull!
git://git.kernel.dk/linux-block.git tags/for-linus-20180524
Jeff Layton (1
In some cases, users can want set write buffer size manually, e.g. to
adjust it to specific workload. This patch provides the possibility to set
write buffer size via module parameter feature.
Signed-off-by: Marcin Dziegielewski
Signed-off-by: Igor Konopko
On 5/23/18 4:35 PM, Joe Perches wrote:
> On Wed, 2018-05-23 at 15:27 -0600, Jens Axboe wrote:
>> On 5/23/18 2:05 PM, Joe Perches wrote:
>>> Convert the S_ symbolic permissions to their octal equivalents as
>>> using octal and not symbolic permissions is preferred by many as more
>>> readable.
>>>
Thanks for the review, that’s good point. Improved patch is on its way.
Marcin Dzięgielewski
> -Original Message-
> From: Matias Bjørling [mailto:m...@lightnvm.io]
> Sent: Thursday, May 24, 2018 10:20 AM
> To: Dziegielewski, Marcin
> Cc:
Under some situations, such as block direct I/O, we can't use
bio_add_page() for merging pages into multipage bvec, so
a new function is implemented for converting page array into one
segment array, then these cases can benefit from multipage bvec
too.
Signed-off-by: Ming Lei
Now multipage bvec can cover CONFIG_THP_SWAP, so we don't need to
increase BIO_MAX_PAGES for it.
Signed-off-by: Ming Lei
---
include/linux/bio.h | 8
1 file changed, 8 deletions(-)
diff --git a/include/linux/bio.h b/include/linux/bio.h
index
Now multipage bvec is supported, and some helpers may return page by
page, and some may return segment by segment, this patch documents the
usage for helping us use them correctly.
Signed-off-by: Ming Lei
---
Documentation/block/biovecs.txt | 32
This patch pulls the trigger for multipage bvecs.
Now any request queue which supports queue cluster will see multipage
bvecs.
Signed-off-by: Ming Lei
---
block/bio.c | 13 +
1 file changed, 13 insertions(+)
diff --git a/block/bio.c b/block/bio.c
index
bio_for_each_page_all() can't be used any more after multipage bvec is
enabled, so we have to convert to bio_for_each_page_all2().
Given bvec can't be changed inside bio_for_each_page_all2(), this patch
marks the bvec parameter as 'const' for gfs2_end_log_write_bh().
Signed-off-by: Ming Lei
Now bio_for_each_page_all() is gone, we can reuse the name to iterate
bio page by page, which is done via bio_for_each_page_all2() now.
Signed-off-by: Ming Lei
---
block/bio.c | 14 +++---
block/blk-zoned.c | 4 ++--
block/bounce.c
bio_for_each_page_all() can't be used any more after multipage bvec is
enabled, so we have to convert to bio_for_each_page_all2().
Signed-off-by: Ming Lei
---
fs/exofs/ore.c | 3 ++-
fs/exofs/ore_raid.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff
No one uses it any more, so kill it and we can reuse this helper
name.
Signed-off-by: Ming Lei
---
include/linux/bio.h | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 5ae2bc876295..c5e692d43f23
bio_for_each_page_all() can't be used any more after multipage bvec is
enabled, so we have to convert to bio_for_each_page_all2().
Given bvec can't be changed under bio_for_each_page_all2(), this patch
marks the bvec parameter as 'const' for xfs_finish_page_writeback().
Signed-off-by: Ming Lei
bio_for_each_page_all() can't be used any more after multipage bvec is
enabled, so we have to convert to bio_for_each_page_all2().
Signed-off-by: Ming Lei
---
fs/f2fs/data.c | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/fs/f2fs/data.c
bio_for_each_page_all() can't be used any more after multipage bvec is
enabled, so we have to convert to bio_for_each_page_all2().
Signed-off-by: Ming Lei
---
fs/btrfs/compression.c | 3 ++-
fs/btrfs/disk-io.c | 3 ++-
fs/btrfs/extent_io.c | 9 ++---
bio_for_each_page_all() can't be used any more after multipage bvec is
enabled, so we have to convert to bio_for_each_page_all2().
Signed-off-by: Ming Lei
---
fs/ext4/page-io.c | 3 ++-
fs/ext4/readpage.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff
bio_for_each_page_all() can't be used any more after multipage bvec is
enabled, so we have to convert to bio_for_each_page_all2().
Signed-off-by: Ming Lei
---
fs/block_dev.c | 6 --
fs/crypto/bio.c | 3 ++-
fs/direct-io.c | 4 +++-
fs/iomap.c | 3 ++-
fs/mpage.c
We have to convert to bio_for_each_page_all2() for iterating page by
page.
bio_for_each_page_all() can't be used any more after multipage bvec is
enabled.
Signed-off-by: Ming Lei
---
block/bio.c | 18 --
block/blk-zoned.c | 5 +++--
In bch_bio_alloc_pages(), bio_for_each_segment() is fine because this
helper can only be used on a freshly new bio.
For other cases, we conver to bio_for_each_page_all2() since they needn't
to update bvec table.
bio_for_each_page_all() can't be used any more after multipage bvec is
enabled, so
The incoming bio will become very big after multipage bvec is enabled,
so we can't clone bio page by page.
This patch uses the introduced bio_clone_seg_bioset(), so the incoming
bio can be cloned successfully. This way is safe because device mapping
won't modify the bio vector on the cloned
This patch introduces bio_for_each_page_all2(), which is for replacing
bio_for_each_page_all() in case that the returned bvec has to be single
page bvec.
Given the interface type has to be changed for passing one local iterator
variable of 'bvec_iter_all', and doing all changes in one single
In bio_check_pages_dirty(), bvec->bv_page is used as flag for marking
if the page has been dirtied & released, and if no, it will be dirtied
in deferred workqueue.
With multipage bvec, we can't do that any more, so change the logic into
checking all pages in one mp bvec, and only release all
There is one use case(DM) which requires to clone bio segment by
segement, so introduce this API.
Signed-off-by: Ming Lei
---
block/bio.c | 56 +++--
include/linux/bio.h | 1 +
2 files changed, 43 insertions(+), 14
iov_iter is implemented with bvec itererator, so it is safe to pass
segment to it, and this way is much more efficient than passing one
page in each bvec.
Signed-off-by: Ming Lei
---
drivers/block/loop.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff
Preparing for supporting multipage bvec.
Cc: Chris Mason
Cc: Josef Bacik
Cc: David Sterba
Cc: linux-bt...@vger.kernel.org
Signed-off-by: Ming Lei
---
fs/btrfs/compression.c | 5 -
fs/btrfs/extent_io.c | 5 +++--
2 files
There are still cases in which rq_for_each_segment() is required, for
example, loop.
Signed-off-by: Ming Lei
---
include/linux/blkdev.h | 4
1 file changed, 4 insertions(+)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 1e8e9b430008..0b15bc625bd7
As multipage bvec will be enabled soon, bio->bi_vcnt isn't same with
page count in the bio any more, so use bio_for_each_page_all() to
compute the number.
Signed-off-by: Ming Lei
---
include/linux/bio.h | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff
There are still cases in which we need to use bio_segments() for get the
number of segment, so introduce it.
Signed-off-by: Ming Lei
---
include/linux/bio.h | 25 -
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/include/linux/bio.h
It is more efficient to use bio_for_each_segment() to map sg, meantime
we have to consider splitting multipage bvec as done in blk_bio_segment_split().
Signed-off-by: Ming Lei
---
block/blk-merge.c | 72 +++
1 file
This helper is used to iterate multipage bvec for bio spliting/merge,
and it is required in bio_clone_bioset() too, so introduce it.
Signed-off-by: Ming Lei
---
include/linux/bio.h | 34 +++---
include/linux/bvec.h | 36
Firstly it is more efficient to use bio_for_each_segment() in both
blk_bio_segment_split() and __blk_recalc_rq_segments() to compute how many
segments there are in the bio.
Secondaly once bio_for_each_segment() is used, the bvec may need to
be splitted because its length can be very longer than
BTRFS and guard_bio_eod() need to get the last page from one segment, so
introduce this helper to make them happy.
Signed-off-by: Ming Lei
---
include/linux/bvec.h | 22 ++
1 file changed, 22 insertions(+)
diff --git a/include/linux/bvec.h
Once multipage bvec is enabled, the last bvec may include more than one
page, this patch use segment_last_page() to truncate the bio.
Signed-off-by: Ming Lei
---
fs/buffer.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/buffer.c b/fs/buffer.c
Hi,
This patchset brings multipage bvec into block layer:
1) what is multipage bvec?
Multipage bvecs means that one 'struct bio_bvec' can hold multiple pages
which are physically contiguous instead of one single page used in linux
kernel for long time.
2) why is multipage bvec introduced?
This patch introduces helpers of 'bvec_iter_segment_*' for multipage
bvec(segment) support.
The introduced interfaces treate one bvec as real multipage segment,
for example, .bv_len is the total length of the multipage segment.
The existed helpers of bvec_iter_* are interfaces for supporting
rq_for_each_segment() still deceives us since this helper only returns
one page in each bvec, so fixes its name.
Signed-off-by: Ming Lei
---
Documentation/block/biodoc.txt | 6 +++---
block/blk-core.c | 2 +-
drivers/block/floppy.c | 4 ++--
bio_segments() never returns count of actual segment, just like
original bio_for_each_segment(), so rename it as bio_pages().
Signed-off-by: Ming Lei
---
block/bio.c| 2 +-
block/blk-merge.c | 2 +-
drivers/block/loop.c
It is a tree-wide mechanical replacement since both bio_for_each_segment()
and bio_for_each_segment_all() never returns real segment at all, and
both just return one page per bvec and deceive us for long time, so fix
their names.
This is a pre-patch for supporting multipage bvec. Once multipage
On 05/23/2018 05:17 PM, Marcin Dziegielewski wrote:
In some cases, users can want set write buffer size manually, e.g. to
adjust it to specific workload. This patch provides the possibility to set
write buffer size via module parameter feature.
Signed-off-by: Marcin Dziegielewski
On 05/23/2018 02:29 PM, Igor Konopko wrote:
This patchset provides a proper handling for some of the errors which
are not gracefully handled right now.
Igor Konopko (3):
lightnvm: Proper error handling for pblk_bio_add_pages
lightnvm: Handling when whole line is bad
lightnvm: Fix
On 05/23/2018 05:17 PM, Marcin Dziegielewski wrote:
Some devices can expose mw_cunits equal to 0, it can cause creation of too
small write buffer and in consecuence performance drop on write workloads.
To handle that, in such case we are using default value for MLC and
beacause it covers both
On 05/23/2018 02:29 PM, Igor Konopko wrote:
This patchset provides a proper handling for some of the errors which
are not gracefully handled right now.
Igor Konopko (3):
lightnvm: Proper error handling for pblk_bio_add_pages
lightnvm: Handling when whole line is bad
lightnvm: Fix
On Wed, May 23, 2018 at 03:14:19PM -0600, Jens Axboe wrote:
> Ugh, so that would necessitate a change there too. As I said before,
> I don't really care where it lives. I know the SCSI folks seem bothered
> by moving it, but in reality, it's not like this stuff will likely ever
> really change. Of
When the allocation process is scheduled back and the mapped hw queue is
changed, fake one extra wake up on previous queue for compensating wake up
miss, so other allocations on the previous queue won't be starved.
This patch fixes one request allocation hang issue, which can be
triggered easily
On Wed, May 23, 2018 at 02:17:14PM -0700, Kees Cook wrote:
>
> True, though I'm finding other robustness issues in the CDROM code.
> They're probably all insane corner cases, but it seems like it'd be
> nice to just fix them:
>
> diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
> index
85 matches
Mail list logo