Performing verification for noble.

Firstly, I started with 6.8.0-57-generic with the following commit
reverted:

commit ab99a87542f194f28e2364a42afbf9fb48b1c724
Author: Ofir Gal <ofir....@volumez.com>
Date: Fri Jun 7 10:27:44 2024 +0300
Subject: md/md-bitmap: fix writing non bitmap pages
Link: 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ab99a87542f194f28e2364a42afbf9fb48b1c724

This is because the testcases are the same, as the above bug was fixed due to
this bug existing in the first place.

I ran the reproducer:

sudo[1591]: mruffell : TTY=pts/0 ; PWD=/home/mruffell/blktests ; USER=root ; 
COMMAND=./check md/001
sudo[1591]: pam_unix(sudo:session): session opened for user root(uid=0) by 
mruffell(uid=1003)
unknown: run blktests md/001 at 2025-04-07 03:19:12
root[1627]: run blktests md/001
kernel: brd: module loaded
(udev-worker)[1632]: dm-0: Process '/usr/bin/unshare -m /usr/bin/snap 
auto-import --mount=/dev/dm-0' failed with exit code 1.
kernel: Key type psk registered
kernel: nvmet: adding nsid 1 to subsystem blktests-subsystem-1
kernel: nvmet_tcp: enabling port 0 (127.0.0.1:4420)
kernel: nvmet: creating nvm controller 1 for subsystem blktests-subsystem-1 for 
NQN nqn.2014-08.org.nvmexpress:uuid:0f01fb42-9f7f-4856-b0b3-51e60b8de349.
kernel: nvme nvme1: creating 2 I/O queues.
kernel: nvme nvme1: mapped 2/0/0 default/read/poll queues.
kernel: nvme nvme1: new ctrl: NQN "blktests-subsystem-1", addr 127.0.0.1:4420, 
hostnqn: nqn.2014-08.org.nvmexpress:uuid:0f01fb42-9f7f-4856-b0b3-51e60b8de349
(udev-worker)[1632]: nvme1n1: Process '/usr/bin/unshare -m /usr/bin/snap 
auto-import --mount=/dev/nvme1n1' failed with exit code 1.
(udev-worker)[1632]: md127: Process '/usr/bin/unshare -m /usr/bin/snap 
auto-import --mount=/dev/md127' failed with exit code 1.
kernel: md/raid1:md127: active with 1 out of 2 mirrors
kernel: ------------[ cut here ]------------
kernel: WARNING: CPU: 1 PID: 58 at net/core/skbuff.c:7006 
skb_splice_from_iter+0x139/0x370
kernel: Modules linked in: nvme_tcp nvmet_tcp nvmet nvme_keyring brd raid1 tls 
cfg80211 8021q garp mrp stp llc binfmt_misc nls_iso8859_1 intel_rapl_msr 
intel_rapl_common intel_uncore_frequency_common isst_if_common skx_edac_common 
nfit crct10dif_pclmul crc32_pclmul polyval_clmulni polyval_generic 
ghash_clmulni_intel sha256_ssse3 sha1_ssse3 aesni_intel crypto_simd cryptd rapl 
psmouse nvme pvpanic_mmio pvpanic i2c_piix4 input_leds mac_hid serio_raw 
sch_fq_codel dm_multipath nvme_fabrics nvme_core nvme_auth efi_pstore nfnetlink 
dmi_sysfs virtio_rng ip_tables x_tables autofs4
kernel: CPU: 1 PID: 58 Comm: kworker/1:1H Not tainted 6.8.0-57-generic 
#52+TEST404844v20250402b1-Ubuntu
kernel: Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS 
Google 02/12/2025
kernel: Workqueue: nvme_tcp_wq nvme_tcp_io_work [nvme_tcp]
kernel: RIP: 0010:skb_splice_from_iter+0x139/0x370
kernel: Code: 39 e1 48 8b 53 08 49 0f 47 cc 49 89 cd f6 c2 01 0f 85 c0 01 00 00 
66 90 48 89 da 48 8b 12 80 e6 08 0f 84 8e 00 00 00 4d 89 fe <0f> 0b 49 c7 c0 fb 
ff ff ff 48 8b 85 68 ff ff ff 41 01 46 70 41 01
kernel: RSP: 0018:ffffb1e9401fba38 EFLAGS: 00010246
kernel: RAX: 0000000000000000 RBX: ffffe43105245700 RCX: 00000000000009e8
kernel: RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
kernel: RBP: ffffb1e9401fbae0 R08: 0000000000000000 R09: 0000000000000000
kernel: R10: 0000000000000000 R11: 0000000000000000 R12: 00000000000009e8
kernel: R13: 00000000000009e8 R14: ffff97c745626c00 R15: ffff97c745626c00
kernel: FS:  0000000000000000(0000) GS:ffff97c877d00000(0000) 
knlGS:0000000000000000
kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
kernel: CR2: 00005d8c3063bd20 CR3: 0000000110f88003 CR4: 00000000003706f0
kernel: DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
kernel: DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
kernel: Call Trace:
kernel:  <TASK>
kernel:  ? show_regs+0x6d/0x80
kernel:  ? __warn+0x89/0x160
kernel:  ? skb_splice_from_iter+0x139/0x370
kernel:  ? report_bug+0x17e/0x1b0
kernel:  ? handle_bug+0x51/0xa0
kernel:  ? exc_invalid_op+0x18/0x80
kernel:  ? asm_exc_invalid_op+0x1b/0x20
kernel:  ? skb_splice_from_iter+0x139/0x370
kernel:  ? skb_splice_from_iter+0xd5/0x370
kernel:  tcp_sendmsg_locked+0x352/0xd70
kernel:  ? tcp_push+0x159/0x190
kernel:  ? tcp_sendmsg_locked+0x9c4/0xd70
kernel:  tcp_sendmsg+0x2c/0x50
kernel:  inet_sendmsg+0x42/0x80
kernel:  sock_sendmsg+0x118/0x150
kernel:  nvme_tcp_try_send_data+0x16e/0x4d0 [nvme_tcp]
kernel:  nvme_tcp_try_send+0x23c/0x300 [nvme_tcp]
kernel:  nvme_tcp_io_work+0x40/0xe0 [nvme_tcp]
kernel:  process_one_work+0x175/0x350
kernel:  worker_thread+0x306/0x440
kernel:  ? _raw_spin_unlock_irqrestore+0x11/0x60
kernel:  ? __pfx_worker_thread+0x10/0x10
kernel:  kthread+0xef/0x120
kernel:  ? __pfx_kthread+0x10/0x10
kernel:  ret_from_fork+0x44/0x70
kernel:  ? __pfx_kthread+0x10/0x10
kernel:  ret_from_fork_asm+0x1b/0x30
kernel:  </TASK>
kernel: ---[ end trace 0000000000000000 ]---

Okay, we can reproduce the issue.

I then enabled -proposed, and installed 6.8.0-58-generic, note, which
contains:

commit ab99a87542f194f28e2364a42afbf9fb48b1c724
Author: Ofir Gal <ofir....@volumez.com>
Date: Fri Jun 7 10:27:44 2024 +0300
Subject: md/md-bitmap: fix writing non bitmap pages
Link: 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ab99a87542f194f28e2364a42afbf9fb48b1c724

AND the three fixed we are testing:

commit 23a55f4492fcf868d068da31a2cd30c15f46207d
Author: Ofir Gal <ofir....@volumez.com>
Date: Thu Jul 18 11:45:12 2024 +0300
Subject: net: introduce helper sendpages_ok()
Link: 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=23a55f4492fcf868d068da31a2cd30c15f46207d

commit 6af7331a70b4888df43ec1d7e1803ae2c43b6981
Author: Ofir Gal <ofir....@volumez.com>
Date: Thu Jul 18 11:45:13 2024 +0300
Subject: nvme-tcp: use sendpages_ok() instead of sendpage_ok()
Link: 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6af7331a70b4888df43ec1d7e1803ae2c43b6981

commit 7960af373ade3b39e10106ef415e43a1d2aa48c6
Author: Ofir Gal <ofir....@volumez.com>
Date: Thu Jul 18 11:45:14 2024 +0300
Subject: drbd: use sendpages_ok() instead of sendpage_ok()
Link: 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7960af373ade3b39e10106ef415e43a1d2aa48c6

I rebooted and ran the reproducer:

$ uname -rv
6.8.0-58-generic #60-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 14 18:29:48 UTC 2025

$ sudo ./check md/001
md/001 (Raid with bitmap on tcp nvmet with opt-io-size over bitmap size) 
[passed]
    runtime    ...  0.452s
    
Just to make sure that the three commits really did fix the issue, I then
built and booted into 6.8.0-58-generic, again with 

commit ab99a87542f194f28e2364a42afbf9fb48b1c724
Author: Ofir Gal <ofir....@volumez.com>
Date: Fri Jun 7 10:27:44 2024 +0300
Subject: md/md-bitmap: fix writing non bitmap pages
Link: 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ab99a87542f194f28e2364a42afbf9fb48b1c724

reverted, so we just test the new fixes only.

$ uname -rv
6.8.0-58-generic #60+TEST404844v20250328b1-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 
28 
$ cd blktests/
$ sudo ./check md/001
md/001 (Raid with bitmap on tcp nvmet with opt-io-size over bitmap size) 
[passed]
    runtime  0.452s  ...  0.445
    
We continue to pass with the new patches only.

The kernel in -proposed fixes the issue, happy to mark verified for
noble.

** Tags removed: verification-needed-noble-linux
** Tags added: verification-done-noble-linux

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/2093871

Title:
  Introduce and use sendpages_ok() instead of sendpage_ok() in nvme-tcp
  and drbd

Status in linux package in Ubuntu:
  Fix Released
Status in linux source package in Noble:
  Fix Committed
Status in linux source package in Oracular:
  Fix Committed

Bug description:
  BugLink: https://bugs.launchpad.net/bugs/2093871

  [Impact]

  Currently the nvme-tcp and drbd subsystems try to enable the MSG_SPLICE_PAGES
  flag on pages to be written, and when MSG_SPLICE_PAGES is set, eventually it
  calls skb_splice_from_iter(), which then checks all pages with sendpage_ok()
  to see if all the pages are sendable.

  At the moment, both subsystems only check the first page in a potentially
  contiguous block of pages, if they are sendpage_ok(), and if the first page 
