Re: Unable to change IRQ affinity

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

 



On Thu, Apr 8, 2010 at 8:21 AM, Abraham Arce
<abraham.arce.moreno@xxxxxxxxx> wrote:
> Hi,
>
> I've been working with 2 drivers, an i2c based touchcreen and a spi
> based ethernet. My problem comes when I try to change the affinity for
> their irqs to be handled by processor 2, change is not reflected, for
> the ethernet I have...
>
>   # cat /proc/interrupts | grep eth0
>   194:       4883          0        GPIO  eth0
>   # cat /proc/irq/194/smp_affinity
>   3
>   # echo 1 > /proc/irq/194/smp_affinity
>   # cat /proc/irq/194/smp_affinity
>   3

Notice the creation read/write attributes:

./irq/proc.c:
	proc_create_data("smp_affinity", 0600, desc->dir,
	proc_create("irq/default_smp_affinity", 0600, NULL,

0600 means read-only by root.   0666 means read-only by everyone.

>
> Is there any flag needed in the irq handler to allow the affinity? I
> have tested the irq affinity for a keypad driver and it is working as
> expected...
>

logically, i don't think you aim is achieveable.   reason being that
the keypad driver is a kernel thread by itself, and so can be assigned
to a specific CPU.   (similarly for another non-performance critical
driver:  kpsmoused - which is created as a workqueue:

	kpsmoused_wq = create_singlethread_workqueue("kpsmoused");

since "ps -ef" gave only on kernel thread listed, I supposed it is
possible to assign CPU affinity to this thread.

But ethernet IRQ processing is performance critical, and it is done
inside the ksoftirqd thread, and so ksoftirqd is per-CPU.

inside run_softirqd() there is a CPU turning-on-off throttling mechanism:

                while (local_softirq_pending()) {
                        /* Preempt disable stops cpu going offline.
                           If already offline, we'll be on wrong CPU:
                           don't process */
                        if (cpu_is_offline((long)__bind_cpu))
                                goto wait_to_die;
                        do_softirq();
                        preempt_enable_no_resched();
                        cond_resched();
                        preempt_disable();
                        rcu_sched_qs((long)__bind_cpu);
                }

But when u turned off the CPU all jobs are not run as well.   i
guessed it is just too much work and not worth the effort to do such
fine tuning....




-- 
Regards,
Peter Teoh

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux