[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 4/4] linux-aio: simplify removal of completed io
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH 4/4] linux-aio: simplify removal of completed iocbs from the list |
Date: |
Thu, 11 Dec 2014 14:22:13 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 11.12.2014 um 14:15 hat Paolo Bonzini geschrieben:
>
>
> On 11/12/2014 14:13, Kevin Wolf wrote:
> >> > +#define QSIMPLEQ_SPLIT_AFTER(head1, head2, elm, field) do {
> >> > \
> >> > + if (((head1)->sqh_first = (head2)->sqh_first) == NULL) {
> >> > \
> >> > + (head1)->sqh_last = &(head1)->sqh_first;
> >> > \
> >> > + } else {
> >> > \
> >> > + (head1)->sqh_last = &(elm)->field.sqe_next;
> >> > \
> >> > + if (((head2)->sqh_first = (elm)->field.sqe_next) == NULL) {
> >> > \
> >> > + (head2)->sqh_last = &(head2)->sqh_first;
> >> > \
> >> > + }
> >> > \
> >> > + }
> >> > \
> >> > +} while (/*CONSTCOND*/0)
> > Wouldn't it be easier to write a macro that doesn't split a queue in
> > two, but simply removes everything up to a given element?
>
> Yeah, though I figured that in the common case you'd have to free those
> elements or otherwise process them. But I left this patch last because
> I wasn't sure about the API. Feel free to ignore it, also given the
> above comment about EAGAIN.
I actually like the idea of this patch.
> > Anyway, if you really want to implement a split operation, I think you
> > also need to break the actual chain, i.e. (head1)->sqh_last.sqe_next =
> > NULL.
Can you please fix this one and send a v2?
The EAGAIN thing doesn't need to be fixed because it's ignored anyway. A
cleanup is unrelated and can be done later. As for the abort() in patch
2, I'll leave the decision to you.
Overall it looks like a nice series.
Kevin
[Qemu-devel] [PATCH 2/4] linux-aio: track whether the queue is blocked, Paolo Bonzini, 2014/12/10
[Qemu-devel] [PATCH 4/4] linux-aio: simplify removal of completed iocbs from the list, Paolo Bonzini, 2014/12/10
[Qemu-devel] [PATCH 3/4] linux-aio: rename LaioQueue idx field to "n", Paolo Bonzini, 2014/12/10