All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 0/1] Block patches
@ 2024-03-19 15:09 Stefan Hajnoczi
  2024-03-19 15:09 ` [PULL 1/1] coroutine: cap per-thread local pool size Stefan Hajnoczi
  2024-03-19 19:11 ` [PULL 0/1] Block patches Peter Maydell
  0 siblings, 2 replies; 40+ messages in thread
From: Stefan Hajnoczi @ 2024-03-19 15:09 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, qemu-block, Kevin Wolf, Stefan Hajnoczi,
	Peter Maydell, Hanna Reitz

The following changes since commit ddc27d2ad9361a81c2b3800d14143bf420dae172:

  Merge tag 'pull-request-2024-03-18' of https://gitlab.com/thuth/qemu into staging (2024-03-19 10:25:25 +0000)

are available in the Git repository at:

  https://gitlab.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to 86a637e48104ae74d8be53bed6441ce32be33433:

  coroutine: cap per-thread local pool size (2024-03-19 10:49:31 -0400)

----------------------------------------------------------------
Pull request

This fix solves the "failed to set up stack guard page" error that has been
reported on Linux hosts where the QEMU coroutine pool exceeds the
vm.max_map_count limit.

----------------------------------------------------------------

Stefan Hajnoczi (1):
  coroutine: cap per-thread local pool size

 util/qemu-coroutine.c | 282 +++++++++++++++++++++++++++++++++---------
 1 file changed, 223 insertions(+), 59 deletions(-)

-- 
2.44.0



^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PULL 1/1] coroutine: cap per-thread local pool size
  2024-03-19 15:09 [PULL 0/1] Block patches Stefan Hajnoczi
@ 2024-03-19 15:09 ` Stefan Hajnoczi
  2024-03-19 15:14   ` Daniel P. Berrangé
  2024-03-19 19:11 ` [PULL 0/1] Block patches Peter Maydell
  1 sibling, 1 reply; 40+ messages in thread
From: Stefan Hajnoczi @ 2024-03-19 15:09 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, qemu-block, Kevin Wolf, Stefan Hajnoczi,
	Peter Maydell, Hanna Reitz, Sanjay Rao, Boaz Ben Shabat,
	Joe Mario

The coroutine pool implementation can hit the Linux vm.max_map_count
limit, causing QEMU to abort with "failed to allocate memory for stack"
or "failed to set up stack guard page" during coroutine creation.

This happens because per-thread pools can grow to tens of thousands of
coroutines. Each coroutine causes 2 virtual memory areas to be created.
Eventually vm.max_map_count is reached and memory-related syscalls fail.
The per-thread pool sizes are non-uniform and depend on past coroutine
usage in each thread, so it's possible for one thread to have a large
pool while another thread's pool is empty.

Switch to a new coroutine pool implementation with a global pool that
grows to a maximum number of coroutines and per-thread local pools that
are capped at hardcoded small number of coroutines.

This approach does not leave large numbers of coroutines pooled in a
thread that may not use them again. In order to perform well it
amortizes the cost of global pool accesses by working in batches of
coroutines instead of individual coroutines.

The global pool is a list. Threads donate batches of coroutines to when
they have too many and take batches from when they have too few:

.-----------------------------------.
| Batch 1 | Batch 2 | Batch 3 | ... | global_pool
`-----------------------------------'

Each thread has up to 2 batches of coroutines:

.-------------------.
| Batch 1 | Batch 2 | per-thread local_pool (maximum 2 batches)
`-------------------'

The goal of this change is to reduce the excessive number of pooled
coroutines that cause QEMU to abort when vm.max_map_count is reached
without losing the performance of an adequately sized coroutine pool.

Here are virtio-blk disk I/O benchmark results:

      RW BLKSIZE IODEPTH    OLD    NEW CHANGE
randread      4k       1 113725 117451 +3.3%
randread      4k       8 192968 198510 +2.9%
randread      4k      16 207138 209429 +1.1%
randread      4k      32 212399 215145 +1.3%
randread      4k      64 218319 221277 +1.4%
randread    128k       1  17587  17535 -0.3%
randread    128k       8  17614  17616 +0.0%
randread    128k      16  17608  17609 +0.0%
randread    128k      32  17552  17553 +0.0%
randread    128k      64  17484  17484 +0.0%

See files/{fio.sh,test.xml.j2} for the benchmark configuration:
https://gitlab.com/stefanha/virt-playbooks/-/tree/coroutine-pool-fix-sizing

Buglink: https://issues.redhat.com/browse/RHEL-28947
Reported-by: Sanjay Rao <srao@redhat.com>
Reported-by: Boaz Ben Shabat <bbenshab@redhat.com>
Reported-by: Joe Mario <jmario@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20240318183429.1039340-1-stefanha@redhat.com>
---
 util/qemu-coroutine.c | 282 +++++++++++++++++++++++++++++++++---------
 1 file changed, 223 insertions(+), 59 deletions(-)

diff --git a/util/qemu-coroutine.c b/util/qemu-coroutine.c
index 5fd2dbaf8b..2790959eaf 100644
--- a/util/qemu-coroutine.c
+++ b/util/qemu-coroutine.c
@@ -18,39 +18,200 @@
 #include "qemu/atomic.h"
 #include "qemu/coroutine_int.h"
 #include "qemu/coroutine-tls.h"
+#include "qemu/cutils.h"
 #include "block/aio.h"
 
-/**
- * The minimal batch size is always 64, coroutines from the release_pool are
- * reused as soon as there are 64 coroutines in it. The maximum pool size starts
- * with 64 and is increased on demand so that coroutines are not deleted even if
- * they are not immediately reused.
- */
 enum {
-    POOL_MIN_BATCH_SIZE = 64,
-    POOL_INITIAL_MAX_SIZE = 64,
+    COROUTINE_POOL_BATCH_MAX_SIZE = 128,
 };
 
-/** Free list to speed up creation */
-static QSLIST_HEAD(, Coroutine) release_pool = QSLIST_HEAD_INITIALIZER(pool);
-static unsigned int pool_max_size = POOL_INITIAL_MAX_SIZE;
-static unsigned int release_pool_size;
+/*
+ * Coroutine creation and deletion is expensive so a pool of unused coroutines
+ * is kept as a cache. When the pool has coroutines available, they are
+ * recycled instead of creating new ones from scratch. Coroutines are added to
+ * the pool upon termination.
+ *
+ * The pool is global but each thread maintains a small local pool to avoid
+ * global pool contention. Threads fetch and return batches of coroutines from
+ * the global pool to maintain their local pool. The local pool holds up to two
+ * batches whereas the maximum size of the global pool is controlled by the
+ * qemu_coroutine_inc_pool_size() API.
+ *
+ * .-----------------------------------.
+ * | Batch 1 | Batch 2 | Batch 3 | ... | global_pool
+ * `-----------------------------------'
+ *
+ * .-------------------.
+ * | Batch 1 | Batch 2 | per-thread local_pool (maximum 2 batches)
+ * `-------------------'
+ */
+typedef struct CoroutinePoolBatch {
+    /* Batches are kept in a list */
+    QSLIST_ENTRY(CoroutinePoolBatch) next;
 
-typedef QSLIST_HEAD(, Coroutine) CoroutineQSList;
-QEMU_DEFINE_STATIC_CO_TLS(CoroutineQSList, alloc_pool);
-QEMU_DEFINE_STATIC_CO_TLS(unsigned int, alloc_pool_size);
-QEMU_DEFINE_STATIC_CO_TLS(Notifier, coroutine_pool_cleanup_notifier);
+    /* This batch holds up to @COROUTINE_POOL_BATCH_MAX_SIZE coroutines */
+    QSLIST_HEAD(, Coroutine) list;
+    unsigned int size;
+} CoroutinePoolBatch;
 
-static void coroutine_pool_cleanup(Notifier *n, void *value)
+typedef QSLIST_HEAD(, CoroutinePoolBatch) CoroutinePool;
+
+/* Host operating system limit on number of pooled coroutines */
+static unsigned int global_pool_hard_max_size;
+
+static QemuMutex global_pool_lock; /* protects the following variables */
+static CoroutinePool global_pool = QSLIST_HEAD_INITIALIZER(global_pool);
+static unsigned int global_pool_size;
+static unsigned int global_pool_max_size = COROUTINE_POOL_BATCH_MAX_SIZE;
+
+QEMU_DEFINE_STATIC_CO_TLS(CoroutinePool, local_pool);
+QEMU_DEFINE_STATIC_CO_TLS(Notifier, local_pool_cleanup_notifier);
+
+static CoroutinePoolBatch *coroutine_pool_batch_new(void)
+{
+    CoroutinePoolBatch *batch = g_new(CoroutinePoolBatch, 1);
+
+    QSLIST_INIT(&batch->list);
+    batch->size = 0;
+    return batch;
+}
+
+static void coroutine_pool_batch_delete(CoroutinePoolBatch *batch)
 {
     Coroutine *co;
     Coroutine *tmp;
-    CoroutineQSList *alloc_pool = get_ptr_alloc_pool();
 
-    QSLIST_FOREACH_SAFE(co, alloc_pool, pool_next, tmp) {
-        QSLIST_REMOVE_HEAD(alloc_pool, pool_next);
+    QSLIST_FOREACH_SAFE(co, &batch->list, pool_next, tmp) {
+        QSLIST_REMOVE_HEAD(&batch->list, pool_next);
         qemu_coroutine_delete(co);
     }
+    g_free(batch);
+}
+
+static void local_pool_cleanup(Notifier *n, void *value)
+{
+    CoroutinePool *local_pool = get_ptr_local_pool();
+    CoroutinePoolBatch *batch;
+    CoroutinePoolBatch *tmp;
+
+    QSLIST_FOREACH_SAFE(batch, local_pool, next, tmp) {
+        QSLIST_REMOVE_HEAD(local_pool, next);
+        coroutine_pool_batch_delete(batch);
+    }
+}
+
+/* Ensure the atexit notifier is registered */
+static void local_pool_cleanup_init_once(void)
+{
+    Notifier *notifier = get_ptr_local_pool_cleanup_notifier();
+    if (!notifier->notify) {
+        notifier->notify = local_pool_cleanup;
+        qemu_thread_atexit_add(notifier);
+    }
+}
+
+/* Helper to get the next unused coroutine from the local pool */
+static Coroutine *coroutine_pool_get_local(void)
+{
+    CoroutinePool *local_pool = get_ptr_local_pool();
+    CoroutinePoolBatch *batch = QSLIST_FIRST(local_pool);
+    Coroutine *co;
+
+    if (unlikely(!batch)) {
+        return NULL;
+    }
+
+    co = QSLIST_FIRST(&batch->list);
+    QSLIST_REMOVE_HEAD(&batch->list, pool_next);
+    batch->size--;
+
+    if (batch->size == 0) {
+        QSLIST_REMOVE_HEAD(local_pool, next);
+        coroutine_pool_batch_delete(batch);
+    }
+    return co;
+}
+
+/* Get the next batch from the global pool */
+static void coroutine_pool_refill_local(void)
+{
+    CoroutinePool *local_pool = get_ptr_local_pool();
+    CoroutinePoolBatch *batch;
+
+    WITH_QEMU_LOCK_GUARD(&global_pool_lock) {
+        batch = QSLIST_FIRST(&global_pool);
+
+        if (batch) {
+            QSLIST_REMOVE_HEAD(&global_pool, next);
+            global_pool_size -= batch->size;
+        }
+    }
+
+    if (batch) {
+        QSLIST_INSERT_HEAD(local_pool, batch, next);
+        local_pool_cleanup_init_once();
+    }
+}
+
+/* Add a batch of coroutines to the global pool */
+static void coroutine_pool_put_global(CoroutinePoolBatch *batch)
+{
+    WITH_QEMU_LOCK_GUARD(&global_pool_lock) {
+        unsigned int max = MIN(global_pool_max_size,
+                               global_pool_hard_max_size);
+
+        if (global_pool_size < max) {
+            QSLIST_INSERT_HEAD(&global_pool, batch, next);
+
+            /* Overshooting the max pool size is allowed */
+            global_pool_size += batch->size;
+            return;
+        }
+    }
+
+    /* The global pool was full, so throw away this batch */
+    coroutine_pool_batch_delete(batch);
+}
+
+/* Get the next unused coroutine from the pool or return NULL */
+static Coroutine *coroutine_pool_get(void)
+{
+    Coroutine *co;
+
+    co = coroutine_pool_get_local();
+    if (!co) {
+        coroutine_pool_refill_local();
+        co = coroutine_pool_get_local();
+    }
+    return co;
+}
+
+static void coroutine_pool_put(Coroutine *co)
+{
+    CoroutinePool *local_pool = get_ptr_local_pool();
+    CoroutinePoolBatch *batch = QSLIST_FIRST(local_pool);
+
+    if (unlikely(!batch)) {
+        batch = coroutine_pool_batch_new();
+        QSLIST_INSERT_HEAD(local_pool, batch, next);
+        local_pool_cleanup_init_once();
+    }
+
+    if (unlikely(batch->size >= COROUTINE_POOL_BATCH_MAX_SIZE)) {
+        CoroutinePoolBatch *next = QSLIST_NEXT(batch, next);
+
+        /* Is the local pool full? */
+        if (next) {
+            QSLIST_REMOVE_HEAD(local_pool, next);
+            coroutine_pool_put_global(batch);
+        }
+
+        batch = coroutine_pool_batch_new();
+        QSLIST_INSERT_HEAD(local_pool, batch, next);
+    }
+
+    QSLIST_INSERT_HEAD(&batch->list, co, pool_next);
+    batch->size++;
 }
 
 Coroutine *qemu_coroutine_create(CoroutineEntry *entry, void *opaque)
@@ -58,31 +219,7 @@ Coroutine *qemu_coroutine_create(CoroutineEntry *entry, void *opaque)
     Coroutine *co = NULL;
 
     if (IS_ENABLED(CONFIG_COROUTINE_POOL)) {
-        CoroutineQSList *alloc_pool = get_ptr_alloc_pool();
-
-        co = QSLIST_FIRST(alloc_pool);
-        if (!co) {
-            if (release_pool_size > POOL_MIN_BATCH_SIZE) {
-                /* Slow path; a good place to register the destructor, too.  */
-                Notifier *notifier = get_ptr_coroutine_pool_cleanup_notifier();
-                if (!notifier->notify) {
-                    notifier->notify = coroutine_pool_cleanup;
-                    qemu_thread_atexit_add(notifier);
-                }
-
-                /* This is not exact; there could be a little skew between
-                 * release_pool_size and the actual size of release_pool.  But
-                 * it is just a heuristic, it does not need to be perfect.
-                 */
-                set_alloc_pool_size(qatomic_xchg(&release_pool_size, 0));
-                QSLIST_MOVE_ATOMIC(alloc_pool, &release_pool);
-                co = QSLIST_FIRST(alloc_pool);
-            }
-        }
-        if (co) {
-            QSLIST_REMOVE_HEAD(alloc_pool, pool_next);
-            set_alloc_pool_size(get_alloc_pool_size() - 1);
-        }
+        co = coroutine_pool_get();
     }
 
     if (!co) {
@@ -100,19 +237,10 @@ static void coroutine_delete(Coroutine *co)
     co->caller = NULL;
 
     if (IS_ENABLED(CONFIG_COROUTINE_POOL)) {
-        if (release_pool_size < qatomic_read(&pool_max_size) * 2) {
-            QSLIST_INSERT_HEAD_ATOMIC(&release_pool, co, pool_next);
-            qatomic_inc(&release_pool_size);
-            return;
-        }
-        if (get_alloc_pool_size() < qatomic_read(&pool_max_size)) {
-            QSLIST_INSERT_HEAD(get_ptr_alloc_pool(), co, pool_next);
-            set_alloc_pool_size(get_alloc_pool_size() + 1);
-            return;
-        }
+        coroutine_pool_put(co);
+    } else {
+        qemu_coroutine_delete(co);
     }
-
-    qemu_coroutine_delete(co);
 }
 
 void qemu_aio_coroutine_enter(AioContext *ctx, Coroutine *co)
@@ -223,10 +351,46 @@ AioContext *qemu_coroutine_get_aio_context(Coroutine *co)
 
 void qemu_coroutine_inc_pool_size(unsigned int additional_pool_size)
 {
-    qatomic_add(&pool_max_size, additional_pool_size);
+    QEMU_LOCK_GUARD(&global_pool_lock);
+    global_pool_max_size += additional_pool_size;
 }
 
 void qemu_coroutine_dec_pool_size(unsigned int removing_pool_size)
 {
-    qatomic_sub(&pool_max_size, removing_pool_size);
+    QEMU_LOCK_GUARD(&global_pool_lock);
+    global_pool_max_size -= removing_pool_size;
+}
+
+static unsigned int get_global_pool_hard_max_size(void)
+{
+#ifdef __linux__
+    g_autofree char *contents = NULL;
+    int max_map_count;
+
+    /*
+     * Linux processes can have up to max_map_count virtual memory areas
+     * (VMAs). mmap(2), mprotect(2), etc fail with ENOMEM beyond this limit. We
+     * must limit the coroutine pool to a safe size to avoid running out of
+     * VMAs.
+     */
+    if (g_file_get_contents("/proc/sys/vm/max_map_count", &contents, NULL,
+                            NULL) &&
+        qemu_strtoi(contents, NULL, 10, &max_map_count) == 0) {
+        /*
+         * This is a conservative upper bound that avoids exceeding
+         * max_map_count. Leave half for non-coroutine users like library
+         * dependencies, vhost-user, etc. Each coroutine takes up 2 VMAs so
+         * halve the amount again.
+         */
+        return max_map_count / 4;
+    }
+#endif
+
+    return UINT_MAX;
+}
+
+static void __attribute__((constructor)) qemu_coroutine_init(void)
+{
+    qemu_mutex_init(&global_pool_lock);
+    global_pool_hard_max_size = get_global_pool_hard_max_size();
 }
-- 
2.44.0



^ permalink raw reply related	[flat|nested] 40+ messages in thread

* Re: [PULL 1/1] coroutine: cap per-thread local pool size
  2024-03-19 15:09 ` [PULL 1/1] coroutine: cap per-thread local pool size Stefan Hajnoczi
@ 2024-03-19 15:14   ` Daniel P. Berrangé
  2024-03-19 17:59     ` Stefan Hajnoczi
  0 siblings, 1 reply; 40+ messages in thread
From: Daniel P. Berrangé @ 2024-03-19 15:14 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: qemu-devel, Michael S. Tsirkin, qemu-block, Kevin Wolf,
	Peter Maydell, Hanna Reitz, Sanjay Rao, Boaz Ben Shabat,
	Joe Mario

Sending this PULL feels little rushed, as I still have
un-answered questions on the inital patch posting just
a few hours ago....

On Tue, Mar 19, 2024 at 11:09:38AM -0400, Stefan Hajnoczi wrote:
> The coroutine pool implementation can hit the Linux vm.max_map_count
> limit, causing QEMU to abort with "failed to allocate memory for stack"
> or "failed to set up stack guard page" during coroutine creation.
> 
> This happens because per-thread pools can grow to tens of thousands of
> coroutines. Each coroutine causes 2 virtual memory areas to be created.
> Eventually vm.max_map_count is reached and memory-related syscalls fail.
> The per-thread pool sizes are non-uniform and depend on past coroutine
> usage in each thread, so it's possible for one thread to have a large
> pool while another thread's pool is empty.
> 
> Switch to a new coroutine pool implementation with a global pool that
> grows to a maximum number of coroutines and per-thread local pools that
> are capped at hardcoded small number of coroutines.
> 
> This approach does not leave large numbers of coroutines pooled in a
> thread that may not use them again. In order to perform well it
> amortizes the cost of global pool accesses by working in batches of
> coroutines instead of individual coroutines.
> 
> The global pool is a list. Threads donate batches of coroutines to when
> they have too many and take batches from when they have too few:
> 
> .-----------------------------------.
> | Batch 1 | Batch 2 | Batch 3 | ... | global_pool
> `-----------------------------------'
> 
> Each thread has up to 2 batches of coroutines:
> 
> .-------------------.
> | Batch 1 | Batch 2 | per-thread local_pool (maximum 2 batches)
> `-------------------'
> 
> The goal of this change is to reduce the excessive number of pooled
> coroutines that cause QEMU to abort when vm.max_map_count is reached
> without losing the performance of an adequately sized coroutine pool.
> 
> Here are virtio-blk disk I/O benchmark results:
> 
>       RW BLKSIZE IODEPTH    OLD    NEW CHANGE
> randread      4k       1 113725 117451 +3.3%
> randread      4k       8 192968 198510 +2.9%
> randread      4k      16 207138 209429 +1.1%
> randread      4k      32 212399 215145 +1.3%
> randread      4k      64 218319 221277 +1.4%
> randread    128k       1  17587  17535 -0.3%
> randread    128k       8  17614  17616 +0.0%
> randread    128k      16  17608  17609 +0.0%
> randread    128k      32  17552  17553 +0.0%
> randread    128k      64  17484  17484 +0.0%
> 
> See files/{fio.sh,test.xml.j2} for the benchmark configuration:
> https://gitlab.com/stefanha/virt-playbooks/-/tree/coroutine-pool-fix-sizing
> 
> Buglink: https://issues.redhat.com/browse/RHEL-28947
> Reported-by: Sanjay Rao <srao@redhat.com>
> Reported-by: Boaz Ben Shabat <bbenshab@redhat.com>
> Reported-by: Joe Mario <jmario@redhat.com>
> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> Message-ID: <20240318183429.1039340-1-stefanha@redhat.com>
> ---
>  util/qemu-coroutine.c | 282 +++++++++++++++++++++++++++++++++---------
>  1 file changed, 223 insertions(+), 59 deletions(-)
> 
> diff --git a/util/qemu-coroutine.c b/util/qemu-coroutine.c
> index 5fd2dbaf8b..2790959eaf 100644
> --- a/util/qemu-coroutine.c
> +++ b/util/qemu-coroutine.c
> @@ -18,39 +18,200 @@
>  #include "qemu/atomic.h"
>  #include "qemu/coroutine_int.h"
>  #include "qemu/coroutine-tls.h"
> +#include "qemu/cutils.h"
>  #include "block/aio.h"
>  
> -/**
> - * The minimal batch size is always 64, coroutines from the release_pool are
> - * reused as soon as there are 64 coroutines in it. The maximum pool size starts
> - * with 64 and is increased on demand so that coroutines are not deleted even if
> - * they are not immediately reused.
> - */
>  enum {
> -    POOL_MIN_BATCH_SIZE = 64,
> -    POOL_INITIAL_MAX_SIZE = 64,
> +    COROUTINE_POOL_BATCH_MAX_SIZE = 128,
>  };
>  
> -/** Free list to speed up creation */
> -static QSLIST_HEAD(, Coroutine) release_pool = QSLIST_HEAD_INITIALIZER(pool);
> -static unsigned int pool_max_size = POOL_INITIAL_MAX_SIZE;
> -static unsigned int release_pool_size;
> +/*
> + * Coroutine creation and deletion is expensive so a pool of unused coroutines
> + * is kept as a cache. When the pool has coroutines available, they are
> + * recycled instead of creating new ones from scratch. Coroutines are added to
> + * the pool upon termination.
> + *
> + * The pool is global but each thread maintains a small local pool to avoid
> + * global pool contention. Threads fetch and return batches of coroutines from
> + * the global pool to maintain their local pool. The local pool holds up to two
> + * batches whereas the maximum size of the global pool is controlled by the
> + * qemu_coroutine_inc_pool_size() API.
> + *
> + * .-----------------------------------.
> + * | Batch 1 | Batch 2 | Batch 3 | ... | global_pool
> + * `-----------------------------------'
> + *
> + * .-------------------.
> + * | Batch 1 | Batch 2 | per-thread local_pool (maximum 2 batches)
> + * `-------------------'
> + */
> +typedef struct CoroutinePoolBatch {
> +    /* Batches are kept in a list */
> +    QSLIST_ENTRY(CoroutinePoolBatch) next;
>  
> -typedef QSLIST_HEAD(, Coroutine) CoroutineQSList;
> -QEMU_DEFINE_STATIC_CO_TLS(CoroutineQSList, alloc_pool);
> -QEMU_DEFINE_STATIC_CO_TLS(unsigned int, alloc_pool_size);
> -QEMU_DEFINE_STATIC_CO_TLS(Notifier, coroutine_pool_cleanup_notifier);
> +    /* This batch holds up to @COROUTINE_POOL_BATCH_MAX_SIZE coroutines */
> +    QSLIST_HEAD(, Coroutine) list;
> +    unsigned int size;
> +} CoroutinePoolBatch;
>  
> -static void coroutine_pool_cleanup(Notifier *n, void *value)
> +typedef QSLIST_HEAD(, CoroutinePoolBatch) CoroutinePool;
> +
> +/* Host operating system limit on number of pooled coroutines */
> +static unsigned int global_pool_hard_max_size;
> +
> +static QemuMutex global_pool_lock; /* protects the following variables */
> +static CoroutinePool global_pool = QSLIST_HEAD_INITIALIZER(global_pool);
> +static unsigned int global_pool_size;
> +static unsigned int global_pool_max_size = COROUTINE_POOL_BATCH_MAX_SIZE;
> +
> +QEMU_DEFINE_STATIC_CO_TLS(CoroutinePool, local_pool);
> +QEMU_DEFINE_STATIC_CO_TLS(Notifier, local_pool_cleanup_notifier);
> +
> +static CoroutinePoolBatch *coroutine_pool_batch_new(void)
> +{
> +    CoroutinePoolBatch *batch = g_new(CoroutinePoolBatch, 1);
> +
> +    QSLIST_INIT(&batch->list);
> +    batch->size = 0;
> +    return batch;
> +}
> +
> +static void coroutine_pool_batch_delete(CoroutinePoolBatch *batch)
>  {
>      Coroutine *co;
>      Coroutine *tmp;
> -    CoroutineQSList *alloc_pool = get_ptr_alloc_pool();
>  
> -    QSLIST_FOREACH_SAFE(co, alloc_pool, pool_next, tmp) {
> -        QSLIST_REMOVE_HEAD(alloc_pool, pool_next);
> +    QSLIST_FOREACH_SAFE(co, &batch->list, pool_next, tmp) {
> +        QSLIST_REMOVE_HEAD(&batch->list, pool_next);
>          qemu_coroutine_delete(co);
>      }
> +    g_free(batch);
> +}
> +
> +static void local_pool_cleanup(Notifier *n, void *value)
> +{
> +    CoroutinePool *local_pool = get_ptr_local_pool();
> +    CoroutinePoolBatch *batch;
> +    CoroutinePoolBatch *tmp;
> +
> +    QSLIST_FOREACH_SAFE(batch, local_pool, next, tmp) {
> +        QSLIST_REMOVE_HEAD(local_pool, next);
> +        coroutine_pool_batch_delete(batch);
> +    }
> +}
> +
> +/* Ensure the atexit notifier is registered */
> +static void local_pool_cleanup_init_once(void)
> +{
> +    Notifier *notifier = get_ptr_local_pool_cleanup_notifier();
> +    if (!notifier->notify) {
> +        notifier->notify = local_pool_cleanup;
> +        qemu_thread_atexit_add(notifier);
> +    }
> +}
> +
> +/* Helper to get the next unused coroutine from the local pool */
> +static Coroutine *coroutine_pool_get_local(void)
> +{
> +    CoroutinePool *local_pool = get_ptr_local_pool();
> +    CoroutinePoolBatch *batch = QSLIST_FIRST(local_pool);
> +    Coroutine *co;
> +
> +    if (unlikely(!batch)) {
> +        return NULL;
> +    }
> +
> +    co = QSLIST_FIRST(&batch->list);
> +    QSLIST_REMOVE_HEAD(&batch->list, pool_next);
> +    batch->size--;
> +
> +    if (batch->size == 0) {
> +        QSLIST_REMOVE_HEAD(local_pool, next);
> +        coroutine_pool_batch_delete(batch);
> +    }
> +    return co;
> +}
> +
> +/* Get the next batch from the global pool */
> +static void coroutine_pool_refill_local(void)
> +{
> +    CoroutinePool *local_pool = get_ptr_local_pool();
> +    CoroutinePoolBatch *batch;
> +
> +    WITH_QEMU_LOCK_GUARD(&global_pool_lock) {
> +        batch = QSLIST_FIRST(&global_pool);
> +
> +        if (batch) {
> +            QSLIST_REMOVE_HEAD(&global_pool, next);
> +            global_pool_size -= batch->size;
> +        }
> +    }
> +
> +    if (batch) {
> +        QSLIST_INSERT_HEAD(local_pool, batch, next);
> +        local_pool_cleanup_init_once();
> +    }
> +}
> +
> +/* Add a batch of coroutines to the global pool */
> +static void coroutine_pool_put_global(CoroutinePoolBatch *batch)
> +{
> +    WITH_QEMU_LOCK_GUARD(&global_pool_lock) {
> +        unsigned int max = MIN(global_pool_max_size,
> +                               global_pool_hard_max_size);
> +
> +        if (global_pool_size < max) {
> +            QSLIST_INSERT_HEAD(&global_pool, batch, next);
> +
> +            /* Overshooting the max pool size is allowed */
> +            global_pool_size += batch->size;
> +            return;
> +        }
> +    }
> +
> +    /* The global pool was full, so throw away this batch */
> +    coroutine_pool_batch_delete(batch);
> +}
> +
> +/* Get the next unused coroutine from the pool or return NULL */
> +static Coroutine *coroutine_pool_get(void)
> +{
> +    Coroutine *co;
> +
> +    co = coroutine_pool_get_local();
> +    if (!co) {
> +        coroutine_pool_refill_local();
> +        co = coroutine_pool_get_local();
> +    }
> +    return co;
> +}
> +
> +static void coroutine_pool_put(Coroutine *co)
> +{
> +    CoroutinePool *local_pool = get_ptr_local_pool();
> +    CoroutinePoolBatch *batch = QSLIST_FIRST(local_pool);
> +
> +    if (unlikely(!batch)) {
> +        batch = coroutine_pool_batch_new();
> +        QSLIST_INSERT_HEAD(local_pool, batch, next);
> +        local_pool_cleanup_init_once();
> +    }
> +
> +    if (unlikely(batch->size >= COROUTINE_POOL_BATCH_MAX_SIZE)) {
> +        CoroutinePoolBatch *next = QSLIST_NEXT(batch, next);
> +
> +        /* Is the local pool full? */
> +        if (next) {
> +            QSLIST_REMOVE_HEAD(local_pool, next);
> +            coroutine_pool_put_global(batch);
> +        }
> +
> +        batch = coroutine_pool_batch_new();
> +        QSLIST_INSERT_HEAD(local_pool, batch, next);
> +    }
> +
> +    QSLIST_INSERT_HEAD(&batch->list, co, pool_next);
> +    batch->size++;
>  }
>  
>  Coroutine *qemu_coroutine_create(CoroutineEntry *entry, void *opaque)
> @@ -58,31 +219,7 @@ Coroutine *qemu_coroutine_create(CoroutineEntry *entry, void *opaque)
>      Coroutine *co = NULL;
>  
>      if (IS_ENABLED(CONFIG_COROUTINE_POOL)) {
> -        CoroutineQSList *alloc_pool = get_ptr_alloc_pool();
> -
> -        co = QSLIST_FIRST(alloc_pool);
> -        if (!co) {
> -            if (release_pool_size > POOL_MIN_BATCH_SIZE) {
> -                /* Slow path; a good place to register the destructor, too.  */
> -                Notifier *notifier = get_ptr_coroutine_pool_cleanup_notifier();
> -                if (!notifier->notify) {
> -                    notifier->notify = coroutine_pool_cleanup;
> -                    qemu_thread_atexit_add(notifier);
> -                }
> -
> -                /* This is not exact; there could be a little skew between
> -                 * release_pool_size and the actual size of release_pool.  But
> -                 * it is just a heuristic, it does not need to be perfect.
> -                 */
> -                set_alloc_pool_size(qatomic_xchg(&release_pool_size, 0));
> -                QSLIST_MOVE_ATOMIC(alloc_pool, &release_pool);
> -                co = QSLIST_FIRST(alloc_pool);
> -            }
> -        }
> -        if (co) {
> -            QSLIST_REMOVE_HEAD(alloc_pool, pool_next);
> -            set_alloc_pool_size(get_alloc_pool_size() - 1);
> -        }
> +        co = coroutine_pool_get();
>      }
>  
>      if (!co) {
> @@ -100,19 +237,10 @@ static void coroutine_delete(Coroutine *co)
>      co->caller = NULL;
>  
>      if (IS_ENABLED(CONFIG_COROUTINE_POOL)) {
> -        if (release_pool_size < qatomic_read(&pool_max_size) * 2) {
> -            QSLIST_INSERT_HEAD_ATOMIC(&release_pool, co, pool_next);
> -            qatomic_inc(&release_pool_size);
> -            return;
> -        }
> -        if (get_alloc_pool_size() < qatomic_read(&pool_max_size)) {
> -            QSLIST_INSERT_HEAD(get_ptr_alloc_pool(), co, pool_next);
> -            set_alloc_pool_size(get_alloc_pool_size() + 1);
> -            return;
> -        }
> +        coroutine_pool_put(co);
> +    } else {
> +        qemu_coroutine_delete(co);
>      }
> -
> -    qemu_coroutine_delete(co);
>  }
>  
>  void qemu_aio_coroutine_enter(AioContext *ctx, Coroutine *co)
> @@ -223,10 +351,46 @@ AioContext *qemu_coroutine_get_aio_context(Coroutine *co)
>  
>  void qemu_coroutine_inc_pool_size(unsigned int additional_pool_size)
>  {
> -    qatomic_add(&pool_max_size, additional_pool_size);
> +    QEMU_LOCK_GUARD(&global_pool_lock);
> +    global_pool_max_size += additional_pool_size;
>  }
>  
>  void qemu_coroutine_dec_pool_size(unsigned int removing_pool_size)
>  {
> -    qatomic_sub(&pool_max_size, removing_pool_size);
> +    QEMU_LOCK_GUARD(&global_pool_lock);
> +    global_pool_max_size -= removing_pool_size;
> +}
> +
> +static unsigned int get_global_pool_hard_max_size(void)
> +{
> +#ifdef __linux__
> +    g_autofree char *contents = NULL;
> +    int max_map_count;
> +
> +    /*
> +     * Linux processes can have up to max_map_count virtual memory areas
> +     * (VMAs). mmap(2), mprotect(2), etc fail with ENOMEM beyond this limit. We
> +     * must limit the coroutine pool to a safe size to avoid running out of
> +     * VMAs.
> +     */
> +    if (g_file_get_contents("/proc/sys/vm/max_map_count", &contents, NULL,
> +                            NULL) &&
> +        qemu_strtoi(contents, NULL, 10, &max_map_count) == 0) {
> +        /*
> +         * This is a conservative upper bound that avoids exceeding
> +         * max_map_count. Leave half for non-coroutine users like library
> +         * dependencies, vhost-user, etc. Each coroutine takes up 2 VMAs so
> +         * halve the amount again.
> +         */
> +        return max_map_count / 4;
> +    }
> +#endif
> +
> +    return UINT_MAX;
> +}
> +
> +static void __attribute__((constructor)) qemu_coroutine_init(void)
> +{
> +    qemu_mutex_init(&global_pool_lock);
> +    global_pool_hard_max_size = get_global_pool_hard_max_size();
>  }
> -- 
> 2.44.0
> 
> 

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PULL 1/1] coroutine: cap per-thread local pool size
  2024-03-19 15:14   ` Daniel P. Berrangé
@ 2024-03-19 17:59     ` Stefan Hajnoczi
  0 siblings, 0 replies; 40+ messages in thread
From: Stefan Hajnoczi @ 2024-03-19 17:59 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: qemu-devel, Michael S. Tsirkin, qemu-block, Kevin Wolf,
	Peter Maydell, Hanna Reitz, Sanjay Rao, Boaz Ben Shabat,
	Joe Mario

[-- Attachment #1: Type: text/plain, Size: 16591 bytes --]

On Tue, Mar 19, 2024 at 03:14:07PM +0000, Daniel P. Berrangé wrote:
> Sending this PULL feels little rushed, as I still have
> un-answered questions on the inital patch posting just
> a few hours ago....

Sorry, I hadn't seen your email. I'll update this email thread once the
discussion has finished.

Stefan

> 
> On Tue, Mar 19, 2024 at 11:09:38AM -0400, Stefan Hajnoczi wrote:
> > The coroutine pool implementation can hit the Linux vm.max_map_count
> > limit, causing QEMU to abort with "failed to allocate memory for stack"
> > or "failed to set up stack guard page" during coroutine creation.
> > 
> > This happens because per-thread pools can grow to tens of thousands of
> > coroutines. Each coroutine causes 2 virtual memory areas to be created.
> > Eventually vm.max_map_count is reached and memory-related syscalls fail.
> > The per-thread pool sizes are non-uniform and depend on past coroutine
> > usage in each thread, so it's possible for one thread to have a large
> > pool while another thread's pool is empty.
> > 
> > Switch to a new coroutine pool implementation with a global pool that
> > grows to a maximum number of coroutines and per-thread local pools that
> > are capped at hardcoded small number of coroutines.
> > 
> > This approach does not leave large numbers of coroutines pooled in a
> > thread that may not use them again. In order to perform well it
> > amortizes the cost of global pool accesses by working in batches of
> > coroutines instead of individual coroutines.
> > 
> > The global pool is a list. Threads donate batches of coroutines to when
> > they have too many and take batches from when they have too few:
> > 
> > .-----------------------------------.
> > | Batch 1 | Batch 2 | Batch 3 | ... | global_pool
> > `-----------------------------------'
> > 
> > Each thread has up to 2 batches of coroutines:
> > 
> > .-------------------.
> > | Batch 1 | Batch 2 | per-thread local_pool (maximum 2 batches)
> > `-------------------'
> > 
> > The goal of this change is to reduce the excessive number of pooled
> > coroutines that cause QEMU to abort when vm.max_map_count is reached
> > without losing the performance of an adequately sized coroutine pool.
> > 
> > Here are virtio-blk disk I/O benchmark results:
> > 
> >       RW BLKSIZE IODEPTH    OLD    NEW CHANGE
> > randread      4k       1 113725 117451 +3.3%
> > randread      4k       8 192968 198510 +2.9%
> > randread      4k      16 207138 209429 +1.1%
> > randread      4k      32 212399 215145 +1.3%
> > randread      4k      64 218319 221277 +1.4%
> > randread    128k       1  17587  17535 -0.3%
> > randread    128k       8  17614  17616 +0.0%
> > randread    128k      16  17608  17609 +0.0%
> > randread    128k      32  17552  17553 +0.0%
> > randread    128k      64  17484  17484 +0.0%
> > 
> > See files/{fio.sh,test.xml.j2} for the benchmark configuration:
> > https://gitlab.com/stefanha/virt-playbooks/-/tree/coroutine-pool-fix-sizing
> > 
> > Buglink: https://issues.redhat.com/browse/RHEL-28947
> > Reported-by: Sanjay Rao <srao@redhat.com>
> > Reported-by: Boaz Ben Shabat <bbenshab@redhat.com>
> > Reported-by: Joe Mario <jmario@redhat.com>
> > Reviewed-by: Kevin Wolf <kwolf@redhat.com>
> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > Message-ID: <20240318183429.1039340-1-stefanha@redhat.com>
> > ---
> >  util/qemu-coroutine.c | 282 +++++++++++++++++++++++++++++++++---------
> >  1 file changed, 223 insertions(+), 59 deletions(-)
> > 
> > diff --git a/util/qemu-coroutine.c b/util/qemu-coroutine.c
> > index 5fd2dbaf8b..2790959eaf 100644
> > --- a/util/qemu-coroutine.c
> > +++ b/util/qemu-coroutine.c
> > @@ -18,39 +18,200 @@
> >  #include "qemu/atomic.h"
> >  #include "qemu/coroutine_int.h"
> >  #include "qemu/coroutine-tls.h"
> > +#include "qemu/cutils.h"
> >  #include "block/aio.h"
> >  
> > -/**
> > - * The minimal batch size is always 64, coroutines from the release_pool are
> > - * reused as soon as there are 64 coroutines in it. The maximum pool size starts
> > - * with 64 and is increased on demand so that coroutines are not deleted even if
> > - * they are not immediately reused.
> > - */
> >  enum {
> > -    POOL_MIN_BATCH_SIZE = 64,
> > -    POOL_INITIAL_MAX_SIZE = 64,
> > +    COROUTINE_POOL_BATCH_MAX_SIZE = 128,
> >  };
> >  
> > -/** Free list to speed up creation */
> > -static QSLIST_HEAD(, Coroutine) release_pool = QSLIST_HEAD_INITIALIZER(pool);
> > -static unsigned int pool_max_size = POOL_INITIAL_MAX_SIZE;
> > -static unsigned int release_pool_size;
> > +/*
> > + * Coroutine creation and deletion is expensive so a pool of unused coroutines
> > + * is kept as a cache. When the pool has coroutines available, they are
> > + * recycled instead of creating new ones from scratch. Coroutines are added to
> > + * the pool upon termination.
> > + *
> > + * The pool is global but each thread maintains a small local pool to avoid
> > + * global pool contention. Threads fetch and return batches of coroutines from
> > + * the global pool to maintain their local pool. The local pool holds up to two
> > + * batches whereas the maximum size of the global pool is controlled by the
> > + * qemu_coroutine_inc_pool_size() API.
> > + *
> > + * .-----------------------------------.
> > + * | Batch 1 | Batch 2 | Batch 3 | ... | global_pool
> > + * `-----------------------------------'
> > + *
> > + * .-------------------.
> > + * | Batch 1 | Batch 2 | per-thread local_pool (maximum 2 batches)
> > + * `-------------------'
> > + */
> > +typedef struct CoroutinePoolBatch {
> > +    /* Batches are kept in a list */
> > +    QSLIST_ENTRY(CoroutinePoolBatch) next;
> >  
> > -typedef QSLIST_HEAD(, Coroutine) CoroutineQSList;
> > -QEMU_DEFINE_STATIC_CO_TLS(CoroutineQSList, alloc_pool);
> > -QEMU_DEFINE_STATIC_CO_TLS(unsigned int, alloc_pool_size);
> > -QEMU_DEFINE_STATIC_CO_TLS(Notifier, coroutine_pool_cleanup_notifier);
> > +    /* This batch holds up to @COROUTINE_POOL_BATCH_MAX_SIZE coroutines */
> > +    QSLIST_HEAD(, Coroutine) list;
> > +    unsigned int size;
> > +} CoroutinePoolBatch;
> >  
> > -static void coroutine_pool_cleanup(Notifier *n, void *value)
> > +typedef QSLIST_HEAD(, CoroutinePoolBatch) CoroutinePool;
> > +
> > +/* Host operating system limit on number of pooled coroutines */
> > +static unsigned int global_pool_hard_max_size;
> > +
> > +static QemuMutex global_pool_lock; /* protects the following variables */
> > +static CoroutinePool global_pool = QSLIST_HEAD_INITIALIZER(global_pool);
> > +static unsigned int global_pool_size;
> > +static unsigned int global_pool_max_size = COROUTINE_POOL_BATCH_MAX_SIZE;
> > +
> > +QEMU_DEFINE_STATIC_CO_TLS(CoroutinePool, local_pool);
> > +QEMU_DEFINE_STATIC_CO_TLS(Notifier, local_pool_cleanup_notifier);
> > +
> > +static CoroutinePoolBatch *coroutine_pool_batch_new(void)
> > +{
> > +    CoroutinePoolBatch *batch = g_new(CoroutinePoolBatch, 1);
> > +
> > +    QSLIST_INIT(&batch->list);
> > +    batch->size = 0;
> > +    return batch;
> > +}
> > +
> > +static void coroutine_pool_batch_delete(CoroutinePoolBatch *batch)
> >  {
> >      Coroutine *co;
> >      Coroutine *tmp;
> > -    CoroutineQSList *alloc_pool = get_ptr_alloc_pool();
> >  
> > -    QSLIST_FOREACH_SAFE(co, alloc_pool, pool_next, tmp) {
> > -        QSLIST_REMOVE_HEAD(alloc_pool, pool_next);
> > +    QSLIST_FOREACH_SAFE(co, &batch->list, pool_next, tmp) {
> > +        QSLIST_REMOVE_HEAD(&batch->list, pool_next);
> >          qemu_coroutine_delete(co);
> >      }
> > +    g_free(batch);
> > +}
> > +
> > +static void local_pool_cleanup(Notifier *n, void *value)
> > +{
> > +    CoroutinePool *local_pool = get_ptr_local_pool();
> > +    CoroutinePoolBatch *batch;
> > +    CoroutinePoolBatch *tmp;
> > +
> > +    QSLIST_FOREACH_SAFE(batch, local_pool, next, tmp) {
> > +        QSLIST_REMOVE_HEAD(local_pool, next);
> > +        coroutine_pool_batch_delete(batch);
> > +    }
> > +}
> > +
> > +/* Ensure the atexit notifier is registered */
> > +static void local_pool_cleanup_init_once(void)
> > +{
> > +    Notifier *notifier = get_ptr_local_pool_cleanup_notifier();
> > +    if (!notifier->notify) {
> > +        notifier->notify = local_pool_cleanup;
> > +        qemu_thread_atexit_add(notifier);
> > +    }
> > +}
> > +
> > +/* Helper to get the next unused coroutine from the local pool */
> > +static Coroutine *coroutine_pool_get_local(void)
> > +{
> > +    CoroutinePool *local_pool = get_ptr_local_pool();
> > +    CoroutinePoolBatch *batch = QSLIST_FIRST(local_pool);
> > +    Coroutine *co;
> > +
> > +    if (unlikely(!batch)) {
> > +        return NULL;
> > +    }
> > +
> > +    co = QSLIST_FIRST(&batch->list);
> > +    QSLIST_REMOVE_HEAD(&batch->list, pool_next);
> > +    batch->size--;
> > +
> > +    if (batch->size == 0) {
> > +        QSLIST_REMOVE_HEAD(local_pool, next);
> > +        coroutine_pool_batch_delete(batch);
> > +    }
> > +    return co;
> > +}
> > +
> > +/* Get the next batch from the global pool */
> > +static void coroutine_pool_refill_local(void)
> > +{
> > +    CoroutinePool *local_pool = get_ptr_local_pool();
> > +    CoroutinePoolBatch *batch;
> > +
> > +    WITH_QEMU_LOCK_GUARD(&global_pool_lock) {
> > +        batch = QSLIST_FIRST(&global_pool);
> > +
> > +        if (batch) {
> > +            QSLIST_REMOVE_HEAD(&global_pool, next);
> > +            global_pool_size -= batch->size;
> > +        }
> > +    }
> > +
> > +    if (batch) {
> > +        QSLIST_INSERT_HEAD(local_pool, batch, next);
> > +        local_pool_cleanup_init_once();
> > +    }
> > +}
> > +
> > +/* Add a batch of coroutines to the global pool */
> > +static void coroutine_pool_put_global(CoroutinePoolBatch *batch)
> > +{
> > +    WITH_QEMU_LOCK_GUARD(&global_pool_lock) {
> > +        unsigned int max = MIN(global_pool_max_size,
> > +                               global_pool_hard_max_size);
> > +
> > +        if (global_pool_size < max) {
> > +            QSLIST_INSERT_HEAD(&global_pool, batch, next);
> > +
> > +            /* Overshooting the max pool size is allowed */
> > +            global_pool_size += batch->size;
> > +            return;
> > +        }
> > +    }
> > +
> > +    /* The global pool was full, so throw away this batch */
> > +    coroutine_pool_batch_delete(batch);
> > +}
> > +
> > +/* Get the next unused coroutine from the pool or return NULL */
> > +static Coroutine *coroutine_pool_get(void)
> > +{
> > +    Coroutine *co;
> > +
> > +    co = coroutine_pool_get_local();
> > +    if (!co) {
> > +        coroutine_pool_refill_local();
> > +        co = coroutine_pool_get_local();
> > +    }
> > +    return co;
> > +}
> > +
> > +static void coroutine_pool_put(Coroutine *co)
> > +{
> > +    CoroutinePool *local_pool = get_ptr_local_pool();
> > +    CoroutinePoolBatch *batch = QSLIST_FIRST(local_pool);
> > +
> > +    if (unlikely(!batch)) {
> > +        batch = coroutine_pool_batch_new();
> > +        QSLIST_INSERT_HEAD(local_pool, batch, next);
> > +        local_pool_cleanup_init_once();
> > +    }
> > +
> > +    if (unlikely(batch->size >= COROUTINE_POOL_BATCH_MAX_SIZE)) {
> > +        CoroutinePoolBatch *next = QSLIST_NEXT(batch, next);
> > +
> > +        /* Is the local pool full? */
> > +        if (next) {
> > +            QSLIST_REMOVE_HEAD(local_pool, next);
> > +            coroutine_pool_put_global(batch);
> > +        }
> > +
> > +        batch = coroutine_pool_batch_new();
> > +        QSLIST_INSERT_HEAD(local_pool, batch, next);
> > +    }
> > +
> > +    QSLIST_INSERT_HEAD(&batch->list, co, pool_next);
> > +    batch->size++;
> >  }
> >  
> >  Coroutine *qemu_coroutine_create(CoroutineEntry *entry, void *opaque)
> > @@ -58,31 +219,7 @@ Coroutine *qemu_coroutine_create(CoroutineEntry *entry, void *opaque)
> >      Coroutine *co = NULL;
> >  
> >      if (IS_ENABLED(CONFIG_COROUTINE_POOL)) {
> > -        CoroutineQSList *alloc_pool = get_ptr_alloc_pool();
> > -
> > -        co = QSLIST_FIRST(alloc_pool);
> > -        if (!co) {
> > -            if (release_pool_size > POOL_MIN_BATCH_SIZE) {
> > -                /* Slow path; a good place to register the destructor, too.  */
> > -                Notifier *notifier = get_ptr_coroutine_pool_cleanup_notifier();
> > -                if (!notifier->notify) {
> > -                    notifier->notify = coroutine_pool_cleanup;
> > -                    qemu_thread_atexit_add(notifier);
> > -                }
> > -
> > -                /* This is not exact; there could be a little skew between
> > -                 * release_pool_size and the actual size of release_pool.  But
> > -                 * it is just a heuristic, it does not need to be perfect.
> > -                 */
> > -                set_alloc_pool_size(qatomic_xchg(&release_pool_size, 0));
> > -                QSLIST_MOVE_ATOMIC(alloc_pool, &release_pool);
> > -                co = QSLIST_FIRST(alloc_pool);
> > -            }
> > -        }
> > -        if (co) {
> > -            QSLIST_REMOVE_HEAD(alloc_pool, pool_next);
> > -            set_alloc_pool_size(get_alloc_pool_size() - 1);
> > -        }
> > +        co = coroutine_pool_get();
> >      }
> >  
> >      if (!co) {
> > @@ -100,19 +237,10 @@ static void coroutine_delete(Coroutine *co)
> >      co->caller = NULL;
> >  
> >      if (IS_ENABLED(CONFIG_COROUTINE_POOL)) {
> > -        if (release_pool_size < qatomic_read(&pool_max_size) * 2) {
> > -            QSLIST_INSERT_HEAD_ATOMIC(&release_pool, co, pool_next);
> > -            qatomic_inc(&release_pool_size);
> > -            return;
> > -        }
> > -        if (get_alloc_pool_size() < qatomic_read(&pool_max_size)) {
> > -            QSLIST_INSERT_HEAD(get_ptr_alloc_pool(), co, pool_next);
> > -            set_alloc_pool_size(get_alloc_pool_size() + 1);
> > -            return;
> > -        }
> > +        coroutine_pool_put(co);
> > +    } else {
> > +        qemu_coroutine_delete(co);
> >      }
> > -
> > -    qemu_coroutine_delete(co);
> >  }
> >  
> >  void qemu_aio_coroutine_enter(AioContext *ctx, Coroutine *co)
> > @@ -223,10 +351,46 @@ AioContext *qemu_coroutine_get_aio_context(Coroutine *co)
> >  
> >  void qemu_coroutine_inc_pool_size(unsigned int additional_pool_size)
> >  {
> > -    qatomic_add(&pool_max_size, additional_pool_size);
> > +    QEMU_LOCK_GUARD(&global_pool_lock);
> > +    global_pool_max_size += additional_pool_size;
> >  }
> >  
> >  void qemu_coroutine_dec_pool_size(unsigned int removing_pool_size)
> >  {
> > -    qatomic_sub(&pool_max_size, removing_pool_size);
> > +    QEMU_LOCK_GUARD(&global_pool_lock);
> > +    global_pool_max_size -= removing_pool_size;
> > +}
> > +
> > +static unsigned int get_global_pool_hard_max_size(void)
> > +{
> > +#ifdef __linux__
> > +    g_autofree char *contents = NULL;
> > +    int max_map_count;
> > +
> > +    /*
> > +     * Linux processes can have up to max_map_count virtual memory areas
> > +     * (VMAs). mmap(2), mprotect(2), etc fail with ENOMEM beyond this limit. We
> > +     * must limit the coroutine pool to a safe size to avoid running out of
> > +     * VMAs.
> > +     */
> > +    if (g_file_get_contents("/proc/sys/vm/max_map_count", &contents, NULL,
> > +                            NULL) &&
> > +        qemu_strtoi(contents, NULL, 10, &max_map_count) == 0) {
> > +        /*
> > +         * This is a conservative upper bound that avoids exceeding
> > +         * max_map_count. Leave half for non-coroutine users like library
> > +         * dependencies, vhost-user, etc. Each coroutine takes up 2 VMAs so
> > +         * halve the amount again.
> > +         */
> > +        return max_map_count / 4;
> > +    }
> > +#endif
> > +
> > +    return UINT_MAX;
> > +}
> > +
> > +static void __attribute__((constructor)) qemu_coroutine_init(void)
> > +{
> > +    qemu_mutex_init(&global_pool_lock);
> > +    global_pool_hard_max_size = get_global_pool_hard_max_size();
> >  }
> > -- 
> > 2.44.0
> > 
> > 
> 
> With regards,
> Daniel
> -- 
> |: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org         -o-            https://fstop138.berrange.com :|
> |: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PULL 0/1] Block patches
  2024-03-19 15:09 [PULL 0/1] Block patches Stefan Hajnoczi
  2024-03-19 15:09 ` [PULL 1/1] coroutine: cap per-thread local pool size Stefan Hajnoczi
@ 2024-03-19 19:11 ` Peter Maydell
  1 sibling, 0 replies; 40+ messages in thread
From: Peter Maydell @ 2024-03-19 19:11 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: qemu-devel, Michael S. Tsirkin, qemu-block, Kevin Wolf, Hanna Reitz

On Tue, 19 Mar 2024 at 15:09, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>
> The following changes since commit ddc27d2ad9361a81c2b3800d14143bf420dae172:
>
>   Merge tag 'pull-request-2024-03-18' of https://gitlab.com/thuth/qemu into staging (2024-03-19 10:25:25 +0000)
>
> are available in the Git repository at:
>
>   https://gitlab.com/stefanha/qemu.git tags/block-pull-request
>
> for you to fetch changes up to 86a637e48104ae74d8be53bed6441ce32be33433:
>
>   coroutine: cap per-thread local pool size (2024-03-19 10:49:31 -0400)
>
> ----------------------------------------------------------------
> Pull request
>
> This fix solves the "failed to set up stack guard page" error that has been
> reported on Linux hosts where the QEMU coroutine pool exceeds the
> vm.max_map_count limit.
>
> ----------------------------------------------------------------


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/9.0
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PULL 0/1] Block patches
@ 2024-04-29 13:43 Stefan Hajnoczi
  0 siblings, 0 replies; 40+ messages in thread
