aboutsummaryrefslogtreecommitdiff
path: root/trace-events
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2016-12-01 19:26:51 +0000
committerStefan Hajnoczi <stefanha@redhat.com>2017-01-03 16:38:50 +0000
commit82a41186941c419afde977f477f19c545b40c1c5 (patch)
tree32d517c6b4b6454814fd54af17bc0b5f7f0ed82c /trace-events
parenta7c8215e3bbcdd3b5dbaabfcecf236d4a9880558 (diff)
downloadqemu-82a41186941c419afde977f477f19c545b40c1c5.zip
qemu-82a41186941c419afde977f477f19c545b40c1c5.tar.gz
qemu-82a41186941c419afde977f477f19c545b40c1c5.tar.bz2
aio: self-tune polling time
This patch is based on the algorithm for the kvm.ko halt_poll_ns parameter in Linux. The initial polling time is zero. If the event loop is woken up within the maximum polling time it means polling could be effective, so grow polling time. If the event loop is woken up beyond the maximum polling time it means polling is not effective, so shrink polling time. If the event loop makes progress within the current polling time then the sweet spot has been reached. This algorithm adjusts the polling time so it can adapt to variations in workloads. The goal is to reach the sweet spot while also recognizing when polling would hurt more than help. Two new trace events, poll_grow and poll_shrink, are added for observing polling time adjustment. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 20161201192652.9509-13-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'trace-events')
-rw-r--r--trace-events2
1 files changed, 2 insertions, 0 deletions
diff --git a/trace-events b/trace-events
index 7fe3a1b..1181486 100644
--- a/trace-events
+++ b/trace-events
@@ -28,6 +28,8 @@
# aio-posix.c
run_poll_handlers_begin(void *ctx, int64_t max_ns) "ctx %p max_ns %"PRId64
run_poll_handlers_end(void *ctx, bool progress) "ctx %p progress %d"
+poll_shrink(void *ctx, int64_t old, int64_t new) "ctx %p old %"PRId64" new %"PRId64
+poll_grow(void *ctx, int64_t old, int64_t new) "ctx %p old %"PRId64" new %"PRId64
# thread-pool.c
thread_pool_submit(void *pool, void *req, void *opaque) "pool %p req %p opaque %p"