9p: MPTCP tests regressions due to new 9p features in v6.4
Subsystems (3)
Hi Eric and other 9p devs,
TL;DR: it looks like there is a (small?) problem with the new 9p features you recently sent and it causes MPTCP tests to be unstable. It is tracked there: https://github.com/multipath-tcp/mptcp_net-next/issues/400
First, thank you very much for maintaining this very useful FS!
For the MPTCP subsystem, we are running various tests. Many are ran by a public CI [1] in a VM by using QEmu with 9p thanks to Virtme [2]. Virtme, its dependences and a script to compile the kernel and run the tests are "packaged" in a Docker container which eases the deployment and the reproduction of issues using the same environment [3].
Since v6.4-rc1, we noticed that our public CI was reporting various instabilities, mainly with Packetdrill tests. Packetdrill [4] allows us to easily call some system calls, craft and "inject" some network packets and verify that the kernel generates the expected ones. It was difficult to reproduce the issue but after investigations, it looks like since v6.4-rc1, Packetdrill is slower to craft and inject packets, causing the kernel to retransmit packets (retransmission timeout) that are not expected and tests are then marked as failed. For more details, a ticket [5] has been opened in our public bugs tracker.
I ran a 'git bisect' and found out that it seems to be caused by the new 9p features for 6.4:
8e15605be8ba ("Merge tag '9p-6.4-for-linus' ofgit://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs")
If I revert these commits on top of our "export" branch, I can no longer reproduce the bug:
$ git log --oneline --reverse v6.3-rc1..21e26d5e54ab d9bc0d11e33b fs/9p: Consolidate file operations and add readahead and writeback 740b8bf87322 fs/9p: Remove unnecessary superblock flags 8142db4f2792 fs/9p: allow disable of xattr support on mount 46c30cb8f539 9p: Add additional debug flags and open modes 6deffc8924b5 fs/9p: Add new mount modes 1543b4c5071c fs/9p: remove writeback fid and fix per-file modes 4eb3117888a9 fs/9p: Rework cache modes and add new options to Documentation 21e26d5e54ab fs/9p: Fix bit operation logic error
'git bisect' seems to suggest the issue is due to the first commit d9bc0d11e33b ("fs/9p: Consolidate file operations and add readahead and writeback").
It is not clear why these modifications are causing such issues because the Packetdrill tests are not doing intensive read and no write on the disk (only stdout). Not so much info has to be read from the disk: one small Python script (255 lines [6]) launches multiple threads, each executing the same bash script (22 lines [7]) launching the same "packetdrill" binary (1.1 MB) in a newly created and dedicated netns. Then each test reads a different test script of ~30 lines, e.g. [8]. I think most of the time the problem is seen at the end of a test. From what I see [9], Packetdrill tries to read the whole test script. This is confirmed by quickly looking at the output of strace available on the ticket [5].
It is unclear to me what else I can do and share with you to help fixing this "regression". I can quite easily reproduce the issue on my side and provide more info if needed.
Just in case you wish to reproduce it on your side using our docker container [3], it is easy:
$ cd [kernel source code]
$ cat <<'EOF' > .virtme-exec-run
for z in $(seq 15); do
run_packetdrill_one mptcp/dss || true
grep -q "[l]ive packet payload:" "${OUTPUT_VIRTME}" && break
rm "${RESULTS_DIR}"/*.tap; done
EOF
$ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
--pull always mptcp/mptcp-upstream-virtme-docker:latest \
auto-debugThis will compile the kernel in ".virtme" dir with the required .config. The VM will start and run a category of packetdrill tests 15 times. On my side, I was able to reproduce the issue with a busy machine and packetdrill had to run ~5 times. To stress my machine, I ran stress-ng in parallel (outside the VM) when the tests were being executed (after the compilation not to slow down everything), e.g. with
nproc2=$(nproc); nproc2=$((nproc2 * 2))
stress-ng --cpu "${nproc2}" --io "${nproc2}" --vm "${nproc2}" \
--vm-bytes 1G --timeout 60mI hope you don't mind if I cc the regression ML: this is probably not an important regression but I would not have guessed the issues we had when running network tests were due to 9p, this report might help others with similar issues :)
#regzbot introduced: d9bc0d11e33b
Cheers,
Matt
[1] https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export-net
[2] https://github.com/amluto/virtme
[3] https://github.com/multipath-tcp/mptcp-upstream-virtme-docker
[4] https://github.com/google/packetdrill/
[5] https://github.com/multipath-tcp/mptcp_net-next/issues/400
[6]
https://github.com/multipath-tcp/packetdrill/blob/mptcp-net-next/gtests/net/packetdrill/run_all.py
[7]
https://github.com/multipath-tcp/packetdrill/blob/mptcp-net-next/gtests/net/packetdrill/in_netns.sh
[8]
https://github.com/multipath-tcp/packetdrill/blob/mptcp-net-next/gtests/net/mptcp/dss/mpc_with_data_client.pkt
[9]
https://github.com/google/packetdrill/blob/master/gtests/net/packetdrill/parser.y#L168
Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions www.tessares.net
A message that is not in the archive (sent off-list or not yet received): CAFkjPTnX0=-GK8sFzd4S+V2+cA8E-FAqYHNndZui2Sh_MvoHPw@mail.gmail.com
Hi Eric,
Quoted 1 line · Eric Van Hensbergen
thanks for the detailed report - I’ll have a look.
Thank you for the quick reply!
No hurry, we can also revert these patches in our tree for the time being.
Quoted 2 lines
Do you know off hand
what cache options for 9p are in use?
Sorry, I'm not sure what to look at.
In the VM, I see that this mount command is used:
/bin/mount -n -t 9p -o ro,version=9p2000.L,trans=virtio,access=any \
virtme.guesttools /run/virtme/guesttoolsIn virtme source, I can see these commands should be executed:
/bin/mount -n -t 9p -o ro,version=9p2000.L,trans=virtio,access=any \
/dev/root /newroot/
mount -t 9p -o version=9p2000.L,trans=virtio,access=any \
"virtme.initmount${tag:16}" "${!tag}"From the VM, I can see:
Quoted 4 lines
# mount | grep 9p /dev/root on / type 9p (ro,relatime,access=any,trans=virtio) virtme.guesttools on /run/virtme/guesttools type 9p (ro,relatime,access=any,trans=virtio) virtme.initmount0 on /mptcp_net-next type 9p (rw,relatime,access=any,trans=virtio)
And the VM is started using:
Quoted 1 line
/usr/bin/qemu-system-x86_64-fsdev local,id=virtfs1,path=/,security_model=none,readonly=on,multidevs=remap -device virtio-9p-pci,fsdev=virtfs1,mount_tag=/dev/root -fsdev local,id=virtfs5,path=/opt/virtme/virtme/guest,security_model=none,readonly=on,multidevs=remap -device virtio-9p-pci,fsdev=virtfs5,mount_tag=virtme.guesttools -fsdev local,id=virtfs9,path=.,security_model=none,multidevs=remap -device virtio-9p-pci,fsdev=virtfs9,mount_tag=virtme.initmount0 -machine accel=kvm:tcg -watchdog i6300esb -cpu host -parallel none -net none -echr 1 -serial none -chardev stdio,id=console,signal=off,mux=on -serial chardev:console -mon chardev=console -vga none -display none -m 2048M -smp 2 -device virtio-net-pci,netdev=n0 -netdev user,id=n0 -kernel .virtme/build/arch/x86/boot/bzImage -append 'virtme_link_mods=.virtme/build/.virtme_mods/lib/modules/0.0.0 virtme_initmount0=/mptcp_net-next earlyprintk=serial,ttyS0,115200 console=ttyS0 psmouse.proto=exps "virtme_stty_con=rows 59 cols 132 iutf8" TERM=xterm virtme.dhcp virtme_chdir=/mptcp_net-next rootfstype=9p rootflags=version=9p2000.L,trans=virtio,access=any raid=noautodetect ro mitigations=off init=/bin/sh -- -c "mount -t tmpfs run /run;mkdir -p /run/virtme/guesttools;/bin/mount -n -t 9p -o ro,version=9p2000.L,trans=virtio,access=any virtme.guesttools /run/virtme/guesttools;exec/run/virtme/guesttools/virtme-init"'
I don't see anything about the cache and nothing in the dmesg. If you think this info is in the dmesg, the logs are publicly available there:
https://cirrus-ci.com/task/5569063884161024?logs=test#L5626
Quoted 4 lines
Since things are slower, my first
suspect is the don't cache qid.version == 0 change. That can be overridden with a mount option but perhaps we should invert the default as it is new behavior from a linux perspective.
Can I easily change the default behaviour on the kernel side to try (without modifying the tools launching the mount commands)?
Cheers,
Matt
Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions www.tessares.net
Interesting - so looks like caches aren’t being used so curious that there is any impact at all from mostly cache-related patches! Okay thanks, I’ll dig in and see what I can find.
-Eric
Quoted 59 lines · Matthieu Baerts
Hi Eric,
Quoted 1 line · Eric Van Hensbergen
thanks for the detailed report - I’ll have a look.
Thank you for the quick reply!
No hurry, we can also revert these patches in our tree for the time being.
Quoted 2 lines
Do you know off hand
what cache options for 9p are in use?Sorry, I'm not sure what to look at.
In the VM, I see that this mount command is used:
/bin/mount-n -t 9p -o ro,version=9p2000.L,trans=virtio,access=any \
virtme.guesttools/run/virtme/guesttoolsIn virtme source, I can see these commands should be executed:
/bin/mount-n -t 9p -o ro,version=9p2000.L,trans=virtio,access=any \
/dev/root/newroot/mount -t 9p -o version=9p2000.L,trans=virtio,access=any \ "virtme.initmount${tag:16}" "${!tag}"From the VM, I can see:
Quoted 4 lines
# mount | grep 9p /dev/root on / type 9p (ro,relatime,access=any,trans=virtio) virtme.guesttools on /run/virtme/guesttools type 9p (ro,relatime,access=any,trans=virtio) virtme.initmount0 on /mptcp_net-next type 9p (rw,relatime,access=any,trans=virtio)And the VM is started using:
Quoted 1 line
/usr/bin/qemu-system-x86_64-fsdev local,id=virtfs1,path=/,security_model=none,readonly=on,multidevs=remap -device virtio-9p-pci,fsdev=virtfs1,mount_tag=/dev/root -fsdev local,id=virtfs5,path=/opt/virtme/virtme/guest,security_model=none,readonly=on,multidevs=remap -device virtio-9p-pci,fsdev=virtfs5,mount_tag=virtme.guesttools -fsdev local,id=virtfs9,path=.,security_model=none,multidevs=remap -device virtio-9p-pci,fsdev=virtfs9,mount_tag=virtme.initmount0 -machine accel=kvm:tcg -watchdog i6300esb -cpu host -parallel none -net none -echr 1 -serial none -chardev stdio,id=console,signal=off,mux=on -serial chardev:console -mon chardev=console -vga none -display none -m 2048M -smp 2 -device virtio-net-pci,netdev=n0 -netdev user,id=n0 -kernel .virtme/build/arch/x86/boot/bzImage -append 'virtme_link_mods=.virtme/build/.virtme_mods/lib/modules/0.0.0 virtme_initmount0=/mptcp_net-next earlyprintk=serial,ttyS0,115200 console=ttyS0 psmouse.proto=exps "virtme_stty_con=rows 59 cols 132 iutf8" TERM=xterm virtme.dhcp virtme_chdir=/mptcp_net-next rootfstype=9p rootflags=version=9p2000.L,trans=virtio,access=any raid=noautodetect ro mitigations=off init=/bin/sh -- -c "mount -t tmpfs run /run;mkdir -p /run/virtme/guesttools;/bin/mount -n -t 9p -o ro,version=9p2000.L,trans=virtio,access=any virtme.guesttools /run/virtme/guesttools;exec/run/virtme/guesttools/virtme-init"'I don't see anything about the cache and nothing in the dmesg. If you think this info is in the dmesg, the logs are publicly available there:
https://cirrus-ci.com/task/5569063884161024?logs=test#L5626
Quoted 4 lines
Since things are slower, my first
suspect is the don't cache qid.version == 0 change. That can be overridden with a mount option but perhaps we should invert the default as it is new behavior from a linux perspective.Can I easily change the default behaviour on the kernel side to try (without modifying the tools launching the mount commands)?
Cheers,
MattSignature · 2 lines
Tessares | Belgium | Hybrid Access Solutions www.tessares.net
Quoted 2 lines · On 06.06.23 20:47, [email protected] wrote:
Interesting - so looks like caches aren’t being used so curious that there is any impact at all from mostly cache-related patches! Okay thanks, I’ll dig in and see what I can find.
Gentle reminder that this apparently made no progress for a week now. Or was there progress and I just missed it? Then apologies in advance.
I'm asking, as it afaics would be nice to have this resolved in mainline before the next -rc. That would be ideal to avoid last minute changes after the last rc.
Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat) --
Everything you wanna know about Linux kernel regression tracking:
https://linux-regtracking.leemhuis.info/about/#tldr
If I did something stupid, please tell me, as explained on that page.
#regzbot poke
Quoted 62 lines
Quoted 59 lines · Matthieu Baerts
Hi Eric,
Quoted 1 line · Eric Van Hensbergen
thanks for the detailed report - I’ll have a look.
Thank you for the quick reply!
No hurry, we can also revert these patches in our tree for the time being.
Quoted 2 lines
Do you know off hand
what cache options for 9p are in use?Sorry, I'm not sure what to look at.
In the VM, I see that this mount command is used:
/bin/mount-n -t 9p -o ro,version=9p2000.L,trans=virtio,access=any \
virtme.guesttools/run/virtme/guesttoolsIn virtme source, I can see these commands should be executed:
/bin/mount-n -t 9p -o ro,version=9p2000.L,trans=virtio,access=any \
/dev/root/newroot/mount -t 9p -o version=9p2000.L,trans=virtio,access=any \ "virtme.initmount${tag:16}" "${!tag}"From the VM, I can see:
Quoted 4 lines
# mount | grep 9p /dev/root on / type 9p (ro,relatime,access=any,trans=virtio) virtme.guesttools on /run/virtme/guesttools type 9p (ro,relatime,access=any,trans=virtio) virtme.initmount0 on /mptcp_net-next type 9p (rw,relatime,access=any,trans=virtio)And the VM is started using:
Quoted 1 line
/usr/bin/qemu-system-x86_64-fsdev local,id=virtfs1,path=/,security_model=none,readonly=on,multidevs=remap -device virtio-9p-pci,fsdev=virtfs1,mount_tag=/dev/root -fsdev local,id=virtfs5,path=/opt/virtme/virtme/guest,security_model=none,readonly=on,multidevs=remap -device virtio-9p-pci,fsdev=virtfs5,mount_tag=virtme.guesttools -fsdev local,id=virtfs9,path=.,security_model=none,multidevs=remap -device virtio-9p-pci,fsdev=virtfs9,mount_tag=virtme.initmount0 -machine accel=kvm:tcg -watchdog i6300esb -cpu host -parallel none -net none -echr 1 -serial none -chardev stdio,id=console,signal=off,mux=on -serial chardev:console -mon chardev=console -vga none -display none -m 2048M -smp 2 -device virtio-net-pci,netdev=n0 -netdev user,id=n0 -kernel .virtme/build/arch/x86/boot/bzImage -append 'virtme_link_mods=.virtme/build/.virtme_mods/lib/modules/0.0.0 virtme_initmount0=/mptcp_net-next earlyprintk=serial,ttyS0,115200 console=ttyS0 psmouse.proto=exps "virtme_stty_con=rows 59 cols 132 iutf8" TERM=xterm virtme.dhcp virtme_chdir=/mptcp_net-next rootfstype=9p rootflags=version=9p2000.L,trans=virtio,access=any raid=noautodetect ro mitigations=off init=/bin/sh -- -c "mount -t tmpfs run /run;mkdir -p /run/virtme/guesttools;/bin/mount -n -t 9p -o ro,version=9p2000.L,trans=virtio,access=any virtme.guesttools /run/virtme/guesttools;exec/run/virtme/guesttools/virtme-init"'I don't see anything about the cache and nothing in the dmesg. If you think this info is in the dmesg, the logs are publicly available there:
https://cirrus-ci.com/task/5569063884161024?logs=test#L5626
Quoted 4 lines
Since things are slower, my first
suspect is the don't cache qid.version == 0 change. That can be overridden with a mount option but perhaps we should invert the default as it is new behavior from a linux perspective.Can I easily change the default behaviour on the kernel side to try (without modifying the tools launching the mount commands)?
Cheers,
MattSignature · 2 lines
Tessares | Belgium | Hybrid Access Solutions www.tessares.net
Eric Van Hensbergen
maintainerUnderstood, this on top of my 9p stack, but day job has been getting in the way lately so I need to unstack there first. Will do my best to reproduce and understand as quickly as I can -- but given its a performance regression it is likely going to be tricky to reproduce and understand, so I'm not sure how confident I am that we'll be able to close it out prior to the final -rc.
-eric
-eric
Quoted 82 lines · Linux regression tracking (Thorsten Leemhuis)
Quoted 2 lines · On 06.06.23 20:47, [email protected] wrote:
Interesting - so looks like caches aren’t being used so curious that there is any impact at all from mostly cache-related patches! Okay thanks, I’ll dig in and see what I can find.
Gentle reminder that this apparently made no progress for a week now. Or was there progress and I just missed it? Then apologies in advance.
I'm asking, as it afaics would be nice to have this resolved in mainline before the next -rc. That would be ideal to avoid last minute changes after the last rc.
Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat) --
Everything you wanna know about Linux kernel regression tracking:
https://linux-regtracking.leemhuis.info/about/#tldr
If I did something stupid, please tell me, as explained on that page.#regzbot poke
Quoted 62 lines
Quoted 59 lines · Matthieu Baerts
Hi Eric,
Quoted 1 line · Eric Van Hensbergen
thanks for the detailed report - I’ll have a look.
Thank you for the quick reply!
No hurry, we can also revert these patches in our tree for the time being.
Quoted 2 lines
Do you know off hand
what cache options for 9p are in use?Sorry, I'm not sure what to look at.
In the VM, I see that this mount command is used:
/bin/mount-n -t 9p -o ro,version=9p2000.L,trans=virtio,access=any \
virtme.guesttools/run/virtme/guesttoolsIn virtme source, I can see these commands should be executed:
/bin/mount-n -t 9p -o ro,version=9p2000.L,trans=virtio,access=any \
/dev/root/newroot/mount -t 9p -o version=9p2000.L,trans=virtio,access=any \ "virtme.initmount${tag:16}" "${!tag}"From the VM, I can see:
Quoted 4 lines
# mount | grep 9p /dev/root on / type 9p (ro,relatime,access=any,trans=virtio) virtme.guesttools on /run/virtme/guesttools type 9p (ro,relatime,access=any,trans=virtio) virtme.initmount0 on /mptcp_net-next type 9p (rw,relatime,access=any,trans=virtio)And the VM is started using:
Quoted 1 line
/usr/bin/qemu-system-x86_64-fsdev local,id=virtfs1,path=/,security_model=none,readonly=on,multidevs=remap -device virtio-9p-pci,fsdev=virtfs1,mount_tag=/dev/root -fsdev local,id=virtfs5,path=/opt/virtme/virtme/guest,security_model=none,readonly=on,multidevs=remap -device virtio-9p-pci,fsdev=virtfs5,mount_tag=virtme.guesttools -fsdev local,id=virtfs9,path=.,security_model=none,multidevs=remap -device virtio-9p-pci,fsdev=virtfs9,mount_tag=virtme.initmount0 -machine accel=kvm:tcg -watchdog i6300esb -cpu host -parallel none -net none -echr 1 -serial none -chardev stdio,id=console,signal=off,mux=on -serial chardev:console -mon chardev=console -vga none -display none -m 2048M -smp 2 -device virtio-net-pci,netdev=n0 -netdev user,id=n0 -kernel .virtme/build/arch/x86/boot/bzImage -append 'virtme_link_mods=.virtme/build/.virtme_mods/lib/modules/0.0.0 virtme_initmount0=/mptcp_net-next earlyprintk=serial,ttyS0,115200 console=ttyS0 psmouse.proto=exps "virtme_stty_con=rows 59 cols 132 iutf8" TERM=xterm virtme.dhcp virtme_chdir=/mptcp_net-next rootfstype=9p rootflags=version=9p2000.L,trans=virtio,access=any raid=noautodetect ro mitigations=off init=/bin/sh -- -c "mount -t tmpfs run /run;mkdir -p /run/virtme/guesttools;/bin/mount -n -t 9p -o ro,version=9p2000.L,trans=virtio,access=any virtme.guesttools /run/virtme/guesttools;exec/run/virtme/guesttools/virtme-init"'I don't see anything about the cache and nothing in the dmesg. If you think this info is in the dmesg, the logs are publicly available there:
https://cirrus-ci.com/task/5569063884161024?logs=test#L5626
Quoted 4 lines
Since things are slower, my first
suspect is the don't cache qid.version == 0 change. That can be overridden with a mount option but perhaps we should invert the default as it is new behavior from a linux perspective.Can I easily change the default behaviour on the kernel side to try (without modifying the tools launching the mount commands)?
Cheers,
Matt
--
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
Hi Eric,
Quoted 6 lines · Eric Van Hensbergen
Understood, this on top of my 9p stack, but day job has been getting in the way lately so I need to unstack there first. Will do my best to reproduce and understand as quickly as I can -- but given its a performance regression it is likely going to be tricky to reproduce and understand, so I'm not sure how confident I am that we'll be able to close it out prior to the final -rc.
Thank you for your message, I understand, no issue.
On our side with MPTCP, there is no hurry as there is a workaround: the revert of the series you sent for v6.4. So as long as it is tracked and fixed at some points, we are fine :)
(but I don't know what's the impact for other people of course)
Cheers,
Matt
Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions www.tessares.net
Quoted 10 lines · Matthieu Baerts
Quoted 6 lines · Eric Van Hensbergen
Understood, this on top of my 9p stack, but day job has been getting in the way lately so I need to unstack there first. Will do my best to reproduce and understand as quickly as I can -- but given its a performance regression it is likely going to be tricky to reproduce and understand, so I'm not sure how confident I am that we'll be able to close it out prior to the final -rc.
Thank you for your message, I understand, no issue. [...]
As Linus will likely release 6.4 on this or the following Sunday a quick status inquiry so I can brief him appropriately: is there any hope the regression will be resolved any time soon? Doesn't look like it from this thread, but maybe I missed something.
Quoted 1 line
(but I don't know what's the impact for other people of course)
Yeah, it's likely not that urgent, if the problem is just showing up in some CI tests. But is that what we assume for now? Eric?
Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat) --
Everything you wanna know about Linux kernel regression tracking:
https://linux-regtracking.leemhuis.info/about/#tldr
If I did something stupid, please tell me, as explained on that page.
#regzbot poke
[TLDR: This mail in primarily relevant for Linux kernel regression tracking. See link in footer if these mails annoy you.]
Quoted 17 lines · Linux regression tracking (Thorsten Leemhuis)
Quoted 10 lines · Matthieu Baerts
Quoted 6 lines · Eric Van Hensbergen
Understood, this on top of my 9p stack, but day job has been getting in the way lately so I need to unstack there first. Will do my best to reproduce and understand as quickly as I can -- but given its a performance regression it is likely going to be tricky to reproduce and understand, so I'm not sure how confident I am that we'll be able to close it out prior to the final -rc.
Thank you for your message, I understand, no issue. [...]
As Linus will likely release 6.4 on this or the following Sunday a quick status inquiry so I can brief him appropriately: is there any hope the regression will be resolved any time soon? Doesn't look like it from this thread, but maybe I missed something.
Quoted 4 lines
Quoted 1 line
(but I don't know what's the impact for other people of course)
Yeah, it's likely not that urgent, if the problem is just showing up in some CI tests. But is that what we assume for now? Eric?
6.4 is out and this is likely to take a while to get fixed given recent and today's replies.
To make sure I don't see this all the time while dealing with more pressing issues I'm putting it on the backburner:
#regzbot backburner: not urgent, for now seems something that only shows up in one CI (and is hard to reproduce)
#regzbot ignore-activity
Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat) --
Everything you wanna know about Linux kernel regression tracking:
https://linux-regtracking.leemhuis.info/about/#tldr
That page also explains what to do if mails like this annoy you.
Hi Eric,
Quoted 6 lines · Eric Van Hensbergen
Understood, this on top of my 9p stack, but day job has been getting in the way lately so I need to unstack there first. Will do my best to reproduce and understand as quickly as I can -- but given its a performance regression it is likely going to be tricky to reproduce and understand, so I'm not sure how confident I am that we'll be able to close it out prior to the final -rc.
Good news, it looks like the bug has been fixed!
I recently noticed some new patches fixing some issues in 9p in Linus tree because they were conflicting with the revert of 9p's v6.4 PR I did in June to stop having random issues in our tests. I then tried reproducing the issue we had on top of Linus' tree and I was not able too! (but I was still able to reproduce them just before the recent fixes)
After a quick git bisect, it seems the bug is fixed thanks to 350cd9b95975 ("fs/9p: remove unnecessary invalidate_inode_pages2").
So we can also tell regzbot to stop tracking this:
#regzbot fix: 350cd9b95975
Cheers,
Matt
Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions www.tessares.net
Eric Van Hensbergen
maintainerThat's good news because I was having a horrible time reproducing it. I'm glad we removed that extra bit, we were thinking it was benign, but I guess it turns out it wasn't!
-eric
Quoted 31 lines · Matthieu Baerts
Hi Eric,
Quoted 6 lines · Eric Van Hensbergen
Understood, this on top of my 9p stack, but day job has been getting in the way lately so I need to unstack there first. Will do my best to reproduce and understand as quickly as I can -- but given its a performance regression it is likely going to be tricky to reproduce and understand, so I'm not sure how confident I am that we'll be able to close it out prior to the final -rc.
Good news, it looks like the bug has been fixed!
I recently noticed some new patches fixing some issues in 9p in Linus tree because they were conflicting with the revert of 9p's v6.4 PR I did in June to stop having random issues in our tests. I then tried reproducing the issue we had on top of Linus' tree and I was not able too! (but I was still able to reproduce them just before the recent fixes)
After a quick git bisect, it seems the bug is fixed thanks to
350cd9b95975("fs/9p: remove unnecessaryinvalidate_inode_pages2").So we can also tell regzbot to stop tracking this:
#regzbot fix:
350cd9b95975Cheers,
Matt
--
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
Eric Van Hensbergen
maintainer(repost so it actually goes to the list and making sure gmail doesn't send html)
So, I've not completely reproduced your environment as I've been traveling and its been a bit more difficult. I have done some relative performance regressions (in a virtualized environment just running qemu inside a docker container on my M1 so perf isn't going to be fantastic) -- but even in that case when I'm running unloaded I see very little difference between v6.3 and v6.4.
v6.3 dbench no-cache:
Operation Count AvgLat MaxLat
----------------------------------------
NTCreateX 1752 15.403 65.686 Close 1276 1.521 16.334 Rename 74 27.324 58.181 Unlink 362 16.717 55.471 Qpathinfo 1588 6.463 72.369 Qfileinfo 271 0.814 9.844 Qfsinfo 297 0.775 1.393 Sfileinfo 137 1.632 2.466 Find 609 13.964 43.251 WriteX 840 0.759 6.753 ReadX 2801 0.581 2.184 LockX 6 0.591 0.769 UnlockX 6 0.587 0.819 Flush 125 0.661 1.329
Throughput 0.924965 MB/sec 1 clients 1 procs max_latency=87.798 ms
v6.4 bench no-cache:
Operation Count AvgLat MaxLat
----------------------------------------
NTCreateX 1695 15.939 68.052
Close 1229 1.557 5.368
Rename 72 27.350 54.836 Unlink 357 17.159 43.353 Qpathinfo 1513 6.780 54.292 Qfileinfo 260 0.787 1.361 Qfsinfo 296 0.809 1.898 Sfileinfo 134 1.664 2.122 Find 590 14.467 61.693 WriteX 822 0.792 7.848 ReadX 2728 0.589 1.564 LockX 6 0.652 1.011 UnlockX 6 0.506 0.559 Flush 122 0.688 1.248
Throughput 0.917066 MB/sec 1 clients 1 procs max_latency=68.164 ms
So, there is some slight perturbation in average latency, but nothing that I would think would be significant (particularly in a simulated platform which carries with it a certain amount of noise). I'm working on automated the regressions so I can try them on multiple platforms and add some rigor to the results but I don't see anything here that jumps out at me as being an obvious concern. Of course there may be differences in your kernel config that could be perturbing the behavior, I'll continue to try and run with the virtme configs but my internet is currently on the end of a cocktail straw so pulling and/or building docker images is challenging. I may go ahead and just temporarily rent an aws instance to try and speed that part of the process up.
-Eric
Quoted 123 lines · Matthieu Baerts
Hi Eric and other 9p devs,
TL;DR: it looks like there is a (small?) problem with the new 9p features you recently sent and it causes MPTCP tests to be unstable. It is tracked there: https://github.com/multipath-tcp/mptcp_net-next/issues/400
First, thank you very much for maintaining this very useful FS!
For the MPTCP subsystem, we are running various tests. Many are ran by a public CI [1] in a VM by using QEmu with 9p thanks to Virtme [2]. Virtme, its dependences and a script to compile the kernel and run the tests are "packaged" in a Docker container which eases the deployment and the reproduction of issues using the same environment [3].
Since v6.4-rc1, we noticed that our public CI was reporting various instabilities, mainly with Packetdrill tests. Packetdrill [4] allows us to easily call some system calls, craft and "inject" some network packets and verify that the kernel generates the expected ones. It was difficult to reproduce the issue but after investigations, it looks like since v6.4-rc1, Packetdrill is slower to craft and inject packets, causing the kernel to retransmit packets (retransmission timeout) that are not expected and tests are then marked as failed. For more details, a ticket [5] has been opened in our public bugs tracker.
I ran a 'git bisect' and found out that it seems to be caused by the new 9p features for 6.4:
8e15605be8ba("Merge tag '9p-6.4-for-linus' ofgit://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs")If I revert these commits on top of our "export" branch, I can no longer reproduce the bug:
$ git log --oneline --reverse v6.3-rc1..21e26d5e54ab d9bc0d11e33b fs/9p: Consolidate file operations and add readahead and writeback 740b8bf87322 fs/9p: Remove unnecessary superblock flags 8142db4f2792 fs/9p: allow disable of xattr support on mount 46c30cb8f539 9p: Add additional debug flags and open modes 6deffc8924b5 fs/9p: Add new mount modes 1543b4c5071c fs/9p: remove writeback fid and fix per-file modes 4eb3117888a9 fs/9p: Rework cache modes and add new options to Documentation 21e26d5e54ab fs/9p: Fix bit operation logic error'git bisect' seems to suggest the issue is due to the first commit
d9bc0d11e33b("fs/9p: Consolidate file operations and add readahead and writeback").It is not clear why these modifications are causing such issues because the Packetdrill tests are not doing intensive read and no write on the disk (only stdout). Not so much info has to be read from the disk: one small Python script (255 lines [6]) launches multiple threads, each executing the same bash script (22 lines [7]) launching the same "packetdrill" binary (1.1 MB) in a newly created and dedicated netns. Then each test reads a different test script of ~30 lines, e.g. [8]. I think most of the time the problem is seen at the end of a test. From what I see [9], Packetdrill tries to read the whole test script. This is confirmed by quickly looking at the output of strace available on the ticket [5].
It is unclear to me what else I can do and share with you to help fixing this "regression". I can quite easily reproduce the issue on my side and provide more info if needed.
Just in case you wish to reproduce it on your side using our docker container [3], it is easy:
$ cd [kernel source code] $ cat <<'EOF' > .virtme-exec-run for z in $(seq 15); do run_packetdrill_one mptcp/dss || true grep -q "[l]ive packet payload:" "${OUTPUT_VIRTME}" && break rm "${RESULTS_DIR}"/*.tap; done EOF $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \ --pull always mptcp/mptcp-upstream-virtme-docker:latest \ auto-debugThis will compile the kernel in ".virtme" dir with the required .config. The VM will start and run a category of packetdrill tests 15 times. On my side, I was able to reproduce the issue with a busy machine and packetdrill had to run ~5 times. To stress my machine, I ran stress-ng in parallel (outside the VM) when the tests were being executed (after the compilation not to slow down everything), e.g. with
nproc2=$(nproc); nproc2=$((nproc2 * 2)) stress-ng --cpu "${nproc2}" --io "${nproc2}" --vm "${nproc2}" \ --vm-bytes 1G --timeout 60mI hope you don't mind if I cc the regression ML: this is probably not an important regression but I would not have guessed the issues we had when running network tests were due to 9p, this report might help others with similar issues :)
#regzbot introduced:
d9bc0d11e33bCheers,
Matt[1] https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export-net
[2] https://github.com/amluto/virtme
[3] https://github.com/multipath-tcp/mptcp-upstream-virtme-docker
[4] https://github.com/google/packetdrill/
[5] https://github.com/multipath-tcp/mptcp_net-next/issues/400
[6]
https://github.com/multipath-tcp/packetdrill/blob/mptcp-net-next/gtests/net/packetdrill/run_all.py
[7]
https://github.com/multipath-tcp/packetdrill/blob/mptcp-net-next/gtests/net/packetdrill/in_netns.sh
[8]
https://github.com/multipath-tcp/packetdrill/blob/mptcp-net-next/gtests/net/mptcp/dss/mpc_with_data_client.pkt
[9]
https://github.com/google/packetdrill/blob/master/gtests/net/packetdrill/parser.y#L168
--
Tessares | Belgium | Hybrid Access Solutions www.tessares.net
Hi Eric,
Quoted 8 lines · Eric Van Hensbergen
(repost so it actually goes to the list and making sure gmail doesn't send html)
So, I've not completely reproduced your environment as I've been traveling and its been a bit more difficult. I have done some relative performance regressions (in a virtualized environment just running qemu inside a docker container on my M1 so perf isn't going to be fantastic) -- but even in that case when I'm running unloaded I see very little difference between v6.3 and v6.4.
Thank you for looking at that!
Quoted 4 lines
So, there is some slight perturbation in average latency, but nothing that I would think would be significant (particularly in a simulated platform which carries with it a certain amount of noise). I'm working on automated the regressions so I can try them on multiple
Quoted 8 lines
platforms and add some rigor to the results but I don't see anything here that jumps out at me as being an obvious concern. Of course there may be differences in your kernel config that could be perturbing the behavior, I'll continue to try and run with the virtme configs but my internet is currently on the end of a cocktail straw so pulling and/or building docker images is challenging. I may go ahead and just temporarily rent an aws instance to try and speed that part of the process up.
Thank you for that! If it helps, I can easily run additional tests using our test environment having the performance issue. I can run these tests with and without your modifications in 9p from v6.4 and compare the
results: maybe the issue we have is not "cover" by your tests. But I don't know how portable your benchmark tests are :)
Cheers,
Matt
Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions www.tessares.net
Eric Van Hensbergen
maintainerone thing that may be worth taking a look at in your test environment is confirming that there is no "accidental access" to the synthetic file systems (/sys or /dev) via 9p -- usually the /dev ones wouldn't be problematic, but if they were being accessed via 9p that may be a corner case perturbing performance in a way we don't typically test. The other would be to cross check there is no log file writing via 9p -- again, this should be something that works, but I could imagine the more synchronous write behavior which we are now doing a better job of enforcing when cache=none could cause synchronous delays that might perturb performance of your tests. A workaround for the latter would be to write the log to a tmpfs and then copy to 9p when done. The other potential is just to enable caching (cache=mmap should be sufficient) in your virtme configurations. The new readahead and writeback cache modes should be consistent enough for your use case. I didn't suggest that earlier because I wanted (and still want to) understand the problems you are seeing.
-eric
Quoted 39 lines · Matthieu Baerts
Hi Eric,
Quoted 8 lines · Eric Van Hensbergen
(repost so it actually goes to the list and making sure gmail doesn't send html)
So, I've not completely reproduced your environment as I've been traveling and its been a bit more difficult. I have done some relative performance regressions (in a virtualized environment just running qemu inside a docker container on my M1 so perf isn't going to be fantastic) -- but even in that case when I'm running unloaded I see very little difference between v6.3 and v6.4.
Thank you for looking at that!
Quoted 4 lines
So, there is some slight perturbation in average latency, but nothing that I would think would be significant (particularly in a simulated platform which carries with it a certain amount of noise). I'm working on automated the regressions so I can try them on multiple
Quoted 8 lines
platforms and add some rigor to the results but I don't see anything here that jumps out at me as being an obvious concern. Of course there may be differences in your kernel config that could be perturbing the behavior, I'll continue to try and run with the virtme configs but my internet is currently on the end of a cocktail straw so pulling and/or building docker images is challenging. I may go ahead and just temporarily rent an aws instance to try and speed that part of the process up.
Thank you for that! If it helps, I can easily run additional tests using our test environment having the performance issue. I can run these tests with and without your modifications in 9p from v6.4 and compare the
results: maybe the issue we have is not "cover" by your tests. But I don't know how portable your benchmark tests are :)Cheers,
Matt
--
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
Hi Eric,
Quoted 5 lines · Eric Van Hensbergen
one thing that may be worth taking a look at in your test environment is confirming that there is no "accidental access" to the synthetic file systems (/sys or /dev) via 9p -- usually the /dev ones wouldn't be problematic, but if they were being accessed via 9p that may be a corner case perturbing performance in a way we don't typically test.
Interesting, I didn't even know it was possible to do that :)
I guess we are OK on our side because even if the root partition is mounted with 9p, /dev and /sys have their own mounting points:
Quoted 12 lines
# mount /dev/root on / type 9p (ro,relatime,sync,dirsync,access=any,trans=virtio) devtmpfs on /dev type devtmpfs (rw,relatime,size=1011372k,nr_inodes=252843,mode=755) run on /run type tmpfs (rw,relatime) virtme.guesttools on /run/virtme/guesttools type 9p (ro,relatime,sync,dirsync,access=any,trans=virtio) sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) none on /usr/lib/modules type tmpfs (rw,relatime) tmpfs on /tmp type tmpfs (rw,relatime) tmpfs on /var/log type tmpfs (rw,relatime) tmpfs on /etc/fstab type tmpfs (rw,relatime) tmpfs on /etc/shadow type tmpfs (rw,relatime) proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
Quoted 8 lines
virtme.initmount0 on /home/(...)/mptcp_net-next type 9p (rw,relatime,sync,dirsync,access=any,trans=virtio) debugfs on /sys/kernel/debug type debugfs (rw,relatime) tracefs on /sys/kernel/tracing type tracefs (rw,relatime) tmpfs on /sys/fs/cgroup type tmpfs (rw,relatime) cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,relatime) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,relatime) tmpfs on /etc/resolv.conf type tmpfs (rw,relatime)
Or is this already an issue?
Quoted 11 lines
The other would be to cross check there is no log file writing via 9p -- again, this should be something that works, but I could imagine the more synchronous write behavior which we are now doing a better job of enforcing when cache=none could cause synchronous delays that might perturb performance of your tests. A workaround for the latter would be to write the log to a tmpfs and then copy to 9p when done. The other potential is just to enable caching (cache=mmap should be sufficient) in your virtme configurations. The new readahead and writeback cache modes should be consistent enough for your use case. I didn't suggest that earlier because I wanted (and still want to) understand the problems you are seeing.
Thank you for the idea. We are writing the output of qEmu from the host (docker), not from the VM. We are writing it in the same directory as the one mounted in the VM with 9p in RW mode but I guess that's not an issue, right?
When we execute a test, the output is also written in a dedicated file but this time from the VM and into the same directory as the one mounted in the VM with 9p in RW mode. But when we reproduce the original issue with Packetdrill, Packetdrill is not printing anything in stdout until the end of the test or until an error happened. So likely before or after. Also, Packetdrill is not writing anything in the FS when executing tests as far as I know.
So I think not so much is written in the FS when executing the tests. But there is a bit of text (~15 lines) printed just before executing the next one: to reproduce the issue, the tests are executed in a loop. Could this have an impact?
If yes, I can look at adding "cache=mmap" but for that, I guess I need to modify virtme to change how the directories are mounted, I don't have a direct control on that and I guess I cannot do a remount once the VM is ready, no?
Cheers,
Matt
Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions www.tessares.net
Eric Van Hensbergen
maintainerinline
Quoted 12 lines · Matthieu Baerts
Hi Eric,
Quoted 5 lines · Eric Van Hensbergen
one thing that may be worth taking a look at in your test environment is confirming that there is no "accidental access" to the synthetic file systems (/sys or /dev) via 9p -- usually the /dev ones wouldn't be problematic, but if they were being accessed via 9p that may be a corner case perturbing performance in a way we don't typically test.
Interesting, I didn't even know it was possible to do that :)
Well, there is a special mode which usually isn't enabled on mount which is nodevmap which does allow you to access the devices on the host, without that, even if you were accessing devices on the host file system, they should still be serviced by the devices inside the vm. sysfs a bit more complicated as those are treated as files. But from your mount list, it looks like you have stuff mounted in a way that shouldn't be a problem. Thanks for cross-checking, its one less thing to worry about.
Quoted 12 lines
Quoted 11 lines
The other would be to cross check there is no log file writing via 9p -- again, this should be something that works, but I could imagine the more synchronous write behavior which we are now doing a better job of enforcing when cache=none could cause synchronous delays that might perturb performance of your tests. A workaround for the latter would be to write the log to a tmpfs and then copy to 9p when done. The other potential is just to enable caching (cache=mmap should be sufficient) in your virtme configurations. The new readahead and writeback cache modes should be consistent enough for your use case. I didn't suggest that earlier because I wanted (and still want to) understand the problems you are seeing.
Quoted 5 lines
Thank you for the idea. We are writing the output of qEmu from the host (docker), not from the VM. We are writing it in the same directory as the one mounted in the VM with 9p in RW mode but I guess that's not an issue, right?
Yeah, if its writing to the underlying filesystem not through the 9p mount, this shouldn't cause any problems.
Quoted 8 lines
When we execute a test, the output is also written in a dedicated file but this time from the VM and into the same directory as the one mounted in the VM with 9p in RW mode. But when we reproduce the original issue with Packetdrill, Packetdrill is not printing anything in stdout until the end of the test or until an error happened. So likely before or after. Also, Packetdrill is not writing anything in the FS when executing tests as far as I know.
Okay, then not likely a write versus writeback problem.
Quoted 4 lines
So I think not so much is written in the FS when executing the tests. But there is a bit of text (~15 lines) printed just before executing the next one: to reproduce the issue, the tests are executed in a loop. Could this have an impact?
I wouldn't think so, I was more worried about it printing something which gets synchronously written to a log in between packet writes which might delay them...but doesn't sound like its doing anything like that.
Quoted 5 lines
If yes, I can look at adding "cache=mmap" but for that, I guess I need to modify virtme to change how the directories are mounted, I don't have a direct control on that and I guess I cannot do a remount once the VM is ready, no?
That's correct, mount -o remount probably behaves badly with 9p as a root file system mount.
The conference I am at with horrible internet is over tomorrow so perhaps I'll be able to get a proper virtme / mptcp regression environment going over the weekend to try and continue to drill down on what might be the problem.
In the meantime I'm fixing up my own regression infrastructure to start recording latency information to make sure we aren't getting any performance regressions from either latency or bandwidth as we continue to work on 9p in the future.
-eric
Quoted 17 lines · Eric Van Hensbergen
inline
Quoted 12 lines · Matthieu Baerts
Hi Eric,
Quoted 5 lines · Eric Van Hensbergen
one thing that may be worth taking a look at in your test environment is confirming that there is no "accidental access" to the synthetic file systems (/sys or /dev) via 9p -- usually the /dev ones wouldn't be problematic, but if they were being accessed via 9p that may be a corner case perturbing performance in a way we don't typically test.
Interesting, I didn't even know it was possible to do that :)
Quoted 7 lines
Well, there is a special mode which usually isn't enabled on mount which is nodevmap which does allow you to access the devices on the host, without that, even if you were accessing devices on the host file system, they should still be serviced by the devices inside the vm. sysfs a bit more complicated as those are treated as files. But from your mount list, it looks like you have stuff mounted in a way that shouldn't be a problem. Thanks for cross-checking, its one less thing to worry about.
Thank you for the explanation! That's nice to see how much we can do with 9p, thank you for that! :)
Quoted 8 lines
The conference I am at with horrible internet is over tomorrow so perhaps I'll be able to get a proper virtme / mptcp regression environment going over the weekend to try and continue to drill down on what might be the problem.
In the meantime I'm fixing up my own regression infrastructure to start recording latency information to make sure we aren't getting any performance regressions from either latency or bandwidth as we continue to work on 9p in the future.
Thank you!
On our side, there is no hurry, we have a revert of the patches from 9p from v6.4 in our tree for the CI to be happy. (But I don't know the impact others might have: in my case, it was not obvious to see the link with 9p :) ).
The only drawback is that I'm maintaining this branch with the revert and I have to handle conflicts issues in 9p myself in a code I don't know but I think it is fine for the moment :)
Recently I got a merge conflict with commit c829d0bd33ac ("9p: Add splice_read wrapper") that recently landed in Linus tree and I had to apply the patch attached to this email and visible there:
https://github.com/multipath-tcp/mptcp_net-next/commit/be007e248783
The CI looks happy so far so I guess/hope it was the right modification :)
Cheers,
Matt
Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions www.tessares.net
From be007e2487834a3cd7f7f43f1863b687c12c6c2e Mon Sep 17 00:00:00 2001
From: Matthieu Baerts <[email protected]>
Date: Thu, 29 Jun 2023 15:42:45 +0200
Subject: [PATCH] 9p: P9L_DIRECT flag is not available
Using CACHE_MMAP instead, similar to what has been done in v9fs_file_read_iter() in commit 1543b4c5071c ("fs/9p: remove writeback fid and fix per-file modes"), hopefully the right thing...
--- fs/9p/vfs_file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/9p/vfs_file.c +3 -1
@@ -395,11 +395,13 @@ static ssize_t v9fs_file_splice_read(struct file *in, loff_t *ppos, size_t len, unsigned int flags) {struct p9_fid *fid = in->private_data; +struct inode *inode =file_inode (in); +struct v9fs_session_info *v9ses =v9fs_inode2v9ses (inode);p9_debug (P9_DEBUG_VFS ,"fid %d count %zu offset %lld\n" , fid->fid, len, *ppos); -if (fid->mode &P9L_DIRECT ) +if (v9ses->cache >CACHE_MMAP )return copy_splice_read (in, ppos, pipe, len, flags);return filemap_splice_read (in, ppos, pipe, len, flags); }
Signature · 1 line
2.40.1