From: Stefan Hajnoczi @ 2024-04-29 13:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: Richard Henderson, Jeuk Kim, qemu-block, Stefan Hajnoczi

The following changes since commit fd87be1dada5672f877e03c2ca8504458292c479:

  Merge tag 'accel-20240426' of https://github.com/philmd/qemu into staging (2024-04-26 15:28:13 -0700)

are available in the Git repository at:

  https://gitlab.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to d1c4580662bf75bf6875bb5e1ad446b300816ac7:

  hw/ufs: Fix buffer overflow bug (2024-04-29 09:33:06 -0400)

----------------------------------------------------------------
Pull request

Buffer overflow fix for Universal Flash Storage (UFS) emulation.

----------------------------------------------------------------

Jeuk Kim (1):
  hw/ufs: Fix buffer overflow bug

 hw/ufs/ufs.c | 8 ++++++++
 1 file changed, 8 insertions(+)

-- 
2.44.0



^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PULL 0/1] Block patches
  2024-02-06 15:31 Stefan Hajnoczi
@ 2024-02-07 22:19 ` Kevin Wolf
  0 siblings, 0 replies; 40+ messages in thread
From: Kevin Wolf @ 2024-02-07 22:19 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: qemu-devel, Peter Maydell, Michael S. Tsirkin, Hanna Reitz, qemu-block

Am 06.02.2024 um 16:31 hat Stefan Hajnoczi geschrieben:
> The following changes since commit 39a6e4f87e7b75a45b08d6dc8b8b7c2954c87440:
> 
>   Merge tag 'pull-qapi-2024-02-03' of https://repo.or.cz/qemu/armbru into staging (2024-02-03 13:31:58 +0000)
> 
> are available in the Git repository at:
> 
>   https://gitlab.com/stefanha/qemu.git tags/block-pull-request
> 
> for you to fetch changes up to 1d52cc0ac27761e296b14655c2f5b2649ee69491:
> 
>   virtio-blk: avoid using ioeventfd state in irqfd conditional (2024-02-06 10:22:18 -0500)
> 
> ----------------------------------------------------------------
> Pull request
> 
> A bug fix for in-flight I/O during ioeventfd shutdown.
> 
> ----------------------------------------------------------------
> 
> Stefan Hajnoczi (1):
>   virtio-blk: avoid using ioeventfd state in irqfd conditional

I noticed that this patch is also in the pull request I sent, so I
guess if mine goes through, you don't have to process this one
separately.

Kevin



^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PULL 0/1] Block patches
@ 2024-02-06 15:31 Stefan Hajnoczi
  2024-02-07 22:19 ` Kevin Wolf
  0 siblings, 1 reply; 40+ messages in thread
