[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 05/17] util/thread-pool: Convert to new bh API
From: |
Nicholas Piggin |
Subject: |
[PATCH 05/17] util/thread-pool: Convert to new bh API |
Date: |
Fri, 20 Dec 2024 20:42:07 +1000 |
Convert qemu_bh_schedule() to qemu_bh_schedule_event(), which can
specify the clock type, making it compatible with record-replay.
The thread pool management does not affect target machine state,
so it should use QEMU_CLOCK_REALTIME so it is not recorded and
replayed.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
util/thread-pool.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/util/thread-pool.c b/util/thread-pool.c
index 27eb777e855..010eb4ad9a6 100644
--- a/util/thread-pool.c
+++ b/util/thread-pool.c
@@ -115,7 +115,7 @@ static void *worker_thread(void *opaque)
smp_wmb();
req->state = THREAD_DONE;
- qemu_bh_schedule(pool->completion_bh);
+ qemu_bh_schedule_event(pool->completion_bh, QEMU_CLOCK_REALTIME);
qemu_mutex_lock(&pool->lock);
}
@@ -167,7 +167,7 @@ static void spawn_thread(ThreadPool *pool)
* inherit the correct affinity instead of the vcpu affinity.
*/
if (!pool->pending_threads) {
- qemu_bh_schedule(pool->new_thread_bh);
+ qemu_bh_schedule_event(pool->new_thread_bh, QEMU_CLOCK_REALTIME);
}
}
@@ -195,7 +195,7 @@ restart:
/* Schedule ourselves in case elem->common.cb() calls aio_poll() to
* wait for another request that completed at the same time.
*/
- qemu_bh_schedule(pool->completion_bh);
+ qemu_bh_schedule_event(pool->completion_bh, QEMU_CLOCK_REALTIME);
elem->common.cb(elem->common.opaque, elem->ret);
@@ -225,7 +225,7 @@ static void thread_pool_cancel(BlockAIOCB *acb)
QEMU_LOCK_GUARD(&pool->lock);
if (elem->state == THREAD_QUEUED) {
QTAILQ_REMOVE(&pool->request_list, elem, reqs);
- qemu_bh_schedule(pool->completion_bh);
+ qemu_bh_schedule_event(pool->completion_bh, QEMU_CLOCK_REALTIME);
elem->state = THREAD_DONE;
elem->ret = -ECANCELED;
--
2.45.2
- [PATCH 01/17] replay: Fix migration use of clock for statistics, (continued)
[PATCH 02/17] replay: Fix migration replay_mutex locking, Nicholas Piggin, 2024/12/20
[PATCH 03/17] async: rework async event API for replay, Nicholas Piggin, 2024/12/20
[PATCH 04/17] util/main-loop: Convert to new bh API, Nicholas Piggin, 2024/12/20
[PATCH 05/17] util/thread-pool: Convert to new bh API,
Nicholas Piggin <=
[PATCH 06/17] util/aio-wait: Convert to new bh API, Nicholas Piggin, 2024/12/20
[PATCH 07/17] async/coroutine: Convert to new bh API, Nicholas Piggin, 2024/12/20
[PATCH 08/17] migration: Convert to new bh API, Nicholas Piggin, 2024/12/20
[PATCH 09/17] monitor: Convert to new bh API, Nicholas Piggin, 2024/12/20
[PATCH 10/17] qmp: Convert to new bh API, Nicholas Piggin, 2024/12/20
[PATCH 11/17] block: Convert to new bh API, Nicholas Piggin, 2024/12/20
[PATCH 12/17] hw/ide: Fix record-replay and convert to new bh API, Nicholas Piggin, 2024/12/20
[PATCH 13/17] hw/scsi: Convert to new bh API, Nicholas Piggin, 2024/12/20