Re: Setting CPU affinity for current process on kernel module?

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

 



On Wed, Sep 11, 2019 at 03:52:06PM -0300, Martin Galvan wrote:
> Hi,
> 
> I have a kernel module which needs to perform CPU core-specific
> operations. I know that there's a kernel mode version of
> sched_setaffinity, however it's not exported to modules and can only
> be accessed through e.g. kallsyms_lookup_name, which is ugly. The
> alternative is to spawn a new kthread and bind it to the desired CPU
> before starting it, but I was wondering if there's a more
> straightforward method of doing this. Thanks!
> 
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@xxxxxxxxxxxxxxxxx
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
So one thing that pops to my head is using cgroups. Create a cgroup,
modify the cpu file in cpusets cgroup and add the required task to it.
But I am not sure whether you can do all of this from a kernel module...

Thanks
Bharath

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[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