From: "Denis V. Lunev" <den@openvz.org>
To: qemu-block@nongnu.org, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Fam Zheng <fam@euphon.net>,
Juan Quintela <quintela@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
Max Reitz <mreitz@redhat.com>,
Denis Plotnikov <dplotnikov@virtuozzo.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
"Denis V. Lunev" <den@openvz.org>
Subject: [PATCH 2/6] block/aio_task: drop aio_task_pool_wait_one() helper
Date: Thu, 9 Jul 2020 16:26:40 +0300 [thread overview]
Message-ID: <20200709132644.28470-3-den@openvz.org> (raw)
In-Reply-To: <20200709132644.28470-1-den@openvz.org>
It is not used outside the module.
Actually there are 2 kind of waiters:
- for a slot and
- for all tasks to finish
This patch limits external API to listed types.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Suggested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
CC: Kevin Wolf <kwolf@redhat.com>
CC: Max Reitz <mreitz@redhat.com>
CC: Stefan Hajnoczi <stefanha@redhat.com>
CC: Fam Zheng <fam@euphon.net>
CC: Juan Quintela <quintela@redhat.com>
CC: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
CC: Denis Plotnikov <dplotnikov@virtuozzo.com>
---
block/aio_task.c | 13 ++-----------
include/block/aio_task.h | 1 -
2 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/block/aio_task.c b/block/aio_task.c
index cf62e5c58b..7ba15ff41f 100644
--- a/block/aio_task.c
+++ b/block/aio_task.c
@@ -54,26 +54,17 @@ static void coroutine_fn aio_task_co(void *opaque)
qemu_co_queue_restart_all(&pool->waiters);
}
-void coroutine_fn aio_task_pool_wait_one(AioTaskPool *pool)
-{
- assert(pool->busy_tasks > 0);
-
- qemu_co_queue_wait(&pool->waiters, NULL);
-
- assert(pool->busy_tasks < pool->max_busy_tasks);
-}
-
void coroutine_fn aio_task_pool_wait_slot(AioTaskPool *pool)
{
while (pool->busy_tasks >= pool->max_busy_tasks) {
- aio_task_pool_wait_one(pool);
+ qemu_co_queue_wait(&pool->waiters, NULL);
}
}
void coroutine_fn aio_task_pool_wait_all(AioTaskPool *pool)
{
while (pool->busy_tasks > 0) {
- aio_task_pool_wait_one(pool);
+ qemu_co_queue_wait(&pool->waiters, NULL);
}
}
diff --git a/include/block/aio_task.h b/include/block/aio_task.h
index 50bc1e1817..50b1c036c5 100644
--- a/include/block/aio_task.h
+++ b/include/block/aio_task.h
@@ -48,7 +48,6 @@ bool aio_task_pool_empty(AioTaskPool *pool);
void coroutine_fn aio_task_pool_start_task(AioTaskPool *pool, AioTask *task);
void coroutine_fn aio_task_pool_wait_slot(AioTaskPool *pool);
-void coroutine_fn aio_task_pool_wait_one(AioTaskPool *pool);
void coroutine_fn aio_task_pool_wait_all(AioTaskPool *pool);
#endif /* BLOCK_AIO_TASK_H */
--
2.17.1
next prev parent reply other threads:[~2020-07-09 13:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-09 13:26 [PATCH v8 0/6] block: seriously improve savevm/loadvm performance Denis V. Lunev
2020-07-09 13:26 ` [PATCH 1/6] block/aio_task: allow start/wait task from any coroutine Denis V. Lunev
2020-07-09 13:26 ` Denis V. Lunev [this message]
2020-07-09 13:26 ` [PATCH 3/6] block/block-backend: remove always true check from blk_save_vmstate Denis V. Lunev
2020-07-09 13:26 ` [PATCH 4/6] block, migration: add bdrv_finalize_vmstate helper Denis V. Lunev
2020-08-27 12:58 ` Daniel P. Berrangé
2020-08-27 13:02 ` Denis V. Lunev
2020-08-27 13:06 ` Daniel P. Berrangé
2020-08-28 6:13 ` Markus Armbruster
2020-07-09 13:26 ` [PATCH 5/6] block/io: improve savevm performance Denis V. Lunev
2020-07-09 13:26 ` [PATCH 6/6] block/io: improve loadvm performance Denis V. Lunev
2020-07-10 14:40 ` Vladimir Sementsov-Ogievskiy
2020-08-20 7:42 ` [PATCH v8 0/6] block: seriously improve savevm/loadvm performance Denis V. Lunev
2020-08-27 12:41 ` Denis V. Lunev
2020-09-14 13:13 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200709132644.28470-3-den@openvz.org \
--to=den@openvz.org \
--cc=dgilbert@redhat.com \
--cc=dplotnikov@virtuozzo.com \
--cc=fam@euphon.net \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).