2020-12-23 06:08:54

by Hui Su

[permalink] [raw]
Subject: [PATCH] blokc/blk-merge: remove the next_bvec label in __blk_bios_map_sg()[email protected] (open list:BLOCK LAYER)

remove the next_bvec label in __blk_bios_map_sg(), simplify the logic
of traversal bvec.

Signed-off-by: sh <[email protected]>
---
block/blk-merge.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/block/blk-merge.c b/block/blk-merge.c
index 808768f6b174..aa113cbc0f35 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -494,15 +494,15 @@ static int __blk_bios_map_sg(struct request_queue *q, struct bio *bio,
* to bio
*/
if (new_bio &&
- __blk_segment_map_sg_merge(q, &bvec, &bvprv, sg))
- goto next_bvec;
+ __blk_segment_map_sg_merge(q, &bvec, &bvprv, sg)) {
+ new_bio = false;
+ continue;
+ }

if (bvec.bv_offset + bvec.bv_len <= PAGE_SIZE)
nsegs += __blk_bvec_map_sg(bvec, sglist, sg);
else
nsegs += blk_bvec_map_sg(q, &bvec, sglist, sg);
- next_bvec:
- new_bio = false;
}
if (likely(bio->bi_iter.bi_size)) {
bvprv = bvec;
--
2.25.1



2020-12-23 08:16:25

by Hui Su

[permalink] [raw]

2020-12-23 08:35:43

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH] blokc/blk-merge: remove the next_bvec label in __blk_bios_map_sg()[email protected] (open list:BLOCK LAYER)

On Wed, Dec 23, 2020 at 12:31:58PM +0800, sh wrote:
> remove the next_bvec label in __blk_bios_map_sg(), simplify the logic
> of traversal bvec.

What makes you believe that this simplifies anything?

2020-12-23 11:03:31

by Hui Su

[permalink] [raw]
Subject: Re: [PATCH] blokc/blk-merge: remove the next_bvec label in __blk_bios_map_sg()[email protected] (open list:BLOCK LAYER)

On Wed, Dec 23, 2020 at 08:33:07AM +0000, Christoph Hellwig wrote:
> On Wed, Dec 23, 2020 at 12:31:58PM +0800, sh wrote:
> > remove the next_bvec label in __blk_bios_map_sg(), simplify the logic
> > of traversal bvec.
>
> What makes you believe that this simplifies anything?

1. this change remove the jump lable, so we do not need goto.
2. we do not need to assign flase to new_bio in the
bio_for_each_bvec, we only need to assign false to new_bio at first.

And I have resend a PATCH V2, this change have some format problem.

Thanks.

2020-12-30 06:27:04

by kernel test robot

[permalink] [raw]
Subject: [blokc/blk] d9ad3bf8cb: xfstests.generic.299.fail


Greeting,

FYI, we noticed the following commit (built with gcc-9):

commit: d9ad3bf8cb2c5fa6738a48e303b2b0f50770700a ("[PATCH] blokc/blk-merge: remove the next_bvec label in __blk_bios_map_sg()[email protected] (open list:BLOCK LAYER)")
url: https://github.com/0day-ci/linux/commits/sh/blokc-blk-merge-remove-the-next_bvec-label-in-__blk_bios_map_sg-linux-block-vger-kernel-org-open-list-BLOCK-LAYER/20201223-140957
base: https://git.kernel.org/cgit/linux/kernel/git/axboe/linux-block.git for-next

in testcase: xfstests
version: xfstests-x86_64-d41dcbd-1_20201218
with following parameters:

disk: 4HDD
fs: btrfs
test: generic-group-14
ucode: 0x21

test-description: xfstests is a regression test suite for xfs and other files ystems.
test-url: git://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git


on test machine: 4 threads Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz with 8G memory

caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace):




If you fix the issue, kindly add following tag
Reported-by: kernel test robot <[email protected]>

2020-12-29 18:23:58 export TEST_DIR=/fs/sda1
2020-12-29 18:23:58 export TEST_DEV=/dev/sda1
2020-12-29 18:23:58 export FSTYP=btrfs
2020-12-29 18:23:58 export SCRATCH_MNT=/fs/scratch
2020-12-29 18:23:58 mkdir /fs/scratch -p
2020-12-29 18:23:58 export SCRATCH_DEV_POOL="/dev/sda2 /dev/sda3 /dev/sda4"
2020-12-29 18:23:58 sed "s:^:generic/:" //lkp/benchmarks/xfstests/tests/generic-group-14
2020-12-29 18:23:58 ./check generic/280 generic/281 generic/282 generic/283 generic/284 generic/285 generic/286 generic/287 generic/288 generic/289 generic/290 generic/291 generic/292 generic/293 generic/294 generic/295 generic/296 generic/298 generic/299
FSTYP -- btrfs
PLATFORM -- Linux/x86_64 lkp-ivb-d02 5.10.0-gd9ad3bf8cb2c #1 SMP Fri Dec 25 09:02:24 CST 2020
MKFS_OPTIONS -- /dev/sda2
MOUNT_OPTIONS -- /dev/sda2 /fs/scratch

generic/280 [not run] disk quotas not supported by this filesystem type: btrfs
generic/281 3s
generic/282 2s
generic/283 3s
generic/284 2s
generic/285 0s
generic/286 2s
generic/287 1s
generic/288 [not run] FITRIM not supported on /fs/scratch
generic/289 1s
generic/290 1s
generic/291 2s
generic/292 2s
generic/293 2s
generic/294 1s
generic/295 2s
generic/296 1s
generic/298 _check_btrfs_filesystem: filesystem on /dev/sda2 is inconsistent
(see /lkp/benchmarks/xfstests/results//generic/298.full for details)

generic/299 _check_btrfs_filesystem: filesystem on /dev/sda2 is inconsistent
(see /lkp/benchmarks/xfstests/results//generic/299.full for details)

Ran: generic/280 generic/281 generic/282 generic/283 generic/284 generic/285 generic/286 generic/287 generic/288 generic/289 generic/290 generic/291 generic/292 generic/293 generic/294 generic/295 generic/296 generic/298 generic/299
Not run: generic/280 generic/288
Failures: generic/298 generic/299
Failed 2 of 19 tests




To reproduce:

git clone https://github.com/intel/lkp-tests.git
cd lkp-tests
bin/lkp install job.yaml # job file is attached in this email
bin/lkp run job.yaml



Thanks,
Oliver Sang


Attachments:
(No filename) (3.15 kB)
config-5.10.0-gd9ad3bf8cb2c (174.62 kB)
job-script (6.21 kB)
kmsg.xz (24.46 kB)
xfstests (1.82 kB)
job.yaml (5.06 kB)
reproduce (943.00 B)
Download all attachments