[Hyper-V] Fix ring buffer handling to avoid host throttling
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Xenial |
Fix Released
|
Medium
|
Unassigned | ||
Yakkety |
Fix Released
|
Medium
|
Unassigned | ||
Zesty |
Fix Committed
|
Medium
|
Unassigned |
Bug Description
An unfortunate side effect of some of the recent work done to improve ring buffer performance made a situation where the host would interpret guest requests as a denial of service attack, pausing guest communications for five seconds. This series of fixes corrects this problem.
Needed for each kernel that has included a389fcfd2cb5 ("Drivers: hv: vmbus: Fix signaling logic in hv_need_
Drivers: hv: vmbus: Base host signaling strictly on the ring state
One of the factors that can result in the host concluding that a given
guest in mounting a DOS attack is if the guest generates interrupts
to the host when the host is not expecting it. If these "spurious"
interrupts reach a certain rate, the host can throttle the guest to
minimize the impact. The host computation of the "expected number
of interrupts" is strictly based on the ring transitions. Until
the host logic is fixed, base the guest logic to interrupt solely
on the ring state.
Drivers: hv: vmbus: On write cleanup the logic to interrupt the host
Signal the host when we determine the host is to be signaled.
The currrent code determines the need to signal in the ringbuffer
code and actually issues the signal elsewhere. This can result
in the host viewing this interrupt as spurious since the host may also
poll the channel. Make the necessary adjustments.
Drivers: hv: vmbus: On the read path cleanup the logic to interrupt the host
Signal the host when we determine the host is to be signaled -
on th read path. The currrent code determines the need to signal in the
ringbuffer code and actually issues the signal elsewhere. This can result
in the host viewing this interrupt as spurious since the host may also
poll the channel. Make the necessary adjustments.
Drivers: hv: vmbus: finally fix hv_need_
Commit a389fcfd2cb5 ("Drivers: hv: vmbus: Fix signaling logic in
hv_need_
added the proper mb(), but removed the test "prev_write_sz < pending_sz"
when making the signal decision.
As a result, the guest can signal the host unnecessarily,
and then the host can throttle the guest because the host
thinks the guest is buggy or malicious; finally the user
running stress test can perceive intermittent freeze of
the guest.
This patch brings back the test, and properly handles the
in-place consumption APIs used by NetVSC (see get_next_pkt_raw(),
put_pkt_raw() and commit_rd_index()).
Fixes: a389fcfd2cb5 ("Drivers: hv: vmbus: Fix signaling logic in
hv_need_
Changed in linux (Ubuntu Xenial): | |
importance: | Undecided → Medium |
Changed in linux (Ubuntu Yakkety): | |
importance: | Undecided → Medium |
Changed in linux (Ubuntu Zesty): | |
importance: | Undecided → Medium |
tags: | added: kernel-da-key kernel-hyper-v |
Changed in linux (Ubuntu Xenial): | |
status: | In Progress → Fix Committed |
Changed in linux (Ubuntu Yakkety): | |
status: | In Progress → Fix Committed |
tags: |
added: verification-done-xenial removed: verification-needed-xenial |
Changed in linux (Ubuntu): | |
status: | Fix Committed → Fix Released |
Changed in linux (Ubuntu): | |
assignee: | Tim Gardner (timg-tpi) → nobody |
Changed in linux (Ubuntu Xenial): | |
assignee: | Tim Gardner (timg-tpi) → nobody |
Changed in linux (Ubuntu Yakkety): | |
assignee: | Tim Gardner (timg-tpi) → nobody |
Changed in linux (Ubuntu Zesty): | |
assignee: | Tim Gardner (timg-tpi) → nobody |
This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:
apport-collect 1661430
and then change the status of the bug to 'Confirmed'.
If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.
This change has been made by an automated script, maintained by the Ubuntu Kernel Team.