diff options
author | Anish Moorthy <[email protected]> | 2024-02-15 23:54:03 +0000 |
---|---|---|
committer | Sean Christopherson <[email protected]> | 2024-04-09 14:30:14 -0700 |
commit | 0cba6442e9e2dfabea042b899c99f5bfda5ab582 (patch) | |
tree | bc3eef423ca61cd4b116fd8eca8f0cd9bfb7af77 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | df4ec5aada9da30486d5464f34ffc80acd0373d6 (diff) |
KVM: selftests: Use EPOLL in userfaultfd_util reader threads
With multiple reader threads POLLing a single UFFD, the demand paging test
suffers from the thundering herd problem: performance degrades as the
number of reader threads is increased. Solve this issue [1] by switching
the the polling mechanism to EPOLL + EPOLLEXCLUSIVE.
Also, change the error-handling convention of uffd_handler_thread_fn.
Instead of just printing errors and returning early from the polling
loop, check for them via TEST_ASSERT(). "return NULL" is reserved for a
successful exit from uffd_handler_thread_fn, i.e. one triggered by a
write to the exit pipe.
Performance samples generated by the command in [2] are given below.
Num Reader Threads, Paging Rate (POLL), Paging Rate (EPOLL)
1 249k 185k
2 201k 235k
4 186k 155k
16 150k 217k
32 89k 198k
[1] Single-vCPU performance does suffer somewhat.
[2] ./demand_paging_test -u MINOR -s shmem -v 4 -o -r <num readers>
Signed-off-by: Anish Moorthy <[email protected]>
Acked-by: James Houghton <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sean Christopherson <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions