* Re: [PATCH 0/2][RT] powerpc - fix bug in irq reverse mapping radix tree
[not found] <20080723165932.57e3ada2@bull.net>
@ 2008-07-23 22:17 ` Benjamin Herrenschmidt
2008-07-24 11:08 ` Sebastien Dugue
0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2008-07-23 22:17 UTC (permalink / raw)
To: Sebastien Dugue
Cc: Linux RT Users, linux-kernel, linuxppc-dev, Tim Chavez,
Jean Pierre Dion, Gilles Carry, paulus, michael
> The root cause of this bug lies in the fact that the XICS interrupt controller
> uses a radix tree for its reverse irq mapping and that we cannot allocate the tree
> nodes (even GFP_ATOMIC) with preemption disabled.
Is that yet another caes of -rt changing some basic kernel semantics ?
> In fact, we have 2 nested preemption disabling when we want to allocate
> a new node:
>
> - setup_irq() does a spin_lock_irqsave() before calling xics_startup() which
> then calls irq_radix_revmap() to insert a new node in the tree
>
> - irq_radix_revmap() also does a spin_lock_irqsave() (in irq_radix_wrlock())
> before the radix_tree_insert()
>
> The first patch moves the call to irq_radix_revmap() from xics_startup() out to
> xics_host_map_direct() and xics_host_map_lpar() which are called with preemption
> enabled.
I suppose that would work.
> The second patch is a little more involved in that it takes advantage of
> the concurrent radix tree to simplify the locking requirements and allows
> to allocate a new node outside a preemption disabled section.
>
> I just hope I've correctly understood the concurrent radix trees semantic
> and got the (absence of) locking right.
Hrm, that will need some scrutinity.
Thanks for looking at this.
Cheers,
Ben.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 0/2][RT] powerpc - fix bug in irq reverse mapping radix tree
2008-07-23 22:17 ` [PATCH 0/2][RT] powerpc - fix bug in irq reverse mapping radix tree Benjamin Herrenschmidt
@ 2008-07-24 11:08 ` Sebastien Dugue
0 siblings, 0 replies; 2+ messages in thread
From: Sebastien Dugue @ 2008-07-24 11:08 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: Linux RT Users, linux-kernel, linux-ppc, Tim Chavez,
Jean Pierre Dion, Gilles Carry, Paul Mackerras, Michael Ellerman
On Thu, 24 Jul 2008 08:17:38 +1000 Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> > The root cause of this bug lies in the fact that the XICS interrupt controller
> > uses a radix tree for its reverse irq mapping and that we cannot allocate the tree
> > nodes (even GFP_ATOMIC) with preemption disabled.
>
> Is that yet another caes of -rt changing some basic kernel semantics ?
Ahem, not really new: http://lkml.org/lkml/2007/11/12/211
>
> > In fact, we have 2 nested preemption disabling when we want to allocate
> > a new node:
> >
> > - setup_irq() does a spin_lock_irqsave() before calling xics_startup() which
> > then calls irq_radix_revmap() to insert a new node in the tree
> >
> > - irq_radix_revmap() also does a spin_lock_irqsave() (in irq_radix_wrlock())
> > before the radix_tree_insert()
> >
> > The first patch moves the call to irq_radix_revmap() from xics_startup() out to
> > xics_host_map_direct() and xics_host_map_lpar() which are called with preemption
> > enabled.
>
> I suppose that would work.
It should indeed. Instead of inserting the new mapping at request_irq() time,
we do it a bit before at create_irq_mapping time.
>
> > The second patch is a little more involved in that it takes advantage of
> > the concurrent radix tree to simplify the locking requirements and allows
> > to allocate a new node outside a preemption disabled section.
> >
> > I just hope I've correctly understood the concurrent radix trees semantic
> > and got the (absence of) locking right.
>
> Hrm, that will need some scrutinity.
Yep, that will need a few more pair of eyes along with brains behind those ;-)
Thanks,
Sebastien.
>
> Thanks for looking at this.
>
> Cheers,
> Ben.
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-24 11:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20080723165932.57e3ada2@bull.net>
2008-07-23 22:17 ` [PATCH 0/2][RT] powerpc - fix bug in irq reverse mapping radix tree Benjamin Herrenschmidt
2008-07-24 11:08 ` Sebastien Dugue
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome