Patch "md: raid0: account for split bio in iostat accounting" has been added to the 6.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    md: raid0: account for split bio in iostat accounting

to the 6.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     md-raid0-account-for-split-bio-in-iostat-accounting.patch
and it can be found in the queue-6.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 03eaa14a6821412916cdf38c54c81f9824973220
Author: David Jeffery <djeffery@xxxxxxxxxx>
Date:   Wed Aug 16 14:13:55 2023 -0400

    md: raid0: account for split bio in iostat accounting
    
    [ Upstream commit cc22b5407e9ca76adb7efeed843146510b1b72a5 ]
    
    When a bio is split by md raid0, the newly created bio will not be tracked
    by md for I/O accounting. Only the portion of I/O still assigned to the
    original bio which was reduced by the split will be accounted for. This
    results in md iostat data sometimes showing I/O values far below the actual
    amount of data being sent through md.
    
    md_account_bio() needs to be called for all bio generated by the bio split.
    
    A simple example of the issue was generated using a raid0 device on partitions
    to the same device. Since all raid0 I/O then goes to one device, it makes it
    easy to see a gap between the md device and its sd storage. Reading an lvm
    device on top of the md device, the iostat output (some 0 columns and extra
    devices removed to make the data more compact) was:
    
    Device             tps    kB_read/s    kB_wrtn/s    kB_dscd/s    kB_read
    md2               0.00         0.00         0.00         0.00          0
    sde               0.00         0.00         0.00         0.00          0
    md2            1364.00    411496.00         0.00         0.00     411496
    sde            1734.00    646144.00         0.00         0.00     646144
    md2            1699.00    510680.00         0.00         0.00     510680
    sde            2155.00    802784.00         0.00         0.00     802784
    md2             803.00    241480.00         0.00         0.00     241480
    sde            1016.00    377888.00         0.00         0.00     377888
    md2               0.00         0.00         0.00         0.00          0
    sde               0.00         0.00         0.00         0.00          0
    
    I/O was generated doing large direct I/O reads (12M) with dd to a linear
    lvm volume on top of the 4 leg raid0 device.
    
    The md2 reads were showing as roughly 2/3 of the reads to the sde device
    containing all of md2's raid partitions. The sum of reads to sde was
    1826816 kB, which was the expected amount as it was the amount read by
    dd. With the patch, the total reads from md will match the reads from
    sde and be consistent with the amount of I/O generated.
    
    Fixes: 10764815ff47 ("md: add io accounting for raid0 and raid5")
    Signed-off-by: David Jeffery <djeffery@xxxxxxxxxx>
    Tested-by: Laurence Oberman <loberman@xxxxxxxxxx>
    Reviewed-by: Laurence Oberman <loberman@xxxxxxxxxx>
    Reviewed-by: Yu Kuai <yukuai3@xxxxxxxxxx>
    Signed-off-by: Song Liu <song@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230816181433.13289-1-djeffery@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index 595856948dff8..7c6a0b4437d8f 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -565,8 +565,7 @@ static void raid0_map_submit_bio(struct mddev *mddev, struct bio *bio)
 	sector_t bio_sector = bio->bi_iter.bi_sector;
 	sector_t sector = bio_sector;
 
-	if (bio->bi_pool != &mddev->bio_set)
-		md_account_bio(mddev, &bio);
+	md_account_bio(mddev, &bio);
 
 	zone = find_zone(mddev->private, &sector);
 	switch (conf->layout) {



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux