change smp_affinity from linux device driver

爷,独闯天下 提交于 2019-12-11 09:31:34

问题


If I examine the

cat /proc/interrupts 

command, all the IRQs are listed under cpu0 in SMP system. I can change the smp_affinity mask to tag the IRQ to particular CPU using following command.

 echo "4" > /proc/irq/230/smp_affinity

Above command sets the affinity mask of the interrupt 230 to CPU 2.

I would like achieve same from linux kernel module. How can I do this?
I see create_proc_entry method which allows to create new proc entry.
Is there any method which we can use to write existing proc entry?


回答1:


In a kernel module you can just call the kernel API function irq_set_affinity(...) directly. No need to go through /proc. See: http://lxr.free-electrons.com/source/kernel/irq/manage.c#L189



来源:https://stackoverflow.com/questions/11858487/change-smp-affinity-from-linux-device-driver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!