[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 5/9] qemu-timer: Skip empty timer lists before locking in qemu_clo
From: |
Richard Henderson |
Subject: |
[PULL 5/9] qemu-timer: Skip empty timer lists before locking in qemu_clock_deadline_ns_all |
Date: |
Tue, 21 Jun 2022 13:46:39 -0700 |
From: Idan Horowitz <idan.horowitz@gmail.com>
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>
---
util/qemu-timer.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/util/qemu-timer.c b/util/qemu-timer.c
index a670a57881..6a0de33dd2 100644
--- a/util/qemu-timer.c
+++ b/util/qemu-timer.c
@@ -261,6 +261,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.34.1
- [PULL 0/9] tcg patch queue for 2022-06-21, Richard Henderson, 2022/06/21
- [PULL 6/9] softmmu: Always initialize xlat in address_space_translate_for_iotlb, Richard Henderson, 2022/06/21
- [PULL 4/9] accel/tcg: Reorganize tcg_accel_ops_init(), Richard Henderson, 2022/06/21
- [PULL 8/9] util/cacheflush: Merge aarch64 ctr_el0 usage, Richard Henderson, 2022/06/21
- [PULL 5/9] qemu-timer: Skip empty timer lists before locking in qemu_clock_deadline_ns_all,
Richard Henderson <=
- [PULL 2/9] target/avr: Drop avr_cpu_memory_rw_debug(), Richard Henderson, 2022/06/21
- [PULL 1/9] tcg/ppc: implement rem[u]_i{32,64} with mod[su][wd], Richard Henderson, 2022/06/21
- [PULL 7/9] util: Merge cacheflush.c and cacheinfo.c, Richard Henderson, 2022/06/21
- [PULL 9/9] util/cacheflush: Optimize flushing when ppc host has coherent icache, Richard Henderson, 2022/06/21
- [PULL 3/9] accel/tcg: Init TCG cflags in vCPU thread handler, Richard Henderson, 2022/06/21
- Re: [PULL 0/9] tcg patch queue for 2022-06-21, Richard Henderson, 2022/06/21