All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/1] Fix race condition in throttle_group_restart_queue()
@ 2026-03-12 11:08 Alberto Garcia
  2026-03-12 11:08 ` [PATCH v2 1/1] throttle-group: " Alberto Garcia
  0 siblings, 1 reply; 2+ messages in thread
From: Alberto Garcia @ 2026-03-12 11:08 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alberto Garcia, Jorge Merlino, Kevin Wolf, qemu-block,
	Hanna Czenczek

Hi,

here's version two of the patch. The important change is that now
throttle_group_restart_tgm() is protected by tg->lock and there's new
logic there.

Note that in case (2) it is theoretically possible for two different
tgms to run throttle_group_restart_queue() in parallel, but I think
this is safe because the actual restart of the queue is once more
protected by the lock.

The alternative that I initially considered (doing nothing if another
tgm is waiting for a timer) is probably not a good idea because
throttle_group_restart_tgm() is used by callers who want to drain a
tgm so I think that the requests should be processed immediately:

    if (qatomic_fetch_inc(&tgm->io_limits_disabled) == 0) {
        throttle_group_restart_tgm(tgm);
    }

Once more, please test this carefully to see if it solves issue #3194.
I have only run the basic qemu iotests and I haven't touched this code
in a long time :)

Regards,

Berto

Alberto Garcia (1):
  throttle-group: Fix race condition in throttle_group_restart_queue()

 block/throttle-groups.c | 70 +++++++++++++++++++++++++++++++----------
 1 file changed, 54 insertions(+), 16 deletions(-)

-- 
2.47.3



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

end of thread, other threads:[~2026-03-12 11:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-12 11:08 [PATCH v2 0/1] Fix race condition in throttle_group_restart_queue() Alberto Garcia
2026-03-12 11:08 ` [PATCH v2 1/1] throttle-group: " Alberto Garcia

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.