RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2090016 - block layer: io is issued to low level driver in reversed order when plug is applied
Summary: block layer: io is issued to low level driver in reversed order when plug is ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: kernel
Version: 9.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 9.3
Assignee: Ming Lei
QA Contact: ChanghuiZhong
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-25 00:45 UTC by Ming Lei
Modified: 2023-11-07 10:16 UTC (History)
4 users (show)

Fixed In Version: kernel-5.14.0-319.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-07 08:38:52 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Gitlab redhat/centos-stream/src/kernel centos-stream-9 merge_requests 2356 0 None opened block: do not reverse request order when flushing plug list 2023-04-13 03:58:47 UTC
Red Hat Issue Tracker RHELPLAN-123275 0 None None None 2022-05-25 00:52:09 UTC
Red Hat Product Errata RHSA-2023:6583 0 None None None 2023-11-07 08:39:15 UTC

Description Ming Lei 2022-05-25 00:45:35 UTC
Description of problem:

https://lore.kernel.org/linux-nvme/CAHex0coMNvFa1TPzK+5mZHsiie4d1Jd0Z8ejcZk1Vi1_4F7eRg@mail.gmail.com/T/#t


Version-Release number of selected component (if applicable):


How reproducible:

100%


Steps to Reproduce:

- run libaio with submit/complete batch


Actual results:

io is issued in reverse order


Expected results:

io is issued in sequential order


Additional info:

- v5.18 has the issue, and not fixed in recent linus tree yet
- introduced in the commit: bc490f81731e ("block: change plugging to use a singly linked list")

Comment 4 Ming Lei 2023-05-16 11:10:00 UTC
Hi Changhui,

Can you test this MR so that we can move on?

thanks,

