lkcd
[Top] [All Lists]

Re: Non disruptive dumps -- current work.

To: "Matt D. Robinson" <yakker@xxxxxxxxxxxxxx>
Subject: Re: Non disruptive dumps -- current work.
From: Bharata B Rao <bharata@xxxxxxxxxx>
Date: Tue, 18 Sep 2001 11:13:45 +0530
Cc: lkcd@xxxxxxxxxxx
In-reply-to: <3BA68AF8.1CC7259A@xxxxxxxxxxxxxx>; from yakker@xxxxxxxxxxxxxx on Mon, Sep 17, 2001 at 04:44:56PM -0700
References: <20778.1000544488@xxxxxxxxxxxxxxxxxxxxx> <3BA3DB73.F731D08F@xxxxxxxxxxxxxx> <3BA68AF8.1CC7259A@xxxxxxxxxxxxxx>
Reply-to: bharata@xxxxxxxxxx
Sender: owner-lkcd@xxxxxxxxxxx
User-agent: Mutt/1.2.5i
On Mon, Sep 17, 2001 at 04:44:56PM -0700, Matt D. Robinson wrote:
> Just an FYI for folks following this, the setup_IO_APIC_irqs()
> mechanism doesn't work (it fails miserably, actually).  I'm going
> to try something similar to the following:
> 
> int __dump_cpu_disable(unsigned int dumping_cpu)
> {
>     int i;
>     unsigned long val, cpu = smp_processor_id();
>     if ((cpu == 0) || (cpu == dumping_cpu)) return -EINVAL;
>     clear_bit(cpu, &cpu_online_map);
>     mb();
>     /* first, move everyone to the dumping CPU */
>     for (i = 0; i < NR_IRQS; i++) {
>         if (irq_desc[i].handler == NULL) continue;
>         val = irq_affinity[i];
>         if (val & (1 << cpu)) {
>             if (!(val & cpu_online_map))
>                 val = (1 << dumping_cpu);
>             else
>                 val = val & ~(1 << cpu);
>             irq_affinity[i] = val;
>             if (irq_desc[i].handler->set_affinity != NULL)
>                 irq_desc[i].handler->set_affinity(i, val);
>         }
>     }
>  
>     cli();
>     sti();
>     return 0;
> }

Will this fuction be called for each cpu ? If so won't you be going through
the loop of NR_IRQS for all cpus ? Can't the affinities of all irqs be changed
to that of dumping cpu at one go ? Something like this,

{
        .
        .
        int cpu = smp_processor_id();
        for (i = 0; i < NR_IRQS; i++) {
                if (irq_desc[i].handler == NULL)
                        continue;
                irq_affinity[i] = 1UL << cpu;
                if (irq_desc[i].handler->set_affinity != NULL)
                        irq_desc[i].handler->set_affinity(i, irq_affinity[i]);
        }
}

> 
> That last wierd cli()/sti() is supposed to catch a case where
> IRQs may be running with interrupts disabled, and they haven't
> quite flushed out yet.
> 
> Note that this doesn't take care of spinning the CPUs.
> Something else has to be added for that case.  Most of this
> comes from Rusty's __cpu_disable(), but changed so that it
> doesn't randomly pass irqs to any CPU, and takes a dumping
> CPU argument.
> 
> --Matt

Regards,
Bharata.
-- 
Bharata B Rao,
IBM Linux Technology Center,
IBM Software Lab, Bangalore.

Ph: 91-80-5262355 Ex: 3962
Mail: bharata@xxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>