[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v10 for-xen-4.5 2/2] dpci: Replace tasklet with an softirq



>>> On 14.11.14 at 17:11, <konrad.wilk@xxxxxxxxxx> wrote:
> On Fri, Nov 14, 2014 at 03:13:42PM +0000, Jan Beulich wrote:
>> >>> On 12.11.14 at 03:23, <konrad.wilk@xxxxxxxxxx> wrote:
>> > +static void pt_pirq_softirq_reset(struct hvm_pirq_dpci *pirq_dpci)
>> > +{
>> > +    struct domain *d = pirq_dpci->dom;
>> > +
>> > +    ASSERT(spin_is_locked(&d->event_lock));
>> > +
>> > +    switch ( cmpxchg(&pirq_dpci->state, 1 << STATE_SCHED, 0) )
>> > +    {
>> > +    case (1 << STATE_SCHED):
>> > +        /*
>> > +         * We are going to try to de-schedule the softirq before it goes 
>> > in
>> > +         * STATE_RUN. Whoever clears STATE_SCHED MUST refcount the 'dom'.
>> > +         */
>> > +        put_domain(d);
>> > +        /* fallthrough. */
>> 
>> Considering Sander's report, the only suspicious place I find is this
>> one: When the STATE_SCHED flag is set, pirq_dpci is on some
>> CPU's list. What guarantees it to get removed from that list before
>> getting inserted on another one?
> 
> None. The moment that STATE_SCHED is cleared, 'raise_softirq_for'
> is free to manipulate the list.
> 
> We could:
>  - Add another bit, say STATE_ZOMBIE - which pt_pirq_softirq_reset could
>    set, and dpci_softirq - if it sees it - would clear. Said bit
>    would stop 'raise_softirq_for' from trying to do anything.

Pretty ugly. I guess I'll have to think about this some more early
next week, unless you or someone else has an idea for a less
convoluted solution. And I'm not at all certain this is what is
causing Sander's issue (that's why I asked whether the guests
were booting or shutting down, which he said they weren't), as
it was my understanding so far that this reset mechanism would
come into play only when tearing down guest IRQs. I.e. handing
him a debugging patch to understand what's going on might be
the better first step anyway.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.