From: Stefan Hajnoczi @ 2024-02-06 15:31 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Kevin Wolf, Stefan Hajnoczi, Michael S. Tsirkin,
	Hanna Reitz, qemu-block

The following changes since commit 39a6e4f87e7b75a45b08d6dc8b8b7c2954c87440:

  Merge tag 'pull-qapi-2024-02-03' of https://repo.or.cz/qemu/armbru into staging (2024-02-03 13:31:58 +0000)

are available in the Git repository at:

  https://gitlab.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to 1d52cc0ac27761e296b14655c2f5b2649ee69491:

  virtio-blk: avoid using ioeventfd state in irqfd conditional (2024-02-06 10:22:18 -0500)

----------------------------------------------------------------
Pull request

A bug fix for in-flight I/O during ioeventfd shutdown.

----------------------------------------------------------------

Stefan Hajnoczi (1):
  virtio-blk: avoid using ioeventfd state in irqfd conditional

 hw/block/virtio-blk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.43.0



^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PULL 0/1] Block patches
@ 2023-10-16 19:40 Stefan Hajnoczi
  0 siblings, 0 replies; 40+ messages in thread
From: Stefan Hajnoczi @ 2023-10-16 19:40 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Michael S. Tsirkin, qemu-block, Stefan Hajnoczi, Hanna Reitz

The following changes since commit 63011373ad22c794a013da69663c03f1297a5c56:

  Merge tag 'pull-riscv-to-apply-20231012-1' of https://github.com/alistair23/qemu into staging (2023-10-12 10:24:44 -0400)

are available in the Git repository at:

  https://gitlab.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to 071d6d107db2e26dde9bb15457c74956c88ec5b4:

  virtio-blk: don't start dataplane during the stop of dataplane (2023-10-16 15:39:13 -0400)

----------------------------------------------------------------
Pull request

Contains a virtio-blk IOThread fix.

----------------------------------------------------------------

hujian (1):
  virtio-blk: don't start dataplane during the stop of dataplane

 hw/block/virtio-blk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.41.0



^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PULL 0/1] Block patches
  2023-10-04 13:53 Stefan Hajnoczi
@ 2023-10-04 18:33 ` Stefan Hajnoczi
  0 siblings, 0 replies; 40+ messages in thread
From: Stefan Hajnoczi @ 2023-10-04 18:33 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: qemu-devel, Stefan Hajnoczi, Thomas Huth, Daniel P. Berrangé,
	qemu-block, Philippe Mathieu-Daudé,
	Marc-André Lureau, Kevin Wolf, Paolo Bonzini

[-- Attachment #1: Type: text/plain, Size: 115 bytes --]

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/8.2 for any user-visible changes.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PULL 0/1] Block patches
@ 2023-10-04 13:53 Stefan Hajnoczi
  2023-10-04 18:33 ` Stefan Hajnoczi
  0 siblings, 1 reply; 40+ messages in thread
From: Stefan Hajnoczi @ 2023-10-04 13:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: Stefan Hajnoczi, Thomas Huth, Daniel P. Berrangé,
	qemu-block, Philippe Mathieu-Daudé,
	Marc-André Lureau, Kevin Wolf, Paolo Bonzini

The following changes since commit da1034094d375afe9e3d8ec8980550ea0f06f7e0:

  Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2023-10-03 07:43:44 -0400)

are available in the Git repository at:

  https://gitlab.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to 9afa888ce0f816d0f2cfc95eebe4f49244c518af:

  osdep: set _FORTIFY_SOURCE=2 when optimization is enabled (2023-10-04 09:52:06 -0400)

----------------------------------------------------------------
Pull request

----------------------------------------------------------------

Daniel P. Berrangé (1):
  osdep: set _FORTIFY_SOURCE=2 when optimization is enabled

 meson.build                  | 10 ----------
 include/qemu/osdep.h         |  4 ++++
 util/coroutine-sigaltstack.c |  4 ++--
 util/coroutine-ucontext.c    |  4 ++--
 4 files changed, 8 insertions(+), 14 deletions(-)

-- 
2.41.0



^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PULL 0/1] Block patches
  2023-07-12 19:36 Stefan Hajnoczi
@ 2023-07-14  6:35 ` Richard Henderson
  0 siblings, 0 replies; 40+ messages in thread
From: Richard Henderson @ 2023-07-14  6:35 UTC (permalink / raw)
  To: Stefan Hajnoczi, qemu-devel
  Cc: Kevin Wolf, qemu-block, Hanna Reitz, Richard Henderson

On 7/12/23 20:36, Stefan Hajnoczi wrote:
> The following changes since commit 887cba855bb6ff4775256f7968409281350b568c:
> 
>    configure: Fix cross-building for RISCV host (v5) (2023-07-11 17:56:09 +0100)
> 
> are available in the Git repository at:
> 
>    https://gitlab.com/stefanha/qemu.git tags/block-pull-request
> 
> for you to fetch changes up to 75dcb4d790bbe5327169fd72b185960ca58e2fa6:
> 
>    virtio-blk: fix host notifier issues during dataplane start/stop (2023-07-12 15:20:32 -0400)
> 
> ----------------------------------------------------------------
> Pull request
> 
> ----------------------------------------------------------------
> 
> Stefan Hajnoczi (1):
>    virtio-blk: fix host notifier issues during dataplane start/stop
> 
>   hw/block/dataplane/virtio-blk.c | 67 +++++++++++++++++++--------------
>   1 file changed, 38 insertions(+), 29 deletions(-)
> 

Applied, thanks.  Please update https://wiki.qemu.org/ChangeLog/8.1 as appropriate.


r~



^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PULL 0/1] Block patches
@ 2023-07-12 19:36 Stefan Hajnoczi
  2023-07-14  6:35 ` Richard Henderson
  0 siblings, 1 reply; 40+ messages in thread
From: Stefan Hajnoczi @ 2023-07-12 19:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, qemu-block, Hanna Reitz, Stefan Hajnoczi, Richard Henderson

The following changes since commit 887cba855bb6ff4775256f7968409281350b568c:

  configure: Fix cross-building for RISCV host (v5) (2023-07-11 17:56:09 +0100)

are available in the Git repository at:

  https://gitlab.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to 75dcb4d790bbe5327169fd72b185960ca58e2fa6:

  virtio-blk: fix host notifier issues during dataplane start/stop (2023-07-12 15:20:32 -0400)

----------------------------------------------------------------
Pull request

----------------------------------------------------------------

Stefan Hajnoczi (1):
  virtio-blk: fix host notifier issues during dataplane start/stop

 hw/block/dataplane/virtio-blk.c | 67 +++++++++++++++++++--------------
 1 file changed, 38 insertions(+), 29 deletions(-)

-- 
2.40.1



^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PULL 0/1] Block patches
  2023-07-04 15:29 Stefan Hajnoczi
@ 2023-07-06  6:04 ` Richard Henderson
  0 siblings, 0 replies; 40+ messages in thread
From: Richard Henderson @ 2023-07-06  6:04 UTC (permalink / raw)
  To: Stefan Hajnoczi, qemu-devel
  Cc: Kevin Wolf, Hanna Reitz, qemu-block, Richard Henderson

On 7/4/23 16:29, Stefan Hajnoczi wrote:
> The following changes since commit d145c0da22cde391d8c6672d33146ce306e8bf75:
> 
>    Merge tag 'pull-tcg-20230701' ofhttps://gitlab.com/rth7680/qemu  into staging (2023-07-01 08:55:37 +0200)
> 
> are available in the Git repository at:
> 
>    https://gitlab.com/stefanha/qemu.git  tags/block-pull-request
> 
> for you to fetch changes up to c21eae1ccc782440f320accb6f90c66cb8f45ee9:
> 
>    block/blkio: fix module_block.py parsing (2023-07-04 17:28:25 +0200)
> 
> ----------------------------------------------------------------
> Pull request
> 
> Fix --enable-modules with the blkio block driver.

Applied, thanks.  Please update https://wiki.qemu.org/ChangeLog/8.1 as appropriate.


r~



^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PULL 0/1] Block patches
@ 2023-07-04 15:29 Stefan Hajnoczi
  2023-07-06  6:04 ` Richard Henderson
  0 siblings, 1 reply; 40+ messages in thread
From: Stefan Hajnoczi @ 2023-07-04 15:29 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Stefan Hajnoczi, Hanna Reitz, qemu-block, Richard Henderson

The following changes since commit d145c0da22cde391d8c6672d33146ce306e8bf75:

  Merge tag 'pull-tcg-20230701' of https://gitlab.com/rth7680/qemu into staging (2023-07-01 08:55:37 +0200)

are available in the Git repository at:

  https://gitlab.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to c21eae1ccc782440f320accb6f90c66cb8f45ee9:

  block/blkio: fix module_block.py parsing (2023-07-04 17:28:25 +0200)

----------------------------------------------------------------
Pull request

Fix --enable-modules with the blkio block driver.

----------------------------------------------------------------

Stefan Hajnoczi (1):
  block/blkio: fix module_block.py parsing

 block/blkio.c | 108 ++++++++++++++++++++++++++------------------------
 1 file changed, 56 insertions(+), 52 deletions(-)

-- 
2.40.1



^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PULL 0/1] Block patches
  2022-09-22 17:14 Stefan Hajnoczi
@ 2022-09-27 15:04 ` Stefan Hajnoczi
  0 siblings, 0 replies; 40+ messages in thread
From: Stefan Hajnoczi @ 2022-09-27 15:04 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: qemu-devel, Stefan Hajnoczi, qemu-block, Dr. David Alan Gilbert,
	virtio-fs

[-- Attachment #1: Type: text/plain, Size: 115 bytes --]

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/7.2 for any user-visible changes.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PULL 0/1] Block patches
@ 2022-09-22 17:14 Stefan Hajnoczi
  2022-09-27 15:04 ` Stefan Hajnoczi
  0 siblings, 1 reply; 40+ messages in thread
From: Stefan Hajnoczi @ 2022-09-22 17:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, qemu-block, Dr. David Alan Gilbert, virtio-fs

The following changes since commit 6338c30111d596d955e6bc933a82184a0b910c43:

  Merge tag 'm68k-for-7.2-pull-request' of https://github.com/vivier/qemu-m68k into staging (2022-09-21 13:12:36 -0400)

are available in the Git repository at:

  https://gitlab.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to f16d15c9276bd8f501f861c39cbd4adc812d0c1d:

  virtiofsd: use g_date_time_get_microsecond to get subsecond (2022-09-22 13:13:47 -0400)

----------------------------------------------------------------
Pull request

----------------------------------------------------------------

Yusuke Okada (1):
  virtiofsd: use g_date_time_get_microsecond to get subsecond

 tools/virtiofsd/passthrough_ll.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

-- 
2.37.3



^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PULL 0/1] Block patches
  2022-05-25 12:49 Stefan Hajnoczi
@ 2022-05-25 18:35 ` Richard Henderson
  0 siblings, 0 replies; 40+ messages in thread
From: Richard Henderson @ 2022-05-25 18:35 UTC (permalink / raw)
  To: Stefan Hajnoczi, qemu-devel; +Cc: Dr. David Alan Gilbert, virtio-fs, qemu-block

On 5/25/22 05:49, Stefan Hajnoczi wrote:
> The following changes since commit 0cac736e73723850a99e5142e35d14d8f8efb232:
> 
>    Merge tag 'pull-riscv-to-apply-20220525' of github.com:alistair23/qemu into staging (2022-05-24 15:55:12 -0700)
> 
> are available in the Git repository at:
> 
>    https://gitlab.com/stefanha/qemu.git tags/block-pull-request
> 
> for you to fetch changes up to 29320530cf6684646b3a642fdbb5bc77ee8039de:
> 
>    docs: Correct the default thread-pool-size (2022-05-25 11:01:38 +0100)
> 
> ----------------------------------------------------------------
> Pull request
> 
> A small documentation fix.

Applied, thanks.  Please update https://wiki.qemu.org/ChangeLog/7.1 as appropriate.


r~


> 
> ----------------------------------------------------------------
> 
> Liu Yiding (1):
>    docs: Correct the default thread-pool-size
> 
>   docs/tools/virtiofsd.rst | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 



^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PULL 0/1] Block patches
@ 2022-05-25 12:49 Stefan Hajnoczi
  2022-05-25 18:35 ` Richard Henderson
  0 siblings, 1 reply; 40+ messages in thread
From: Stefan Hajnoczi @ 2022-05-25 12:49 UTC (permalink / raw)
  To: qemu-devel
  Cc: Dr. David Alan Gilbert, Richard Henderson, Stefan Hajnoczi,
	virtio-fs, qemu-block

The following changes since commit 0cac736e73723850a99e5142e35d14d8f8efb232:

  Merge tag 'pull-riscv-to-apply-20220525' of github.com:alistair23/qemu into staging (2022-05-24 15:55:12 -0700)

are available in the Git repository at:

  https://gitlab.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to 29320530cf6684646b3a642fdbb5bc77ee8039de:

  docs: Correct the default thread-pool-size (2022-05-25 11:01:38 +0100)

----------------------------------------------------------------
Pull request

A small documentation fix.

----------------------------------------------------------------

Liu Yiding (1):
  docs: Correct the default thread-pool-size

 docs/tools/virtiofsd.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.36.1



^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PULL 0/1] Block patches
  2021-12-09 15:21 Stefan Hajnoczi
  2021-12-09 15:46 ` Peter Maydell
@ 2021-12-14 22:31 ` Richard Henderson
  1 sibling, 0 replies; 40+ messages in thread
From: Richard Henderson @ 2021-12-14 22:31 UTC (permalink / raw)
  To: Stefan Hajnoczi, qemu-devel, Peter Maydell
  Cc: Fam Zheng, Kevin Wolf, qemu-block, Hanna Reitz, Paolo Bonzini,
	Philippe Mathieu-Daudé

On 12/9/21 7:21 AM, Stefan Hajnoczi wrote:
> The following changes since commit a3607def89f9cd68c1b994e1030527df33aa91d0:
> 
>    Update version for v6.2.0-rc4 release (2021-12-07 17:51:38 -0800)
> 
> are available in the Git repository at:
> 
>    https://gitlab.com/stefanha/qemu.git tags/block-pull-request
> 
> for you to fetch changes up to cf4fbc3030c974fff726756a7ceef8386cdf500b:
> 
>    block/nvme: fix infinite loop in nvme_free_req_queue_cb() (2021-12-09 09:19:49 +0000)
> 
> ----------------------------------------------------------------
> Pull request
> 
> An infinite loop fix for the userspace NVMe driver.
> 
> ----------------------------------------------------------------
> 
> Stefan Hajnoczi (1):
>    block/nvme: fix infinite loop in nvme_free_req_queue_cb()
> 
>   block/nvme.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions
Applied, as the beginning of the 7.0 development tree.


r~


^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PULL 0/1] Block patches
  2021-12-09 16:53     ` Richard Henderson
@ 2021-12-13  9:33       ` Stefan Hajnoczi
  0 siblings, 0 replies; 40+ messages in thread
From: Stefan Hajnoczi @ 2021-12-13  9:33 UTC (permalink / raw)
  To: Richard Henderson
  Cc: Fam Zheng, Peter Maydell, qemu-block, qemu-devel, Hanna Reitz,
	Kevin Wolf, Paolo Bonzini, Philippe Mathieu-Daudé

[-- Attachment #1: Type: text/plain, Size: 755 bytes --]

On Thu, Dec 09, 2021 at 08:53:25AM -0800, Richard Henderson wrote:
> On 12/9/21 8:34 AM, Stefan Hajnoczi wrote:
> > > I'm not running the release cycle this time around, but: it's
> > > already rc4, pull requests by this point need a clear justification
> > > in the cover letter for why they're really release critical.
> > 
> > It's late, this isn't a show-stopper (block/nvme.c is not widely used).
> > Let's leave it for the next release cycle and -stable.
> 
> Good.
> 
> Unless you want to re-issue with Cc: qemu-stable included in the patch, this
> can be the first PR of the next devel cycle, since it's already here.  :-)

Thank you! qemu-stable can merge it separately. I won't add a Cc: tag to
the commit description.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PULL 0/1] Block patches
  2021-12-09 16:34   ` Stefan Hajnoczi
@ 2021-12-09 16:53     ` Richard Henderson
  2021-12-13  9:33       ` Stefan Hajnoczi
  0 siblings, 1 reply; 40+ messages in thread
From: Richard Henderson @ 2021-12-09 16:53 UTC (permalink / raw)
  To: Stefan Hajnoczi, Peter Maydell
  Cc: Fam Zheng, Kevin Wolf, qemu-block, qemu-devel, Hanna Reitz,
	Paolo Bonzini, Philippe Mathieu-Daudé

On 12/9/21 8:34 AM, Stefan Hajnoczi wrote:
>> I'm not running the release cycle this time around, but: it's
>> already rc4, pull requests by this point need a clear justification
>> in the cover letter for why they're really release critical.
> 
> It's late, this isn't a show-stopper (block/nvme.c is not widely used).
> Let's leave it for the next release cycle and -stable.

Good.

Unless you want to re-issue with Cc: qemu-stable included in the patch, this can be the 
first PR of the next devel cycle, since it's already here.  :-)


r~


^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PULL 0/1] Block patches
  2021-12-09 15:46 ` Peter Maydell
@ 2021-12-09 16:34   ` Stefan Hajnoczi
  2021-12-09 16:53     ` Richard Henderson
  0 siblings, 1 reply; 40+ messages in thread
From: Stefan Hajnoczi @ 2021-12-09 16:34 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Fam Zheng, Kevin Wolf, qemu-block, Richard Henderson, qemu-devel,
	Hanna Reitz, Paolo Bonzini, Philippe Mathieu-Daudé

