[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 1/6] blkdebug: refactor removal of a suspended request
From: |
Eric Blake |
Subject: |
Re: [PATCH v4 1/6] blkdebug: refactor removal of a suspended request |
Date: |
Tue, 8 Jun 2021 09:16:53 -0500 |
User-agent: |
NeoMutt/20210205 |
On Tue, Jun 08, 2021 at 10:00:01AM +0200, Emanuele Giuseppe Esposito wrote:
> > > Oh, I see - you abandon the iteration in all control flow paths, so
> > > the simpler loop is still okay. Still, this confused me enough on
> > > first read that it may be worth a comment, maybe:
> > >
> > > /* No need for _SAFE, because iteration stops on first hit */
> >
> > This is a bit confusing too because it sounds like not using _SAFE is an
> > optimization, but it's actually wrong (see commit message).
> >
>
> What about:
>
> /* No need for _SAFE, since a different coroutine can remove another node
> (not the current one) in this list, and when the current one is removed the
> iteration starts back from beginning anyways. */
Works for me, although you'll have to reformat it to pass syntax check.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[PATCH v4 3/6] blkdebug: track all actions, Emanuele Giuseppe Esposito, 2021/06/04
[PATCH v4 4/6] blkdebug: do not suspend in the middle of QLIST_FOREACH_SAFE, Emanuele Giuseppe Esposito, 2021/06/04
[PATCH v4 5/6] block/blkdebug: remove new_state field and instead use a local variable, Emanuele Giuseppe Esposito, 2021/06/04
[PATCH v4 6/6] blkdebug: protect rules and suspended_reqs with a lock, Emanuele Giuseppe Esposito, 2021/06/04
Re: [PATCH v4 6/6] blkdebug: protect rules and suspended_reqs with a lock, Paolo Bonzini, 2021/06/07