40 lines
1.4 KiB
Diff
40 lines
1.4 KiB
Diff
|
|
From 274dd10230eef97714a2a283ecd8a8ce2ecbf687 Mon Sep 17 00:00:00 2001
|
||
|
|
From: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
||
|
|
Date: Mon, 6 Nov 2023 07:28:31 +0000
|
||
|
|
Subject: [PATCH] qemu-timer: Skip empty timer lists before locking in
|
||
|
|
qemu_clock_deadline_ns_all mainline inclusion commit
|
||
|
|
3f42906c9ab2c777a895b48b87b8107167e4a275 category: bugfix
|
||
|
|
|
||
|
|
---------------------------------------------------------------
|
||
|
|
|
||
|
|
This decreases qemu_clock_deadline_ns_all's share from 23.2% to 13% in a
|
||
|
|
profile of icount-enabled aarch64-softmmu.
|
||
|
|
|
||
|
|
Signed-off-by: Idan Horowitz <idan.horowitz@gmail.com>
|
||
|
|
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
|
||
|
|
Message-Id: <20220114004358.299534-2-idan.horowitz@gmail.com>
|
||
|
|
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
|
||
|
|
|
||
|
|
Signed-off-by: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
||
|
|
---
|
||
|
|
util/qemu-timer.c | 3 +++
|
||
|
|
1 file changed, 3 insertions(+)
|
||
|
|
|
||
|
|
diff --git a/util/qemu-timer.c b/util/qemu-timer.c
|
||
|
|
index 40e8c83722..c5b6dc987c 100644
|
||
|
|
--- a/util/qemu-timer.c
|
||
|
|
+++ b/util/qemu-timer.c
|
||
|
|
@@ -330,6 +330,9 @@ int64_t qemu_clock_deadline_ns_all(QEMUClockType type, int attr_mask)
|
||
|
|
}
|
||
|
|
|
||
|
|
QLIST_FOREACH(timer_list, &clock->timerlists, list) {
|
||
|
|
+ if (!qatomic_read(&timer_list->active_timers)) {
|
||
|
|
+ continue;
|
||
|
|
+ }
|
||
|
|
qemu_mutex_lock(&timer_list->active_timers_lock);
|
||
|
|
ts = timer_list->active_timers;
|
||
|
|
/* Skip all external timers */
|
||
|
|
--
|
||
|
|
2.27.0
|
||
|
|
|