[-- Attachment #1: Type: text/plain, Size: 1185 bytes --]

On Thu, Dec 09, 2021 at 03:46:29PM +0000, Peter Maydell wrote:
> On Thu, 9 Dec 2021 at 15:21, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> >
> > The following changes since commit a3607def89f9cd68c1b994e1030527df33aa91d0:
> >
> >   Update version for v6.2.0-rc4 release (2021-12-07 17:51:38 -0800)
> >
> > are available in the Git repository at:
> >
> >   https://gitlab.com/stefanha/qemu.git tags/block-pull-request
> >
> > for you to fetch changes up to cf4fbc3030c974fff726756a7ceef8386cdf500b:
> >
> >   block/nvme: fix infinite loop in nvme_free_req_queue_cb() (2021-12-09 09:19:49 +0000)
> >
> > ----------------------------------------------------------------
> > Pull request
> >
> > An infinite loop fix for the userspace NVMe driver.
> >
> > ----------------------------------------------------------------
> 
> I'm not running the release cycle this time around, but: it's
> already rc4, pull requests by this point need a clear justification
> in the cover letter for why they're really release critical.

It's late, this isn't a show-stopper (block/nvme.c is not widely used).
Let's leave it for the next release cycle and -stable.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PULL 0/1] Block patches
  2021-12-09 15:21 Stefan Hajnoczi
@ 2021-12-09 15:46 ` Peter Maydell
  2021-12-09 16:34   ` Stefan Hajnoczi
  2021-12-14 22:31 ` Richard Henderson
  1 sibling, 1 reply; 40+ messages in thread
From: Peter Maydell @ 2021-12-09 15:46 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: Fam Zheng, Kevin Wolf, qemu-block, Richard Henderson, qemu-devel,
	Hanna Reitz, Paolo Bonzini, Philippe Mathieu-Daudé

On Thu, 9 Dec 2021 at 15:21, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>
> The following changes since commit a3607def89f9cd68c1b994e1030527df33aa91d0:
>
>   Update version for v6.2.0-rc4 release (2021-12-07 17:51:38 -0800)
>
> are available in the Git repository at:
>
>   https://gitlab.com/stefanha/qemu.git tags/block-pull-request
>
> for you to fetch changes up to cf4fbc3030c974fff726756a7ceef8386cdf500b:
>
>   block/nvme: fix infinite loop in nvme_free_req_queue_cb() (2021-12-09 09:19:49 +0000)
>
> ----------------------------------------------------------------
> Pull request
>
> An infinite loop fix for the userspace NVMe driver.
>
> ----------------------------------------------------------------

I'm not running the release cycle this time around, but: it's
already rc4, pull requests by this point need a clear justification
in the cover letter for why they're really release critical.

-- PMM


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PULL 0/1] Block patches
@ 2021-12-09 15:21 Stefan Hajnoczi
  2021-12-09 15:46 ` Peter Maydell
  2021-12-14 22:31 ` Richard Henderson
  0 siblings, 2 replies; 40+ messages in thread
From: Stefan Hajnoczi @ 2021-12-09 15:21 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell
  Cc: Fam Zheng, Kevin Wolf, qemu-block, Hanna Reitz, Stefan Hajnoczi,
	Paolo Bonzini, Philippe Mathieu-Daudé

The following changes since commit a3607def89f9cd68c1b994e1030527df33aa91d0:

  Update version for v6.2.0-rc4 release (2021-12-07 17:51:38 -0800)

are available in the Git repository at:

  https://gitlab.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to cf4fbc3030c974fff726756a7ceef8386cdf500b:

  block/nvme: fix infinite loop in nvme_free_req_queue_cb() (2021-12-09 09:19:49 +0000)

----------------------------------------------------------------
Pull request

An infinite loop fix for the userspace NVMe driver.

----------------------------------------------------------------

Stefan Hajnoczi (1):
  block/nvme: fix infinite loop in nvme_free_req_queue_cb()

 block/nvme.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

-- 
2.33.1




^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PULL 0/1] Block patches
  2021-12-06 15:27 Stefan Hajnoczi
@ 2021-12-06 21:16 ` Richard Henderson
  0 siblings, 0 replies; 40+ messages in thread
From: Richard Henderson @ 2021-12-06 21:16 UTC (permalink / raw)
  To: Stefan Hajnoczi, Peter Maydell, qemu-devel
  Cc: Kevin Wolf, Paolo Bonzini, Hanna Reitz, qemu-block

On 12/6/21 7:27 AM, Stefan Hajnoczi wrote:
> The following changes since commit 99fc08366b06282614daeda989d2fde6ab8a707f:
> 
>    Merge tag 'seabios-20211203-pull-request' of git://git.kraxel.org/qemu into staging (2021-12-03 05:26:40 -0800)
> 
> are available in the Git repository at:
> 
>    https://gitlab.com/stefanha/qemu.git tags/block-pull-request
> 
> for you to fetch changes up to 5b807181c27a940a3a7ad1f221a2e76a132cbdc0:
> 
>    virtio-blk: Fix clean up of host notifiers for single MR transaction. (2021-12-06 14:21:14 +0000)
> 
> ----------------------------------------------------------------
> Pull request
> 
> ----------------------------------------------------------------
> 
> Mark Mielke (1):
>    virtio-blk: Fix clean up of host notifiers for single MR transaction.
> 
>   hw/block/dataplane/virtio-blk.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

r~



^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PULL 0/1] Block patches
@ 2021-12-06 15:27 Stefan Hajnoczi
  2021-12-06 21:16 ` Richard Henderson
  0 siblings, 1 reply; 40+ messages in thread
From: Stefan Hajnoczi @ 2021-12-06 15:27 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel
  Cc: Kevin Wolf, Paolo Bonzini, Hanna Reitz, Stefan Hajnoczi, qemu-block

The following changes since commit 99fc08366b06282614daeda989d2fde6ab8a707f:

  Merge tag 'seabios-20211203-pull-request' of git://git.kraxel.org/qemu into staging (2021-12-03 05:26:40 -0800)

are available in the Git repository at:

  https://gitlab.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to 5b807181c27a940a3a7ad1f221a2e76a132cbdc0:

  virtio-blk: Fix clean up of host notifiers for single MR transaction. (2021-12-06 14:21:14 +0000)

----------------------------------------------------------------
Pull request

----------------------------------------------------------------

Mark Mielke (1):
  virtio-blk: Fix clean up of host notifiers for single MR transaction.

 hw/block/dataplane/virtio-blk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.33.1




^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PULL 0/1] Block patches
  2021-10-21 22:08 ` Richard Henderson
@ 2021-10-25 10:10   ` Stefan Hajnoczi
  0 siblings, 0 replies; 40+ messages in thread
From: Stefan Hajnoczi @ 2021-10-25 10:10 UTC (permalink / raw)
  To: Richard Henderson
  Cc: Kevin Wolf, Peter Maydell, qemu-devel, qemu-block, Paolo Bonzini

[-- Attachment #1: Type: text/plain, Size: 2854 bytes --]

On Thu, Oct 21, 2021 at 03:08:56PM -0700, Richard Henderson wrote:
> On 10/21/21 10:41 AM, Stefan Hajnoczi wrote:
> > The following changes since commit afc9fcde55296b83f659de9da3cdf044812a6eeb:
> > 
> >    Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2021-10-20 06:10:51 -0700)
> > 
> > are available in the Git repository at:
> > 
> >    https://gitlab.com/stefanha/qemu.git tags/block-pull-request
> > 
> > for you to fetch changes up to 4b2b3d2653f255ef4259a7689af1956536565901:
> > 
> >    coroutine: resize pool periodically instead of limiting size (2021-10-21 18:40:07 +0100)
> > 
> > ----------------------------------------------------------------
> > Pull request
> > 
> > Performance optimization when guest applications submit a lot of parallel I/O.
> > This has also been found to improve clang SafeStack performance.
> > 
> > ----------------------------------------------------------------
> > 
> > Stefan Hajnoczi (1):
> >    coroutine: resize pool periodically instead of limiting size
> > 
> >   include/qemu/coroutine-pool-timer.h | 36 ++++++++++++++++
> >   include/qemu/coroutine.h            |  7 ++++
> >   iothread.c                          |  6 +++
> >   util/coroutine-pool-timer.c         | 35 ++++++++++++++++
> >   util/main-loop.c                    |  5 +++
> >   util/qemu-coroutine.c               | 64 ++++++++++++++++-------------
> >   util/meson.build                    |  1 +
> >   7 files changed, 125 insertions(+), 29 deletions(-)
> >   create mode 100644 include/qemu/coroutine-pool-timer.h
> >   create mode 100644 util/coroutine-pool-timer.c
> 
> This is causing
> 
>  (001/170) tests/acceptance/boot_linux.py:BootLinuxX8664.test_pc_i440fx_tcg:
> INTERRUPTED: Test interrupted by SIGTERM\nRunner error occurred: Timeout
> reached\nOriginal status: ERROR\n{'name':
> '001-tests/acceptance/boot_linux.py:BootLinuxX8664.test_pc_i440fx_tcg',
> 'logdir':
> '/home/richard.henderson/qemu/bld/tests/results/job-2021-10-21T20.58-ae0f6...
> (900.15 s)
>  (002/170) tests/acceptance/boot_linux.py:BootLinuxX8664.test_pc_i440fx_kvm:
> INTERRUPTED: Test interrupted by SIGTERM\nRunner error occurred: Timeout
> reached\nOriginal status: ERROR\n{'name':
> '002-tests/acceptance/boot_linux.py:BootLinuxX8664.test_pc_i440fx_kvm',
> 'logdir':
> '/home/richard.henderson/qemu/bld/tests/results/job-2021-10-21T20.58-ae0f6...
> (900.23 s)
> 
> I initially though this was just gitlab, but it reliably happens on my local machine as well.

Thanks, the coroutine pool timer commit in this pull request is broken.
Coroutines are created in one thread and then destroyed in another, so
the thread-local book keeping that assumed coroutines live in a single
thread was getting out of sync.

I will drop this pull request for now.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PULL 0/1] Block patches
  2021-10-21 17:41 Stefan Hajnoczi
@ 2021-10-21 22:08 ` Richard Henderson
  2021-10-25 10:10   ` Stefan Hajnoczi
  0 siblings, 1 reply; 40+ messages in thread
From: Richard Henderson @ 2021-10-21 22:08 UTC (permalink / raw)
  To: Stefan Hajnoczi, Peter Maydell, qemu-devel
  Cc: Kevin Wolf, Paolo Bonzini, qemu-block

On 10/21/21 10:41 AM, Stefan Hajnoczi wrote:
> The following changes since commit afc9fcde55296b83f659de9da3cdf044812a6eeb:
> 
>    Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2021-10-20 06:10:51 -0700)
> 
> are available in the Git repository at:
> 
>    https://gitlab.com/stefanha/qemu.git tags/block-pull-request
> 
> for you to fetch changes up to 4b2b3d2653f255ef4259a7689af1956536565901:
> 
>    coroutine: resize pool periodically instead of limiting size (2021-10-21 18:40:07 +0100)
> 
> ----------------------------------------------------------------
> Pull request
> 
> Performance optimization when guest applications submit a lot of parallel I/O.
> This has also been found to improve clang SafeStack performance.
> 
> ----------------------------------------------------------------
> 
> Stefan Hajnoczi (1):
>    coroutine: resize pool periodically instead of limiting size
> 
>   include/qemu/coroutine-pool-timer.h | 36 ++++++++++++++++
>   include/qemu/coroutine.h            |  7 ++++
>   iothread.c                          |  6 +++
>   util/coroutine-pool-timer.c         | 35 ++++++++++++++++
>   util/main-loop.c                    |  5 +++
>   util/qemu-coroutine.c               | 64 ++++++++++++++++-------------
>   util/meson.build                    |  1 +
>   7 files changed, 125 insertions(+), 29 deletions(-)
>   create mode 100644 include/qemu/coroutine-pool-timer.h
>   create mode 100644 util/coroutine-pool-timer.c

This is causing

  (001/170) tests/acceptance/boot_linux.py:BootLinuxX8664.test_pc_i440fx_tcg: INTERRUPTED: 
Test interrupted by SIGTERM\nRunner error occurred: Timeout reached\nOriginal status: 
ERROR\n{'name': '001-tests/acceptance/boot_linux.py:BootLinuxX8664.test_pc_i440fx_tcg', 
'logdir': '/home/richard.henderson/qemu/bld/tests/results/job-2021-10-21T20.58-ae0f6... 
(900.15 s)
  (002/170) tests/acceptance/boot_linux.py:BootLinuxX8664.test_pc_i440fx_kvm: INTERRUPTED: 
Test interrupted by SIGTERM\nRunner error occurred: Timeout reached\nOriginal status: 
ERROR\n{'name': '002-tests/acceptance/boot_linux.py:BootLinuxX8664.test_pc_i440fx_kvm', 
'logdir': '/home/richard.henderson/qemu/bld/tests/results/job-2021-10-21T20.58-ae0f6... 
(900.23 s)

I initially though this was just gitlab, but it reliably happens on my local machine as well.


r~




^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PULL 0/1] Block patches
@ 2021-10-21 17:41 Stefan Hajnoczi
  2021-10-21 22:08 ` Richard Henderson
  0 siblings, 1 reply; 40+ messages in thread
From: Stefan Hajnoczi @ 2021-10-21 17:41 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel
  Cc: Kevin Wolf, Paolo Bonzini, Stefan Hajnoczi, qemu-block

The following changes since commit afc9fcde55296b83f659de9da3cdf044812a6eeb:

  Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2021-10-20 06:10:51 -0700)

are available in the Git repository at:

  https://gitlab.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to 4b2b3d2653f255ef4259a7689af1956536565901:

  coroutine: resize pool periodically instead of limiting size (2021-10-21 18:40:07 +0100)

----------------------------------------------------------------
Pull request

Performance optimization when guest applications submit a lot of parallel I/O.
This has also been found to improve clang SafeStack performance.

----------------------------------------------------------------

Stefan Hajnoczi (1):
  coroutine: resize pool periodically instead of limiting size

 include/qemu/coroutine-pool-timer.h | 36 ++++++++++++++++
 include/qemu/coroutine.h            |  7 ++++
 iothread.c                          |  6 +++
 util/coroutine-pool-timer.c         | 35 ++++++++++++++++
 util/main-loop.c                    |  5 +++
 util/qemu-coroutine.c               | 64 ++++++++++++++++-------------
 util/meson.build                    |  1 +
 7 files changed, 125 insertions(+), 29 deletions(-)
 create mode 100644 include/qemu/coroutine-pool-timer.h
 create mode 100644 util/coroutine-pool-timer.c

