Port-amd64 archive

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

Re: Interrupt routing patch for testing



On Sat, May 10, 2008 at 12:13:53AM +0200, Joerg Sonnenberger wrote:
> On Fri, May 09, 2008 at 10:33:57PM +0100, Andrew Doran wrote:
> > On Thu, May 08, 2008 at 11:12:19PM +0200, Joerg Sonnenberger wrote:
> > 
> > >  intr_allocate_slot_cpu(struct cpu_info *ci, struct pic *pic, int pin,
> > >                  int *index)
> > >  {
> > > - int start, slot, i;
> > > + int slot, i;
> > >   struct intrsource *isp;
> > >  
> > > - start = CPU_IS_PRIMARY(ci) ? NUM_LEGACY_IRQS : 0;
> > > - slot = -1;
> > > + if (pic == &i8259_pic) {
> > > +         if (!CPU_IS_PRIMARY(ci))
> > > +                 return EBUSY;
> > 
> > ENODEV is more accurate. I haven't checked the callers.
> 
> I think it just migrates up. I'll change it to ENODEV.
> 
> > FWIW, the locking in intr.c isn't very good. We'll also need to look at
> > having an IPI or other mechanism like RCU's patent-free predecessor make the
> > updates safe on a running system.
> 
> Yeah, I know. I'm thinking about dropping the linked list and just use a
> dynamic array. If you give me something to lazily free it e.g. after a
> roundtrip over all CPUs, we are done.

You can already do it !lazily, with a level of expense that is fine for
device attach or detach:

        where = xc_broadcast(0, (xcfunc_t)nullop, NULL, NULL);
        xc_wait(where);

I think the above falls under this now lapsed patent:

        http://www.google.com/patents?id=E14WAAAAEBAJ&dq=4809168

When reading 'processes' bear in mind that the patent isn't about Unix and
buried in the text it explicitly says that processes could mean CPUs.

Andrew


Home | Main Index | Thread Index | Old Index