Lines Matching refs:context

84     MemsetContext *context;  member
347 while (!memset_args->context->all_threads_created) { in do_touch_pages()
390 while (!memset_args->context->all_threads_created) { in do_madv_populate_write_pages()
420 static int wait_and_free_mem_prealloc_context(MemsetContext *context) in wait_and_free_mem_prealloc_context() argument
424 for (i = 0; i < context->num_threads; i++) { in wait_and_free_mem_prealloc_context()
425 tmp = (uintptr_t)qemu_thread_join(&context->threads[i].pgthread); in wait_and_free_mem_prealloc_context()
431 g_free(context->threads); in wait_and_free_mem_prealloc_context()
432 g_free(context); in wait_and_free_mem_prealloc_context()
441 MemsetContext *context = g_malloc0(sizeof(MemsetContext)); in touch_all_pages() local
455 context->num_threads = in touch_all_pages()
469 if (context->num_threads == 1 && !async) { in touch_all_pages()
475 g_free(context); in touch_all_pages()
483 context->threads = g_new0(MemsetThread, context->num_threads); in touch_all_pages()
484 numpages_per_thread = numpages / context->num_threads; in touch_all_pages()
485 leftover = numpages % context->num_threads; in touch_all_pages()
486 for (i = 0; i < context->num_threads; i++) { in touch_all_pages()
487 context->threads[i].addr = addr; in touch_all_pages()
488 context->threads[i].numpages = numpages_per_thread + (i < leftover); in touch_all_pages()
489 context->threads[i].hpagesize = hpagesize; in touch_all_pages()
490 context->threads[i].context = context; in touch_all_pages()
492 thread_context_create_thread(tc, &context->threads[i].pgthread, in touch_all_pages()
494 touch_fn, &context->threads[i], in touch_all_pages()
497 qemu_thread_create(&context->threads[i].pgthread, "touch_pages", in touch_all_pages()
498 touch_fn, &context->threads[i], in touch_all_pages()
501 addr += context->threads[i].numpages * hpagesize; in touch_all_pages()
510 QLIST_INSERT_HEAD(&memset_contexts, context, next); in touch_all_pages()
515 sigbus_memset_context = context; in touch_all_pages()
519 context->all_threads_created = true; in touch_all_pages()
523 ret = wait_and_free_mem_prealloc_context(context); in touch_all_pages()
534 MemsetContext *context, *next_context; in qemu_finish_async_prealloc_mem() local
543 QLIST_FOREACH(context, &memset_contexts, next) { in qemu_finish_async_prealloc_mem()
544 context->all_threads_created = true; in qemu_finish_async_prealloc_mem()
549 QLIST_FOREACH_SAFE(context, &memset_contexts, next, next_context) { in qemu_finish_async_prealloc_mem()
550 QLIST_REMOVE(context, next); in qemu_finish_async_prealloc_mem()
551 tmp = wait_and_free_mem_prealloc_context(context); in qemu_finish_async_prealloc_mem()