[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [Qemu-devel] [PATCH 1/6] xics: add flags for interrupts
From: |
Mike Day |
Subject: |
Re: [Qemu-ppc] [Qemu-devel] [PATCH 1/6] xics: add flags for interrupts |
Date: |
Fri, 9 May 2014 08:20:43 -0400 |
On Thu, May 8, 2014 at 11:12 PM, Alexey Kardashevskiy <address@hidden> wrote:
>> There are
>> a couple ways to mitigate this type of situation by using alternative
>> data structures to inform the loop traversal. I don't know if it is
>> worth the effort, though.
>
> Here I lost you :)
If I read the code correctly, the problem I'm wondering about is that
the loop will waste time traversing the array when there are only
unallocated interrupts from the current index to the end. For example,
if the interrupt array is 256 entries and the highest index that is
allocated is 16, the outside loop will traverse all 256 entries while
it should have exited after the 16th.
To mitigate this you could keep a shadow index of the current highest
allocated index and check for that in the outside loop. Or you could
maintain a shadow linked list that only includes allocated array
entries and just traverse that list. Each element on the list would be
an allocated entry in the interrupt array.
> btw I just realized that in patch#2 it should be xics_find_source instead
> of xics_find_server. There are many interrupt servers already and just one
> interrupt source (we could have many like one per PHB or something like
> that but we are not there yet), this is what I meant.
- [Qemu-ppc] [PATCH 0/6] move interrupts from spapr to xics, Alexey Kardashevskiy, 2014/05/07
- [Qemu-ppc] [PATCH 2/6] xics: add find_server, Alexey Kardashevskiy, 2014/05/07
- [Qemu-ppc] [PATCH 3/6] xics: disable flags reset on xics reset, Alexey Kardashevskiy, 2014/05/07
- [Qemu-ppc] [PATCH 4/6] spapr: move interrupt allocator to xics, Alexey Kardashevskiy, 2014/05/07
- [Qemu-ppc] [PATCH 1/6] xics: add flags for interrupts, Alexey Kardashevskiy, 2014/05/07
- Re: [Qemu-ppc] [PATCH 1/6] xics: add flags for interrupts, Alexander Graf, 2014/05/08
- [Qemu-ppc] [PATCH 5/6] spapr: remove @next_irq, Alexey Kardashevskiy, 2014/05/07
- [Qemu-ppc] [PATCH 6/6] xics: implement xics_ics_free(), Alexey Kardashevskiy, 2014/05/07