diff options
author | Anish Moorthy <amoorthy@google.com> | 2024-02-16 02:54:03 +0300 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2024-04-10 00:30:14 +0300 |
commit | 0cba6442e9e2dfabea042b899c99f5bfda5ab582 (patch) | |
tree | bc3eef423ca61cd4b116fd8eca8f0cd9bfb7af77 /tools/perf/scripts/python/task-analyzer.py | |
parent | df4ec5aada9da30486d5464f34ffc80acd0373d6 (diff) | |
download | linux-0cba6442e9e2dfabea042b899c99f5bfda5ab582.tar.xz |
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 <amoorthy@google.com>
Acked-by: James Houghton <jthoughton@google.com>
Link: https://lore.kernel.org/r/20240215235405.368539-13-amoorthy@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions