Skip to content

Conversation

@edwintorok
Copy link
Contributor

@edwintorok edwintorok commented Aug 1, 2025

Low memory monitoring and CPU usage monitoring are used for different purposes: if we fail to initialize one, we should still try to initialize the other.

Low memory monitoring is used to reduce queue depth / buffers allocated when we have a lot of disks attached on the same host.

CPU usage monitoring is used to determine when it is safe to enter busy polling mode: when Dom0 is already under high load then we don't enter busy polling mode to allow other processes to use the CPU. If CPU usage monitoring is not initialized then tapdisk never enter polling mode, which reduces guest I/O performance.

Low memory monitoring currently fails to initialize with a newer kernel CA-400404, which exposed this latent performance bug in tapdisk. We should fix lowmem mode, but for now fix the performance bug.

After this change tapdisk now correctly enters polling mode. There is a separate bug that it won't stay in polling mode long enough, but that'll be fixed in a separate PR.

@edwintorok edwintorok requested a review from MarkSymsCtx August 1, 2025 16:05
@edwintorok
Copy link
Contributor Author

This also requires xapi-project/xen-api#6611 (otherwise this PR on its own slows down tapdisk instead of speeding it up)

Low memory monitoring and CPU usage monitoring are used for different
purposes: if we fail to initialize one, we should still try to
initialize the other.

Low memory monitoring is used to reduce queue depth / buffers allocated
when we have a lot of disks attached on the same host.

CPU usage monitoring is used to determine when it is safe to enter
busy polling mode: when Dom0 is already under high load then we don't enter
busy polling mode to allow other processes to use the CPU.
If CPU usage monitoring is not initialized then tapdisk never enter
polling mode, which reduces guest I/O performance.

Low memory monitoring currently fails to initialize with a newer kernel CA-400404,
which exposed this latent performance bug in tapdisk.

After this change tapdisk now correctly enters polling mode.
There is a separate bug that it won't stay in polling mode long enough,
but that'll be fixed in a separate PR.

Signed-off-by: Edwin Török <[email protected]>
@edwintorok edwintorok force-pushed the private/edvint/polling branch from afe9d08 to 48ea893 Compare August 1, 2025 17:03
@edwintorok
Copy link
Contributor Author

Had to delete the out: label, because GCC warned that it was unused, and some warnings are treated as errors in the build.

@MarkSymsCtx MarkSymsCtx merged commit fb80aa7 into xapi-project:master Aug 4, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants