Lines Matching +full:- +full:- +full:disable +full:- +full:vhost +full:- +full:user
11 * See the COPYING.LIB file in the top-level directory.
20 #include "qemu/coroutine-tls.h"
40 * .-----------------------------------.
42 * `-----------------------------------'
44 * .-------------------.
45 * | Batch 1 | Batch 2 | per-thread local_pool (maximum 2 batches)
46 * `-------------------'
74 QSLIST_INIT(&batch->list); in coroutine_pool_batch_new()
75 batch->size = 0; in coroutine_pool_batch_new()
84 QSLIST_FOREACH_SAFE(co, &batch->list, pool_next, tmp) { in coroutine_pool_batch_delete()
85 QSLIST_REMOVE_HEAD(&batch->list, pool_next); in coroutine_pool_batch_delete()
107 if (!notifier->notify) { in local_pool_cleanup_init_once()
108 notifier->notify = local_pool_cleanup; in local_pool_cleanup_init_once()
124 co = QSLIST_FIRST(&batch->list); in coroutine_pool_get_local()
125 QSLIST_REMOVE_HEAD(&batch->list, pool_next); in coroutine_pool_get_local()
126 batch->size--; in coroutine_pool_get_local()
128 if (batch->size == 0) { in coroutine_pool_get_local()
146 global_pool_size -= batch->size; in coroutine_pool_refill_local()
167 global_pool_size += batch->size; in coroutine_pool_put_global()
200 if (unlikely(batch->size >= COROUTINE_POOL_BATCH_MAX_SIZE)) { in coroutine_pool_put()
213 QSLIST_INSERT_HEAD(&batch->list, co, pool_next); in coroutine_pool_put()
214 batch->size++; in coroutine_pool_put()
229 co->entry = entry; in qemu_coroutine_create()
230 co->entry_arg = opaque; in qemu_coroutine_create()
231 QSIMPLEQ_INIT(&co->co_queue_wakeup); in qemu_coroutine_create()
237 co->caller = NULL; in coroutine_delete()
259 * Read to before to->scheduled; pairs with qatomic_cmpxchg in in qemu_aio_coroutine_enter()
264 const char *scheduled = qatomic_read(&to->scheduled); in qemu_aio_coroutine_enter()
268 trace_qemu_aio_coroutine_enter(ctx, from, to, to->entry_arg); in qemu_aio_coroutine_enter()
275 "%s: Co-routine was already scheduled in '%s'\n", in qemu_aio_coroutine_enter()
280 if (to->caller) { in qemu_aio_coroutine_enter()
281 fprintf(stderr, "Co-routine re-entered recursively\n"); in qemu_aio_coroutine_enter()
285 to->caller = from; in qemu_aio_coroutine_enter()
286 to->ctx = ctx; in qemu_aio_coroutine_enter()
288 /* Store to->ctx before anything that stores to. Matches in qemu_aio_coroutine_enter()
295 /* Queued coroutines are run depth-first; previously pending coroutines in qemu_aio_coroutine_enter()
298 QSIMPLEQ_PREPEND(&pending, &to->co_queue_wakeup); in qemu_aio_coroutine_enter()
304 assert(!to->locks_held); in qemu_aio_coroutine_enter()
329 Coroutine *to = self->caller; in qemu_coroutine_yield()
334 fprintf(stderr, "Co-routine is yielding to no one\n"); in qemu_coroutine_yield()
338 self->caller = NULL; in qemu_coroutine_yield()
344 return co->caller; in qemu_coroutine_entered()
349 return co->ctx; in qemu_coroutine_get_aio_context()
361 global_pool_max_size -= removing_pool_size; in qemu_coroutine_dec_pool_size()
381 * fixed amount for non-coroutine users like library dependencies, in get_global_pool_hard_max_size()
382 * vhost-user, etc. Each coroutine takes up 2 VMAs so halve the in get_global_pool_hard_max_size()
386 return (max_map_count - 5000) / 2; in get_global_pool_hard_max_size()
388 /* Disable the global pool but threads still have local pools */ in get_global_pool_hard_max_size()