AMD EPYC virtual network performances
Hello,
As been reported by David Morel (mail 4 Jan 2024), our customers experience a
very poor virtual network performances in HVM guests on AMD EPYC platforms.
After some investigations we notices a huge performances drop (perfs divided by
factor of 5) starting from 5.10.88 Linux kernel version on the AMD EPYC platforms. The patch introduced in this kernel version that allows to pinpoint
the buggy behavior is :
“xen/netfront: harden netfront against event channel storms” d31b3379179d64724d3bbfa87bd4ada94e3237de
The patch basically binds the network frontend to the xen_lateeoi_chip irq_chip (insead of xen_dynamic_chip) which allows to its clients to inform
the chip if spurious interrupts are detected and so the delay in interrupt treatment is introduced by the chip.
We tried to measure how much spurious interrupts (no work to do by the driver)
are raised. We used iperf2 to bench the network bandwidth on the AMD EPYC 7262
8-core).
Dom0 > iperf -s
DomU> iperf -c $DOM0_IP_ADDRESS
It appears from our observations that we have approximatively 1 spurious interrupt for 1 “useful” interrupt (frontend TX interrupts) for HVM guests.
We run the same bench on the same platform with PV and PVH and the interrupts
spurious/useful ratio was quite lower: 1 to 20 (so the network performances are
much better).
We also run this bench on the Intel platform (Intel Xeon Bronze 3106 CPU). The
interrupts spurious/useful ratio was about 1 to 30 for HVM guests.
So this make us think that this buggy behavior is related to abnormal amount of
spurious interrupts. This spurious/useful interrupts ratio is particularly elevated in HVM guests on AMD platforms, so virtual network bandwidth is heavily
penalized – in our particular bench we have 1,5Gbps bandwidth instead of 7 Gbps
(when slowdown isn’t introduced by the irq_chip).
Does anybody notice this behavior on his side? Can we do something about it?
Andrei Semenov
Quoted 36 lines · Andrei Semenov
Hello,
As been reported by David Morel (mail 4 Jan 2024), our customers experience a very poor virtual network performances in HVM guests on AMD EPYC platforms.
After some investigations we notices a huge performances drop (perfs divided by factor of 5) starting from 5.10.88 Linux kernel version on the AMD EPYC platforms. The patch introduced in this kernel version that allows to pinpoint the buggy behavior is :
“xen/netfront: harden netfront against event channel storms”
d31b3379179d64724d3bbfa87bd4ada94e3237deThe patch basically binds the network frontend to the
xen_lateeoi_chipirq_chip(insead ofxen_dynamic_chip) which allows to its clients to inform the chip if spurious interrupts are detected and so the delay in interrupt treatment is introduced by the chip.We tried to measure how much spurious interrupts (no work to do by the driver) are raised. We used
iperf2to bench the network bandwidth on the AMD EPYC 7262 8-core).Dom0 > iperf -s
DomU> iperf -c $DOM0_IP_ADDRESS
It appears from our observations that we have approximatively 1 spurious interrupt for 1 “useful” interrupt (frontend TX interrupts) for HVM guests.
We run the same bench on the same platform with PV and PVH and the interrupts spurious/useful ratio was quite lower: 1 to 20 (so the network performances are much better).
We also run this bench on the Intel platform (Intel Xeon Bronze 3106 CPU). The interrupts spurious/useful ratio was about 1 to 30 for HVM guests.
Quoted 7 lines
So this make us think that this buggy behavior is related to abnormal amount of spurious interrupts. This spurious/useful interrupts ratio is particularly elevated in HVM guests on AMD platforms, so virtual network bandwidth is heavily penalized – in our particular bench we have 1,5Gbps bandwidth instead of 7 Gbps (when slowdown isn’t introduced by the
irq_chip).Does anybody notice this behavior on his side? Can we do something about it?
In the guest you could raise the spurious event threshold via writing a higher number to /sys/devices/vif-0/xenbus/spurious_threshold (default is 1).
There is a similar file on the backend side, which might be interesting to raise the value.
In both directories you can see the number of spurious events by looking into the spurious_events file.
In the end the question is why so many spurious events are happening. Finding the reason might be hard, though.
Juergen
Quoted 6 lines · Jürgen Groß
In both directories you can see the number of spurious events by looking into the
spurious_eventsfile.In the end the question is why so many spurious events are happening. Finding the reason might be hard, though.
Hopefully my comments on this drew your attention, yet lack of response suggests otherwise. I'm wondering whether this is an APIC misprogramming issue, similar to the x2APIC issue which was causing trouble with recent AMD processors.
Trying to go after the Linux software RAID1, my current attempt is "iommu=debug iommu=no-intremap". I'm seeing *lots* of messages from spurious events in xl dmesg. So many I have a difficult time believing they are related to hardware I/O.
In which case could the performance problem observed by Andrei Semenov be due to misprogramming of [x2]APIC triggering spurious events?
If so this is actually rather serious as there is so much noise it is impossible to debug anything else.
In other news logs are available for private (PGP) viewing. If one of the core developers has an appropriate AMD machine (IOMMUv2, Zen 1 or later; >=2 available SATA ports) I would send a pair of devices *known* to manifest the RAID1 issue.
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Quoted 13 lines · Elliott Mitchell
Quoted 6 lines · Jürgen Groß
In both directories you can see the number of spurious events by looking into the
spurious_eventsfile.In the end the question is why so many spurious events are happening. Finding the reason might be hard, though.
Hopefully my comments on this drew your attention, yet lack of response suggests otherwise. I'm wondering whether this is an APIC misprogramming issue, similar to the x2APIC issue which was causing trouble with recent AMD processors.
Quoted 4 lines
Trying to go after the Linux software RAID1, my current attempt is "iommu=debug iommu=no-intremap". I'm seeing *lots* of messages from spurious events in
xl dmesg. So many I have a difficult time believing they are related to hardware I/O.
Seeing them in xl dmesg means those spurious events are seen by the hypervisor, not by the Linux kernel.
So IMHO this is not a kernel issue.
Quoted 2 lines
In which case could the performance problem observed by Andrei Semenov be due to misprogramming of [x2]APIC triggering spurious events?
I don't see a connection here, as spurious interrupts (as seen by the hypervisor in your case) and spurious events (as seen by Andrei) are completely different (hardware vs. software level).
Juergen
Quoted 14 lines · Jürgen Groß
Quoted 13 lines · Elliott Mitchell
Quoted 6 lines · Jürgen Groß
In both directories you can see the number of spurious events by looking into the
spurious_eventsfile.In the end the question is why so many spurious events are happening. Finding the reason might be hard, though.
Hopefully my comments on this drew your attention, yet lack of response suggests otherwise. I'm wondering whether this is an APIC misprogramming issue, similar to the x2APIC issue which was causing trouble with recent AMD processors.
Quoted 7 lines
Quoted 4 lines
Trying to go after the Linux software RAID1, my current attempt is "iommu=debug iommu=no-intremap". I'm seeing *lots* of messages from spurious events in
xl dmesg. So many I have a difficult time believing they are related to hardware I/O.Seeing them in
xl dmesgmeans those spurious events are seen by the hypervisor, not by the Linux kernel.
Indeed. Yet this seems to be pointing at a problem, whereas most other information sources merely indicate there is a problem.
I'm unable to resolve those to hardware. This could mean those are being synthesized by software and when crossing some interface they get reinterpreted as hardware events. This could mean those are hardware events, but somewhere inside Xen information is being corrupted and the information displayed is unrelated to the original event (x2APIC misinterpretation?).
Quoted 6 lines
Quoted 2 lines
In which case could the performance problem observed by Andrei Semenov be due to misprogramming of [x2]APIC triggering spurious events?
I don't see a connection here, as spurious interrupts (as seen by the hypervisor in your case) and spurious events (as seen by Andrei) are completely different (hardware vs. software level).
The entries seem to appear at an average of about 1/hour. Could be most events are being dropped and 10x that number are occuring. If so, those extras could be turning into spurious events seen by various domains.
There is a possibility spurious interrupts are being turned into spurious events by the back-end drivers.
Jürgen Groß, what is the performance impact of "iommu=debug"? Seems to mostly cause more reporting and have minimal/no performance effect.
Andrei Semenov, if you're allowed to release information about your
systems: What is your mix of guest types (<1% PV, 90% PVH, 9% HVM?)?
Is there any pattern of PIC type and driver on effected/uneffected systems? I would suspect most/all of your systems to have a x2APIC. Which of, cluster mode, mixed mode, physical mode, or other do they use? ("Using APIC driver x2apic_mixed" => x2APIC, mixed-mode)
Assuming Jürgen Groß confirms "iommu=debug" has minimal/no performance impact; Would it be possible to try booting one or more effected systems with "iommu=debug" on Xen's command-line? I'm wondering whether you observe lines of "No irq handler for vector" or spurious interrupt lines in Xen's dmesg.
The pattern of events in xl dmesg seems to better match spurious events being sent to/from my single HVM domain, rather than the RAID1 issue. In particular there are too many distinct interrupt numberss to match the hardware used for RAID. Whereas there aren't enough distinct interrupt numbers to account for every single event channel with spurious events (several PVH domains).
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Quoted 37 lines · Elliott Mitchell
Quoted 14 lines · Jürgen Groß
Quoted 13 lines · Elliott Mitchell
Quoted 6 lines · Jürgen Groß
In both directories you can see the number of spurious events by looking into the
spurious_eventsfile.In the end the question is why so many spurious events are happening. Finding the reason might be hard, though.
Hopefully my comments on this drew your attention, yet lack of response suggests otherwise. I'm wondering whether this is an APIC misprogramming issue, similar to the x2APIC issue which was causing trouble with recent AMD processors.
Quoted 7 lines
Quoted 4 lines
Trying to go after the Linux software RAID1, my current attempt is "iommu=debug iommu=no-intremap". I'm seeing *lots* of messages from spurious events in
xl dmesg. So many I have a difficult time believing they are related to hardware I/O.Seeing them in
xl dmesgmeans those spurious events are seen by the hypervisor, not by the Linux kernel.Indeed. Yet this seems to be pointing at a problem, whereas most other information sources merely indicate there is a problem.
I'm unable to resolve those to hardware. This could mean those are being synthesized by software and when crossing some interface they get reinterpreted as hardware events. This could mean those are hardware events, but somewhere inside Xen information is being corrupted and the information displayed is unrelated to the original event (x2APIC misinterpretation?).
Quoted 3 lines
Quoted 2 lines
In which case could the performance problem observed by Andrei Semenov be due to misprogramming of [x2]APIC triggering spurious events?
Quoted 7 lines
Quoted 3 lines
I don't see a connection here, as spurious interrupts (as seen by the hypervisor in your case) and spurious events (as seen by Andrei) are completely different (hardware vs. software level).
The entries seem to appear at an average of about 1/hour. Could be most events are being dropped and 10x that number are occuring. If so, those extras could be turning into spurious events seen by various domains.
Even 10 spurious events per hour should not have a measurable impact on performance.
Quoted 2 lines
There is a possibility spurious interrupts are being turned into spurious events by the back-end drivers.
No, I don't think so.
Quoted 2 lines
Jürgen Groß, what is the performance impact of "iommu=debug"? Seems to mostly cause more reporting and have minimal/no performance effect.
I guess you are referring to the Xen option? I'm no expert in this area.
Juergen
Quoted 7 lines · Jürgen Groß
Quoted 6 lines · Elliott Mitchell
Quoted 4 lines · Jürgen Groß
I don't see a connection here, as spurious interrupts (as seen by the hypervisor in your case) and spurious events (as seen by Andrei) are completely different (hardware vs. software level).
Quoted 6 lines
Quoted 3 lines
The entries seem to appear at an average of about 1/hour. Could be most events are being dropped and 10x that number are occuring. If so, those extras could be turning into spurious events seen by various domains.
Even 10 spurious events per hour should not have a measurable impact on performance.
Come to think of it, depending upon time that domain is sometimes low activity (build so it is either pegging or idle). The 1/hour was during idle times, so during busy times it might be much worse. I haven't been tracking xl dmesg as carefully recently.
Do the maintainers ever run machines with "iommu=debug"? I'm actually rather concerned *anything* spurious is showing up as I'm left suspecting there may have been something lurking for some time.
Quoted 10 lines
Quoted 2 lines
There is a possibility spurious interrupts are being turned into spurious events by the back-end drivers.
No, I don't think so.
Quoted 2 lines
Jürgen Groß, what is the performance impact of "iommu=debug"? Seems to mostly cause more reporting and have minimal/no performance effect.
I guess you are referring to the Xen option? I'm no expert in this area.
Drat. I haven't noticed much, which would match with simply enabling a bunch of debugging printk()s (alas I'm not monitoring performance closely enough to be sure). Guess I wait for Andrei Semenov to state a comfort level with trying "iommu=debug".
My guess is Andrei Semenov's issue is quite widespread. I hadn't noticed the issue until trying find /sys/devices -name spurious_events -print.
If you don't know where to look, Linux is apparently pretty good at hiding this sort of issue. The impact may not seem too severe if your baseline was infected.
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Quoted 32 lines · Elliott Mitchell
Quoted 7 lines · Jürgen Groß
Quoted 6 lines · Elliott Mitchell
Quoted 4 lines · Jürgen Groß
I don't see a connection here, as spurious interrupts (as seen by the hypervisor in your case) and spurious events (as seen by Andrei) are completely different (hardware vs. software level).
Quoted 6 lines
Quoted 3 lines
The entries seem to appear at an average of about 1/hour. Could be most events are being dropped and 10x that number are occuring. If so, those extras could be turning into spurious events seen by various domains.
Even 10 spurious events per hour should not have a measurable impact on performance.
Come to think of it, depending upon time that domain is sometimes low activity (build so it is either pegging or idle). The 1/hour was during idle times, so during busy times it might be much worse. I haven't been tracking
xl dmesgas carefully recently.Do the maintainers ever run machines with "iommu=debug"? I'm actually rather concerned *anything* spurious is showing up as I'm left suspecting there may have been something lurking for some time.
Quoted 8 lines
Quoted 2 lines
There is a possibility spurious interrupts are being turned into spurious events by the back-end drivers.
No, I don't think so.
Quoted 2 lines
Jürgen Groß, what is the performance impact of "iommu=debug"? Seems to mostly cause more reporting and have minimal/no performance effect.
Quoted 7 lines
Quoted 2 lines
I guess you are referring to the Xen option? I'm no expert in this area.
Drat. I haven't noticed much, which would match with simply enabling a bunch of debugging printk()s (alas I'm not monitoring performance closely enough to be sure). Guess I wait for Andrei Semenov to state a comfort level with trying "iommu=debug".
You didn't answer my question.
Please send the Xen and dom0 command line options you are using.
Juergen
Quoted 15 lines · Jürgen Groß
Quoted 14 lines · Elliott Mitchell
Quoted 12 lines · Jürgen Groß
Quoted 3 lines · Elliott Mitchell
There is a possibility spurious interrupts are being turned into spurious events by the back-end drivers.
No, I don't think so.
Quoted 2 lines
Jürgen Groß, what is the performance impact of "iommu=debug"? Seems to mostly cause more reporting and have minimal/no performance effect.
I guess you are referring to the Xen option? I'm no expert in this area.
Quoted 6 lines
Quoted 4 lines
Drat. I haven't noticed much, which would match with simply enabling a bunch of debugging printk()s (alas I'm not monitoring performance closely enough to be sure). Guess I wait for Andrei Semenov to state a comfort level with trying "iommu=debug".
You didn't answer my question.
I guess I did not explicitly do so. I was referring to the Xen command-line option. I was asking in the hope it might be reasonable for Andrei Semenov to run with it on for some time.
Come to think of it, I now wonder whether "iommu=no-intremap" is part of the recipe for having the messages I've seen show up.
I can now state they appear to correlate with activity in the HVM domain (which is associated with network/vif activity) which also increases Linux's spurious interrupt counters.
I cannot yet state the HVM domain is the exclusive source of these messages. I am able to run with that domain shutdown, so I've done so. If no new messages show up that will seem to attribute those to the HVM domain.
The other interesting bit is "iommu=no-intremap" seems to have made the messages associated with the software RAID1 issue disappear (possibly partially, but not fully mitigated it too). My observations seem insufficient to indicate whether or not these are distinct issues though.
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Quoted 21 lines · Elliott Mitchell
Quoted 20 lines · Jürgen Groß
Quoted 18 lines · Elliott Mitchell
Quoted 5 lines · Jürgen Groß
Quoted 3 lines · Elliott Mitchell
There is a possibility spurious interrupts are being turned into spurious events by the back-end drivers.
Quoted 7 lines
No, I don't think so.
Quoted 2 lines
Jürgen Groß, what is the performance impact of "iommu=debug"? Seems to mostly cause more reporting and have minimal/no performance effect.
I guess you are referring to the Xen option? I'm no expert in this area.
Drat. I haven't noticed much, which would match with simply enabling a bunch of debugging printk()s (alas I'm not monitoring performance closely enough to be sure). Guess I wait for Andrei Semenov to state a comfort level with trying "iommu=debug".
Quoted 4 lines
Quoted 1 line
You didn't answer my question.
I guess I did not explicitly do so. I was referring to the Xen command-line option.
And again you didn't supply the information I asked for (command line options of Xen and dom0).
Did you consider that asking for help while not supplying data which has been asked for is going to result in no help at all? You are wasting the time of volunteers, which will reduce the motivation to look into your issue a lot.
That said, I won't look into your problems any longer, as I have a job to do and I can spend my time much better than trying to help someone who isn't willing to answer even the simplest questions.
Juergen
Quoted 9 lines · Jürgen Groß
Quoted 8 lines · Elliott Mitchell
Quoted 7 lines · Jürgen Groß
Quoted 5 lines · Elliott Mitchell
Drat. I haven't noticed much, which would match with simply enabling a bunch of debugging printk()s (alas I'm not monitoring performance closely enough to be sure). Guess I wait for Andrei Semenov to state a comfort level with trying "iommu=debug".
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
You didn't answer my question.
I guess I did not explicitly do so. I was referring to the Xen command-line option.
And again you didn't supply the information I asked for (command line options of Xen and dom0).
I had thought that was aimed at the initial reporter, Andrei Semenov. I've already supplied all options which could plausibly effect this.
Xen: placeholder watchdog=true loglvl=info iommu=debug iommu=no-intremap cpuidle dom0_mem=... no-real-mode edd=off
Linux; placeholder root=... ro concurrency=none vga=normal xen_pciback.hide=... net.ifname=1 nomodeset blacklist=...
Somehow the others really don't seem likely to effect either issue as they don't effect interrupts (okay some drivers don't get loaded, but those drivers would render the problem irreproduceable).
Quoted 4 lines
Did you consider that asking for help while not supplying data which has been asked for is going to result in no help at all? You are wasting the time of volunteers, which will reduce the motivation to look into your issue a lot.
Sorry about being a bit inconsistent, but there is little I can do in the short-term about that. I would *strongly* prefer to keep information protected (PGP). Large commercial installations have a rather different risk/privacy threshold.
It is also notable that I am not the sole reporter of any of these issues.
My speculation was wrong, the "CPU*: No irq handler for vector..." messages are not strictly tied to the HVM domain. I think I'm simply reproducing what Andrei Semenov observed, HVM domains are more severely effected by this issue.
I think I need to repeat an earlier observation of mine. It is NOT just vifs being effected by this, event channels associated with virtual block-devices are also seeing spurious interrupts though at a lower rate.
What comes to mind is vifs would generate interrupts at a much greater rate than vbds. I kind of suspect a timing issue involving closely spaced interrupt. I wonder if there is a simple timing issue with the vif/vbd protocol. Problem is how would these turn into spurious interrupts observed by Xen? (I had suspected Qemu for the HVM domain, but that was disproven)
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Quoted 3 lines · Andrei Semenov
Does anybody notice this behavior on his side? Can we do something about it?
I hadn't previously noticed this manifestation, but now that I know where to look seems I'm also seeing the issue.
It also effects other lines of AMD's offerings.
It also effects PVH domains, but may not have as much impact.
It also effects virtual block devices.
Right now I consider this highly speculative, but I am now wondering whether the software RAID1 issue is related to this.
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Quoted 8 lines · Elliott Mitchell
Quoted 3 lines · Andrei Semenov
Does anybody notice this behavior on his side? Can we do something about it?
I hadn't previously noticed this manifestation, but now that I know where to look seems I'm also seeing the issue.
Quoted 7 lines
It also effects PVH domains, but may not have as much impact.
It also effects virtual block devices.
Right now I consider this highly speculative, but I am now wondering whether the software RAID1 issue is related to this.
Having considered what I'm observing a bit more, this is pure speculation; however, there is a rather severe situation to consider.
I now suspect most/all of the lines showing up in xl dmesg due to iommu=debug are likely associated with the spurious interrupt issue, not the RAID1 issue. The result is iommu=debug is useless for attempting to debug anything other than the spurious interrupt issue. The messages associated with the spurious interrupts are generating too much noise.
The spurious interrupt issue seems to be pretty severe.
In other news, appears iommu=no-intremap does not address the software-RAID1 issue. Could be it reduces performance sufficiently to somewhat mitigate the issue though.
I am also looking attempting to track down one other issue which might also mitigate this.
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Quoted 8 lines · Andrei Semenov
After some investigations we notices a huge performances drop (perfs divided by
factor of 5) starting from 5.10.88 Linux kernel version on the AMD EPYC platforms. The patch introduced in this kernel version that allows to pinpoint
the buggy behavior is :
Quoted 8 lines
“xen/netfront: harden netfront against event channel storms”
d31b3379179d64724d3bbfa87bd4ada94e3237deThe patch basically binds the network frontend to the
xen_lateeoi_chipirq_chip(insead ofxen_dynamic_chip) which allows to its clients to inform
the chip if spurious interrupts are detected and so the delay in interrupt treatment is introduced by the chip.
I worry I'm being knave here.
For the heck of it, I took a glance at b27d47950e48. If my understanding is correct, b27d47950e48 is making a very basic (and wrong) assumption about timing/latency.
In particular any time either side receive an event, it will handle X # of incoming payloads and Y # of acknowledged outgoing payloads. As such if X + Y > 1, then up to X + Y - 1 spurious events may be detected. The issue is there is no synchronization between the event channel and the work queues.
In particular the network back end could legitimately generate:
work0 signal0 work1 signal1 work2 signal2 work3 signal3
Whereas the network front end may handle this as:
event0 work0 work1 work2 work3 event1 event2 event3
Where b27d47950e48 would interpret events 1-3 as spurious, even though they're perfectly legitimate. The same phenomenon could occur in both directions and also with the Xen block devices.
Ultimately how is the network portion of XSA-391 any different from any other network DoS? If an interrupt is generated for every single packet of a series of runt frames, there will be heavy processor use for little network traffic.
AMD systems may fair worse than Intel systems due to differing cache coherence behavior/latency. Perhaps AMD's NUMA implementation adds some latency. (huh, suddenly the RAID1 issue comes to mind)
Hopefully I'm not making knave speculation here. Might this be the simplest of issues, just it was missed due to being too obvious?
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Quoted 34 lines · Elliott Mitchell
Quoted 8 lines · Andrei Semenov
After some investigations we notices a huge performances drop (perfs divided by
factor of 5) starting from 5.10.88 Linux kernel version on the AMD EPYC platforms. The patch introduced in this kernel version that allows to pinpoint
the buggy behavior is :Quoted 8 lines
“xen/netfront: harden netfront against event channel storms”
d31b3379179d64724d3bbfa87bd4ada94e3237deThe patch basically binds the network frontend to the
xen_lateeoi_chipirq_chip(insead ofxen_dynamic_chip) which allows to its clients to inform
the chip if spurious interrupts are detected and so the delay in interrupt treatment is introduced by the chip.I worry I'm being knave here.
For the heck of it, I took a glance at
b27d47950e48. If my understanding is correct,b27d47950e48is making a very basic (and wrong) assumption about timing/latency.In particular any time either side receive an event, it will handle X # of incoming payloads and Y # of acknowledged outgoing payloads. As such if X + Y > 1, then up to X + Y - 1 spurious events may be detected. The issue is there is no synchronization between the event channel and the work queues.
In particular the network back end could legitimately generate:
work0 signal0 work1 signal1 work2 signal2 work3 signal3
Quoted 7 lines
Whereas the network front end may handle this as:
event0 work0 work1 work2 work3 event1 event2 event3
Where
b27d47950e48would interpret events 1-3 as spurious, even though they're perfectly legitimate. The same phenomenon could occur in both directions and also with the Xen block devices.
No.
For one, as long as event0 isn't EOI'd, the other events would just be merged into a single one.
Additionally, as long as work0 isn't acknowledged by incrementing the consumer index, additional queued work items should NOT result in additional events being sent. An event is only sent if a work item is queued to a ring buffer with consumer == producer.
Quoted 4 lines
Ultimately how is the network portion of XSA-391 any different from any other network DoS? If an interrupt is generated for every single packet of a series of runt frames, there will be heavy processor use for little network traffic.
The problem is that a steady stream of events could keep the other side in IRQ handling for arbitrary amount of times, leading to hangups.
Quoted 7 lines
AMD systems may fair worse than Intel systems due to differing cache coherence behavior/latency. Perhaps AMD's NUMA implementation adds some latency. (huh, suddenly the RAID1 issue comes to mind)
Hopefully I'm not making knave speculation here. Might this be the simplest of issues, just it was missed due to being too obvious?
I don't agree with your analysis, see above.
Juergen
Quoted 39 lines · Jürgen Groß
Quoted 38 lines · Elliott Mitchell
Quoted 8 lines · Andrei Semenov
After some investigations we notices a huge performances drop (perfs divided by
factor of 5) starting from 5.10.88 Linux kernel version on the AMD EPYC platforms. The patch introduced in this kernel version that allows to pinpoint
the buggy behavior is :Quoted 8 lines
“xen/netfront: harden netfront against event channel storms”
d31b3379179d64724d3bbfa87bd4ada94e3237deThe patch basically binds the network frontend to the
xen_lateeoi_chipirq_chip(insead ofxen_dynamic_chip) which allows to its clients to inform
the chip if spurious interrupts are detected and so the delay in interrupt treatment is introduced by the chip.I worry I'm being knave here.
For the heck of it, I took a glance at
b27d47950e48. If my understanding is correct,b27d47950e48is making a very basic (and wrong) assumption about timing/latency.In particular any time either side receive an event, it will handle X # of incoming payloads and Y # of acknowledged outgoing payloads. As such if X + Y > 1, then up to X + Y - 1 spurious events may be detected. The issue is there is no synchronization between the event channel and the work queues.
In particular the network back end could legitimately generate:
work0 signal0 work1 signal1 work2 signal2 work3 signal3
Whereas the network front end may handle this as:
event0 work0 work1 work2 work3 event1 event2 event3
Quoted 8 lines
Quoted 3 lines
Where
b27d47950e48would interpret events 1-3 as spurious, even though they're perfectly legitimate. The same phenomenon could occur in both directions and also with the Xen block devices.No.
For one, as long as event0 isn't EOI'd, the other events would just be merged into a single one.
With the 2-level bitfield event channel certainly, but what if FIFO event channels were in use?
Quoted 4 lines
Additionally, as long as work0 isn't acknowledged by incrementing the consumer index, additional queued work items should NOT result in additional events being sent. An event is only sent if a work item is queued to a ring buffer with consumer == producer.
What if the front-end and back-end were running simultaneously on different processors?
Quoted 7 lines
Quoted 4 lines
Ultimately how is the network portion of XSA-391 any different from any other network DoS? If an interrupt is generated for every single packet of a series of runt frames, there will be heavy processor use for little network traffic.
The problem is that a steady stream of events could keep the other side in IRQ handling for arbitrary amount of times, leading to hangups.
I know. I was pointing out this seems little different from other typical network DoS behavior. This sort of situation is also an issue when network speeds are increasing since more packets means more interrupts.
Quoted 9 lines
Quoted 7 lines
AMD systems may fair worse than Intel systems due to differing cache coherence behavior/latency. Perhaps AMD's NUMA implementation adds some latency. (huh, suddenly the RAID1 issue comes to mind)
Hopefully I'm not making knave speculation here. Might this be the simplest of issues, just it was missed due to being too obvious?
I don't agree with your analysis, see above.
Okay. I was asking since it looked a bit odd and there has been no news on this issue (unless I missed some patch flying by).
I don't know how large the impact of this is. I wouldn't be surprised if this turned out to overwhelm all my other efforts at performance improvement.
Any news on your efforts to track this down?
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Quoted 44 lines · Elliott Mitchell
Quoted 43 lines · Jürgen Groß
Quoted 41 lines · Elliott Mitchell
Quoted 8 lines · Andrei Semenov
After some investigations we notices a huge performances drop (perfs divided by
factor of 5) starting from 5.10.88 Linux kernel version on the AMD EPYC platforms. The patch introduced in this kernel version that allows to pinpoint
the buggy behavior is :Quoted 8 lines
“xen/netfront: harden netfront against event channel storms”
d31b3379179d64724d3bbfa87bd4ada94e3237deThe patch basically binds the network frontend to the
xen_lateeoi_chipirq_chip(insead ofxen_dynamic_chip) which allows to its clients to inform
the chip if spurious interrupts are detected and so the delay in interrupt treatment is introduced by the chip.I worry I'm being knave here.
For the heck of it, I took a glance at
b27d47950e48. If my understanding is correct,b27d47950e48is making a very basic (and wrong) assumption about timing/latency.In particular any time either side receive an event, it will handle X # of incoming payloads and Y # of acknowledged outgoing payloads. As such if X + Y > 1, then up to X + Y - 1 spurious events may be detected. The issue is there is no synchronization between the event channel and the work queues.
In particular the network back end could legitimately generate:
work0 signal0 work1 signal1 work2 signal2 work3 signal3
Whereas the network front end may handle this as:
event0 work0 work1 work2 work3 event1 event2 event3
Where
b27d47950e48would interpret events 1-3 as spurious, even though they're perfectly legitimate. The same phenomenon could occur in both directions and also with the Xen block devices.
Quoted 7 lines
Quoted 4 lines
No.
For one, as long as event0 isn't EOI'd, the other events would just be merged into a single one.
With the 2-level bitfield event channel certainly, but what if FIFO event channels were in use?
The same applies. The event channel is masked as long as there was no EOI.
Quoted 8 lines
Quoted 5 lines
Additionally, as long as work0 isn't acknowledged by incrementing the consumer index, additional queued work items should NOT result in additional events being sent. An event is only sent if a work item is queued to a ring buffer with consumer == producer.
What if the front-end and back-end were running simultaneously on different processors?
There are (or should be) appropriate barriers around accesses of consumer and producer indices, and the sequence they should be accessed is well defined.
Quoted 24 lines
Quoted 8 lines
Quoted 5 lines
Ultimately how is the network portion of XSA-391 any different from any other network DoS? If an interrupt is generated for every single packet of a series of runt frames, there will be heavy processor use for little network traffic.
The problem is that a steady stream of events could keep the other side in IRQ handling for arbitrary amount of times, leading to hangups.
I know. I was pointing out this seems little different from other typical network DoS behavior. This sort of situation is also an issue when network speeds are increasing since more packets means more interrupts.
Quoted 9 lines
Quoted 7 lines
AMD systems may fair worse than Intel systems due to differing cache coherence behavior/latency. Perhaps AMD's NUMA implementation adds some latency. (huh, suddenly the RAID1 issue comes to mind)
Hopefully I'm not making knave speculation here. Might this be the simplest of issues, just it was missed due to being too obvious?
I don't agree with your analysis, see above.
Quoted 8 lines
Okay. I was asking since it looked a bit odd and there has been no news on this issue (unless I missed some patch flying by).
I don't know how large the impact of this is. I wouldn't be surprised if this turned out to overwhelm all my other efforts at performance improvement.
Any news on your efforts to track this down?
ENOTIME up to now.
Did you try to set the spurious threshold to e.g. 2 instead of the default of 1? In case that helps it might be a good idea to either change the default or to at least add a boot parameter for setting the default.
Juergen
Quoted 16 lines · Jürgen Groß
Quoted 15 lines · Elliott Mitchell
Quoted 6 lines · Jürgen Groß
Quoted 3 lines · Elliott Mitchell
Hopefully I'm not making knave speculation here. Might this be the simplest of issues, just it was missed due to being too obvious?
I don't agree with your analysis, see above.
Okay. I was asking since it looked a bit odd and there has been no news on this issue (unless I missed some patch flying by).
I don't know how large the impact of this is. I wouldn't be surprised if this turned out to overwhelm all my other efforts at performance improvement.
Quoted 7 lines
Quoted 1 line
Any news on your efforts to track this down?
ENOTIME up to now.
Did you try to set the spurious threshold to e.g. 2 instead of the default of 1? In case that helps it might be a good idea to either change the default or to at least add a boot parameter for setting the default.
Appears it may somewhat, but not fully alleviate the situation.
Just to make sure this is stated. The spurious events are being observed on the back-ends of block and network devices. The corresponding front-ends aren't recording any spurious events.
I now wonder whether the network back-end I'm attempting to place in a DomU will observe spurious events.
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445