-- 
2.31.1




^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PULL 0/1] Block patches
  2021-03-15  9:51 Stefan Hajnoczi
@ 2021-03-15 22:01 ` Peter Maydell
  0 siblings, 0 replies; 40+ messages in thread
From: Peter Maydell @ 2021-03-15 22:01 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: Kevin Wolf, Eduardo Habkost, Qemu-block, Michael S. Tsirkin,
	QEMU Developers, Max Reitz

On Mon, 15 Mar 2021 at 09:51, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>
> The following changes since commit 6157b0e19721aadb4c7fdcfe57b2924af6144b14:
>
>   Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-6.0-pull-=
> request' into staging (2021-03-14 17:47:49 +0000)
>
> are available in the Git repository at:
>
>   https://gitlab.com/stefanha/qemu.git tags/block-pull-request
>
> for you to fetch changes up to fb0b154c801e3447e505de420195fb7038695941:
>
>   virtio-blk: Respect discard granularity (2021-03-15 09:48:53 +0000)
>
> ----------------------------------------------------------------
> Pull request
>
> ----------------------------------------------------------------
>


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/6.0
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PULL 0/1] Block patches
@ 2021-03-15  9:51 Stefan Hajnoczi
  2021-03-15 22:01 ` Peter Maydell
  0 siblings, 1 reply; 40+ messages in thread
From: Stefan Hajnoczi @ 2021-03-15  9:51 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	Max Reitz, Stefan Hajnoczi

The following changes since commit 6157b0e19721aadb4c7fdcfe57b2924af6144b14:

  Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-6.0-pull-=
request' into staging (2021-03-14 17:47:49 +0000)

are available in the Git repository at:

  https://gitlab.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to fb0b154c801e3447e505de420195fb7038695941:

  virtio-blk: Respect discard granularity (2021-03-15 09:48:53 +0000)

----------------------------------------------------------------
Pull request

----------------------------------------------------------------

Akihiko Odaki (1):
  virtio-blk: Respect discard granularity

 include/hw/virtio/virtio-blk.h | 1 +
 hw/block/virtio-blk.c          | 8 +++++++-
 hw/core/machine.c              | 1 +
 3 files changed, 9 insertions(+), 1 deletion(-)

--=20
2.29.2


^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PULL 0/1] Block patches
  2021-01-04 14:23 Stefan Hajnoczi
@ 2021-01-04 17:17 ` Peter Maydell
  0 siblings, 0 replies; 40+ messages in thread
From: Peter Maydell @ 2021-01-04 17:17 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: QEMU Developers, Qemu-block

On Mon, 4 Jan 2021 at 14:23, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>
> The following changes since commit 41192db338588051f21501abc13743e62b0a5605:
>
>   Merge remote-tracking branch 'remotes/ehabkost-gl/tags/machine-next-pull-request' into staging (2021-01-01 22:57:15 +0000)
>
> are available in the Git repository at:
>
>   https://gitlab.com/stefanha/qemu.git tags/block-pull-request
>
> for you to fetch changes up to 593621f36b716eb091c4ec791db72dd4461789da:
>
>   readline: Fix possible array index out of bounds in readline_hist_add() (2021-01-04 11:13:39 +0000)
>
> ----------------------------------------------------------------
> Pull request
>
> ----------------------------------------------------------------


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/6.0
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PULL 0/1] Block patches
@ 2021-01-04 14:23 Stefan Hajnoczi
  2021-01-04 17:17 ` Peter Maydell
  0 siblings, 1 reply; 40+ messages in thread
From: Stefan Hajnoczi @ 2021-01-04 14:23 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Stefan Hajnoczi, qemu-block

The following changes since commit 41192db338588051f21501abc13743e62b0a5605:

  Merge remote-tracking branch 'remotes/ehabkost-gl/tags/machine-next-pull-request' into staging (2021-01-01 22:57:15 +0000)

are available in the Git repository at:

  https://gitlab.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to 593621f36b716eb091c4ec791db72dd4461789da:

  readline: Fix possible array index out of bounds in readline_hist_add() (2021-01-04 11:13:39 +0000)

----------------------------------------------------------------
Pull request

----------------------------------------------------------------

Alex Chen (1):
  readline: Fix possible array index out of bounds in
    readline_hist_add()

 util/readline.c | 3 +++
 1 file changed, 3 insertions(+)

-- 
2.29.2


^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PULL 0/1] Block patches
  2020-03-17 15:18 Stefan Hajnoczi
@ 2020-03-17 18:32 ` Peter Maydell
  0 siblings, 0 replies; 40+ messages in thread
From: Peter Maydell @ 2020-03-17 18:32 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: Kevin Wolf, Fam Zheng, QEMU Developers, Qemu-block, Max Reitz

On Tue, 17 Mar 2020 at 15:18, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>
> The following changes since commit 61c265f0660ee476985808c8aa7915617c44fd53:
>
>   Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20200313a' into staging (2020-03-13 10:33:04 +0000)
>
> are available in the Git repository at:
>
>   https://github.com/stefanha/qemu.git tags/block-pull-request
>
> for you to fetch changes up to 4ab78b19189a81038e744728ed949d09aa477550:
>
>   block/io: fix bdrv_co_do_copy_on_readv (2020-03-16 11:46:11 +0000)
>
> ----------------------------------------------------------------
> Pull request
>
> ----------------------------------------------------------------


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/5.0
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PULL 0/1] Block patches
@ 2020-03-17 15:18 Stefan Hajnoczi
  2020-03-17 18:32 ` Peter Maydell
  0 siblings, 1 reply; 40+ messages in thread
From: Stefan Hajnoczi @ 2020-03-17 15:18 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Fam Zheng, qemu-block, Peter Maydell, Max Reitz,
	Stefan Hajnoczi

The following changes since commit 61c265f0660ee476985808c8aa7915617c44fd53:

  Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20200313a' into staging (2020-03-13 10:33:04 +0000)

are available in the Git repository at:

  https://github.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to 4ab78b19189a81038e744728ed949d09aa477550:

  block/io: fix bdrv_co_do_copy_on_readv (2020-03-16 11:46:11 +0000)

----------------------------------------------------------------
Pull request

----------------------------------------------------------------

Vladimir Sementsov-Ogievskiy (1):
  block/io: fix bdrv_co_do_copy_on_readv

 block/io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.24.1


^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PULL 0/1] Block patches
  2020-01-14  9:30 Stefan Hajnoczi
@ 2020-01-14 16:00 ` Peter Maydell
  0 siblings, 0 replies; 40+ messages in thread
From: Peter Maydell @ 2020-01-14 16:00 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Kevin Wolf, QEMU Developers, Qemu-block, Max Reitz

On Tue, 14 Jan 2020 at 09:31, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>
> The following changes since commit dc65a5bdc9fa543690a775b50d4ffbeb22c56d6d:
>
>   Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.0-20200108' into staging (2020-01-10 16:15:04 +0000)
>
> are available in the Git repository at:
>
>   https://github.com/stefanha/qemu.git tags/block-pull-request
>
> for you to fetch changes up to 2558cb8dd4150512bc8ae6d505cdcd10d0cc46bb:
>
>   linux-aio: increasing MAX_EVENTS to a larger hardcoded value (2020-01-13 16:41:45 +0000)
>
> ----------------------------------------------------------------
> Pull request
>
> ----------------------------------------------------------------
>
> Wangyong (1):
>   linux-aio: increasing MAX_EVENTS to a larger hardcoded value
>
>  block/linux-aio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/5.0
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PULL 0/1] Block patches
@ 2020-01-14  9:30 Stefan Hajnoczi
  2020-01-14 16:00 ` Peter Maydell
  0 siblings, 1 reply; 40+ messages in thread
From: Stefan Hajnoczi @ 2020-01-14  9:30 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Peter Maydell, Stefan Hajnoczi, qemu-block, Max Reitz

The following changes since commit dc65a5bdc9fa543690a775b50d4ffbeb22c56d6d:

  Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.0-20200108' into staging (2020-01-10 16:15:04 +0000)

are available in the Git repository at:

  https://github.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to 2558cb8dd4150512bc8ae6d505cdcd10d0cc46bb:

  linux-aio: increasing MAX_EVENTS to a larger hardcoded value (2020-01-13 16:41:45 +0000)

----------------------------------------------------------------
Pull request

----------------------------------------------------------------

Wangyong (1):
  linux-aio: increasing MAX_EVENTS to a larger hardcoded value

 block/linux-aio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.24.1



^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PULL 0/1] Block patches
  2019-10-14  8:52 Stefan Hajnoczi
@ 2019-10-15 11:00 ` Peter Maydell
  0 siblings, 0 replies; 40+ messages in thread
From: Peter Maydell @ 2019-10-15 11:00 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: Fam Zheng, Kevin Wolf, Qemu-block, Michael S. Tsirkin,
	QEMU Developers, Max Reitz

On Mon, 14 Oct 2019 at 09:52, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>
> The following changes since commit 98b2e3c9ab3abfe476a2b02f8f51813edb90e72d:
>
>   Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging (2019-10-08 16:08:35 +0100)
>
> are available in the Git repository at:
>
>   https://github.com/stefanha/qemu.git tags/block-pull-request
>
> for you to fetch changes up to 69de48445a0d6169f1e2a6c5bfab994e1c810e33:
>
>   test-bdrv-drain: fix iothread_join() hang (2019-10-14 09:48:01 +0100)
>
> ----------------------------------------------------------------
> Pull request
>
> ----------------------------------------------------------------
>
> Stefan Hajnoczi (1):
>   test-bdrv-drain: fix iothread_join() hang
>

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/4.2
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PULL 0/1] Block patches
@ 2019-10-14  8:52 Stefan Hajnoczi
  2019-10-15 11:00 ` Peter Maydell
  0 siblings, 1 reply; 40+ messages in thread
From: Stefan Hajnoczi @ 2019-10-14  8:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Peter Maydell, qemu-block, Michael S. Tsirkin,
	Max Reitz, Stefan Hajnoczi, Kevin Wolf

The following changes since commit 98b2e3c9ab3abfe476a2b02f8f51813edb90e72d:

  Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging (2019-10-08 16:08:35 +0100)

are available in the Git repository at:

  https://github.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to 69de48445a0d6169f1e2a6c5bfab994e1c810e33:

  test-bdrv-drain: fix iothread_join() hang (2019-10-14 09:48:01 +0100)

----------------------------------------------------------------
Pull request

----------------------------------------------------------------

Stefan Hajnoczi (1):
  test-bdrv-drain: fix iothread_join() hang

 tests/iothread.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

-- 
2.21.0



^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2024-04-29 13:44 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-19 15:09 [PULL 0/1] Block patches Stefan Hajnoczi
2024-03-19 15:09 ` [PULL 1/1] coroutine: cap per-thread local pool size Stefan Hajnoczi
2024-03-19 15:14   ` Daniel P. Berrangé
2024-03-19 17:59     ` Stefan Hajnoczi
2024-03-19 19:11 ` [PULL 0/1] Block patches Peter Maydell
  -- strict thread matches above, loose matches on Subject: below --
2024-04-29 13:43 Stefan Hajnoczi
2024-02-06 15:31 Stefan Hajnoczi
2024-02-07 22:19 ` Kevin Wolf
2023-10-16 19:40 Stefan Hajnoczi
2023-10-04 13:53 Stefan Hajnoczi
2023-10-04 18:33 ` Stefan Hajnoczi
2023-07-12 19:36 Stefan Hajnoczi
2023-07-14  6:35 ` Richard Henderson
2023-07-04 15:29 Stefan Hajnoczi
2023-07-06  6:04 ` Richard Henderson
2022-09-22 17:14 Stefan Hajnoczi
2022-09-27 15:04 ` Stefan Hajnoczi
2022-05-25 12:49 Stefan Hajnoczi
2022-05-25 18:35 ` Richard Henderson
2021-12-09 15:21 Stefan Hajnoczi
2021-12-09 15:46 ` Peter Maydell
2021-12-09 16:34   ` Stefan Hajnoczi
2021-12-09 16:53     ` Richard Henderson
2021-12-13  9:33       ` Stefan Hajnoczi
2021-12-14 22:31 ` Richard Henderson
2021-12-06 15:27 Stefan Hajnoczi
2021-12-06 21:16 ` Richard Henderson
2021-10-21 17:41 Stefan Hajnoczi
2021-10-21 22:08 ` Richard Henderson
2021-10-25 10:10   ` Stefan Hajnoczi
2021-03-15  9:51 Stefan Hajnoczi
2021-03-15 22:01 ` Peter Maydell
2021-01-04 14:23 Stefan Hajnoczi
2021-01-04 17:17 ` Peter Maydell
2020-03-17 15:18 Stefan Hajnoczi
2020-03-17 18:32 ` Peter Maydell
2020-01-14  9:30 Stefan Hajnoczi
2020-01-14 16:00 ` Peter Maydell
2019-10-14  8:52 Stefan Hajnoczi
2019-10-15 11:00 ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.