is,
  then it just assumes all the rest are sendpage_ok() too, and sends the I/O off
  to eventually be found out by skb_splice_from_iter(). If one or more of the
  pages in the contiguous block is not sendpage_ok(), then we get a warn 
printed,
  data transfer is aborted. In the nvme-tcp case, IO then hangs.

  This patchset introduces sendpages_ok() which iterates over each page in a
  contiguous block, checks if it is sendpage_ok(), and only returns true if all
  of them are.

  This resolves the whole MSG_SPLICE_PAGES flag situation, since you can now
  depend on the result of sendpages_ok(), instead of just assuming everything is
  okay.

  This issue is what caused bug 2075110 [0] to be discovered in the first place,
  since it was responsible for contigious blocks of pages where the first was
  sendpage_ok(), but pages further into the block were not.

  [0] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2075110

  Even with "md/md-bitmap: fix writing non bitmap pages" applied, the issue can
  still happen, e.g. with merged IO pages, so this fix is still needed to
  eliminate the issue.

  [Fix]

  The fixes landed in mainline 6.12-rc1:

  commit 23a55f4492fcf868d068da31a2cd30c15f46207d
  Author: Ofir Gal <ofir....@volumez.com>
  Date:   Thu Jul 18 11:45:12 2024 +0300
  Subject: net: introduce helper sendpages_ok()
  Link: 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=23a55f4492fcf868d068da31a2cd30c15f46207d

  commit 6af7331a70b4888df43ec1d7e1803ae2c43b6981
  Author: Ofir Gal <ofir....@volumez.com>
  Date:   Thu Jul 18 11:45:13 2024 +0300
  Subject: nvme-tcp: use sendpages_ok() instead of sendpage_ok()
  Link: 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6af7331a70b4888df43ec1d7e1803ae2c43b6981

  commit 7960af373ade3b39e10106ef415e43a1d2aa48c6
  Author: Ofir Gal <ofir....@volumez.com>
  Date:  Thu Jul 18 11:45:14 2024 +0300
  Subject: drbd: use sendpages_ok() instead of sendpage_ok()
  Link: 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7960af373ade3b39e10106ef415e43a1d2aa48c6

  They are needed for noble and oracular.

  [Testcase]

  This is the same testcase as the original bug 2075110 [0], as the fix is
  designed to prevent it or similar other bugs from happening again.

  [0] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2075110

  Because of this, the fix:

  commit ab99a87542f194f28e2364a42afbf9fb48b1c724
  Author: Ofir Gal <ofir....@volumez.com>
  Date: Fri Jun 7 10:27:44 2024 +0300
  Subject: md/md-bitmap: fix writing non bitmap pages
  Link: 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ab99a87542f194f28e2364a42afbf9fb48b1c724

  needs to be reverted during your test runs, or you won't see the issue
  reproduce.

  You can use this ppa for updated kernels with the revert to trigger
  the issue:

  https://launchpad.net/~mruffell/+archive/ubuntu/sf404844-revert

  This can be reproduced by running blktests md/001 [1], which the
  author of the fix created to act as a regression test for this issue.

  [1]
  
https://github.com/osandov/blktests/commit/a24a7b462816fbad7dc6c175e53fcc764ad0a822

  Deploy a fresh Noble VM, that has a scratch NVME disk.

  $ sudo apt install build-essential fio
  $ git clone https://github.com/osandov/blktests.git
  $ cd blktests
  $ make
  $ echo "TEST_DEVS=(/dev/nvme0n1)" > config
  $ sudo ./check md/001

  The md/001 test will hang an affected system, and the above oops
  message will be visible in dmesg.

  A test kernel is available in the following ppa:

  https://launchpad.net/~mruffell/+archive/ubuntu/sf404844-test

  This has both the fixes for this bug, and also bug 2075110. The issue will not
  reproduce.

  There is also a test kernel available with the fix for this bug present, and 
the
  fix for bug 2075110 reverted, so you can see the impact of these patches only:

  https://launchpad.net/~mruffell/+archive/ubuntu/sf404844-repro

  This will also not reproduce the issue anymore.

  [Where problems could occur]

  What we are changing is rather simple. Instead of checking the first page and
  assuming all the rest in the contiguous block are sendpage_ok(), we now
  check each page in the contiguous block to see if all of them are 
sendpage_ok().

  If any aren't, then we abort the write to the driver, and try again later. 
This
  saves us time.

  However, it does take longer to call sendpage_ok() on each of the pages in the
  contiguous block, so there will be a minor performance hit.

  Small performance hit for correctness should be okay.

  Currently we are only applying to nvme-tcp and drbd subsystems. If a 
regression
  were to occur, it would affect users of those subsystems only.

  [Other info]

  Upstream mailing list:
  https://lore.kernel.org/all/20240718084515.3833733-1-ofir....@volumez.com/T/#u

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2093871/+subscriptions


-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to