Comment 5 ChanghuiZhong 2023-05-18 08:06:06 UTC
(In reply to Ming Lei from comment #4)
> Hi Changhui,
> 
> Can you test this MR so that we can move on?
> 
> thanks,

Hi,Ming

I got reverse order both on 5.14.0-312.el9 and 5.14.0-298.2356_835743992.el9,

[root@storageqe-101 ~]# uname -r
5.14.0-312.el9.x86_64
[root@storageqe-101 ~]# 
<...>-3030    [014] .......  1475.336100: nvme_setup_cmd: nvme0: disk=nvme0n1, qid=24, cmdid=771, nsid=1, flags=0x0, meta=0x0, cmd=(nvme_cmd_write slba=192, len=63, ctrl=0x0, dsmgmt=0, reftag=0)
fio-3030    [014] .......  1475.336106: nvme_setup_cmd: nvme0: disk=nvme0n1, qid=24, cmdid=770, nsid=1, flags=0x0, meta=0x0, cmd=(nvme_cmd_write slba=128, len=63, ctrl=0x0, dsmgmt=0, reftag=0)
fio-3030    [014] .......  1475.336106: nvme_setup_cmd: nvme0: disk=nvme0n1, qid=24, cmdid=769, nsid=1, flags=0x0, meta=0x0, cmd=(nvme_cmd_write slba=64, len=63, ctrl=0x0, dsmgmt=0, reftag=0)
fio-3030    [014] .......  1475.336107: nvme_setup_cmd: nvme0: disk=nvme0n1, qid=24, cmdid=768, nsid=1, flags=0x0, meta=0x0, cmd=(nvme_cmd_write slba=0, len=63, ctrl=0x0, dsmgmt=0, reftag=0)

[root@storageqe-101 ~]# uname -r
5.14.0-298.2356_835743992.el9.x86_64
[root@storageqe-101 ~]# 
fio-7637    [002] .......  2490.325932: nvme_setup_cmd: nvme0: disk=nvme0n1, qid=18, cmdid=707, nsid=1, flags=0x0, meta=0x0, cmd=(nvme_cmd_write slba=192, len=63, ctrl=0x0, dsmgmt=0, reftag=0)
fio-7637    [002] .......  2490.325937: nvme_setup_cmd: nvme0: disk=nvme0n1, qid=18, cmdid=706, nsid=1, flags=0x0, meta=0x0, cmd=(nvme_cmd_write slba=128, len=63, ctrl=0x0, dsmgmt=0, reftag=0)
fio-7637    [002] .......  2490.325938: nvme_setup_cmd: nvme0: disk=nvme0n1, qid=18, cmdid=705, nsid=1, flags=0x0, meta=0x0, cmd=(nvme_cmd_write slba=64, len=63, ctrl=0x0, dsmgmt=0, reftag=0)
fio-7637    [002] .......  2490.325939: nvme_setup_cmd: nvme0: disk=nvme0n1, qid=18, cmdid=704, nsid=1, flags=0x0, meta=0x0, cmd=(nvme_cmd_write slba=0, len=63, ctrl=0x0, dsmgmt=0, reftag=0)
             

             
terminal 1:
cd /sys/kernel/debug/tracing/events/nvme/nvme_setup_cmd
echo 'disk=="nvme0n1"' > filter
echo 1 > enable
cat /sys/kernel/debug/tracing/trace_pipe

termina 2:
echo 32 > /sys/block/nvme0n1/queue/max_sectors_kb
fio --name dbg --filename=/dev/nvme0n1 --rw=write --iodepth=1 --bs=128K --ioengine=libaio --direct=1 --size=1M

is there something wrong with my steps to reproduce?

Thanks,

Comment 6 Ming Lei 2023-05-22 14:22:36 UTC
(In reply to ChanghuiZhong from comment #5)
> (In reply to Ming Lei from comment #4)
> > Hi Changhui,
> > 
> > Can you test this MR so that we can move on?
> > 
> > thanks,
> 
> Hi,Ming
> 
> I got reverse order both on 5.14.0-312.el9 and 5.14.0-298.2356_835743992.el9,
> 
> [root@storageqe-101 ~]# uname -r
> 5.14.0-312.el9.x86_64
> [root@storageqe-101 ~]# 
> <...>-3030    [014] .......  1475.336100: nvme_setup_cmd: nvme0:
> disk=nvme0n1, qid=24, cmdid=771, nsid=1, flags=0x0, meta=0x0,
> cmd=(nvme_cmd_write slba=192, len=63, ctrl=0x0, dsmgmt=0, reftag=0)
> fio-3030    [014] .......  1475.336106: nvme_setup_cmd: nvme0: disk=nvme0n1,
> qid=24, cmdid=770, nsid=1, flags=0x0, meta=0x0, cmd=(nvme_cmd_write
> slba=128, len=63, ctrl=0x0, dsmgmt=0, reftag=0)
> fio-3030    [014] .......  1475.336106: nvme_setup_cmd: nvme0: disk=nvme0n1,
> qid=24, cmdid=769, nsid=1, flags=0x0, meta=0x0, cmd=(nvme_cmd_write slba=64,
> len=63, ctrl=0x0, dsmgmt=0, reftag=0)
> fio-3030    [014] .......  1475.336107: nvme_setup_cmd: nvme0: disk=nvme0n1,
> qid=24, cmdid=768, nsid=1, flags=0x0, meta=0x0, cmd=(nvme_cmd_write slba=0,
> len=63, ctrl=0x0, dsmgmt=0, reftag=0)
> 
> [root@storageqe-101 ~]# uname -r
> 5.14.0-298.2356_835743992.el9.x86_64
> [root@storageqe-101 ~]# 
> fio-7637    [002] .......  2490.325932: nvme_setup_cmd: nvme0: disk=nvme0n1,
> qid=18, cmdid=707, nsid=1, flags=0x0, meta=0x0, cmd=(nvme_cmd_write
> slba=192, len=63, ctrl=0x0, dsmgmt=0, reftag=0)
> fio-7637    [002] .......  2490.325937: nvme_setup_cmd: nvme0: disk=nvme0n1,
> qid=18, cmdid=706, nsid=1, flags=0x0, meta=0x0, cmd=(nvme_cmd_write
> slba=128, len=63, ctrl=0x0, dsmgmt=0, reftag=0)
> fio-7637    [002] .......  2490.325938: nvme_setup_cmd: nvme0: disk=nvme0n1,
> qid=18, cmdid=705, nsid=1, flags=0x0, meta=0x0, cmd=(nvme_cmd_write slba=64,
> len=63, ctrl=0x0, dsmgmt=0, reftag=0)
> fio-7637    [002] .......  2490.325939: nvme_setup_cmd: nvme0: disk=nvme0n1,
> qid=18, cmdid=704, nsid=1, flags=0x0, meta=0x0, cmd=(nvme_cmd_write slba=0,
> len=63, ctrl=0x0, dsmgmt=0, reftag=0)
>              
> 
>              
> terminal 1:
> cd /sys/kernel/debug/tracing/events/nvme/nvme_setup_cmd
> echo 'disk=="nvme0n1"' > filter
> echo 1 > enable
> cat /sys/kernel/debug/tracing/trace_pipe
> 
> termina 2:
> echo 32 > /sys/block/nvme0n1/queue/max_sectors_kb
> fio --name dbg --filename=/dev/nvme0n1 --rw=write --iodepth=1 --bs=128K
> --ioengine=libaio --direct=1 --size=1M
> 
> is there something wrong with my steps to reproduce?

You are testing split io order, and this MR addresses request order when flushing
plug list, and the two aren't different.

Link [1] mentioned that:

Submitting requests in reverse order has negative impact on
performance for rotational disks (when BFQ is not in use). We observe
10-25% regression in random 4k write throughput, as well as ~20%
regression in MariaDB OLTP benchmark on rotational storage on btrfs
filesystem.


[1] https://lore.kernel.org/all/20230313093002.11756-1-jack@suse.cz/
[PATCH] block: do not reverse request order when flushing plug list

Comment 13 errata-xmlrpc 2023-11-07 08:38:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: kernel security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:6583


Note You need to log in before you can comment on or make changes to this bug.