LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Closed Thread
  Search this Thread
Old 01-14-2019, 08:41 AM   #1
somanyquestions
Member
 
Registered: Jan 2019
Distribution: Ubuntu, Debian, Buildroot
Posts: 34

Rep: Reputation: Disabled
CPU affinity, support for assigning processes - What kernel settings?


On an embedded Linux system, I want to execute a process or thread thereof steadily on a specific core.

I found the API functions sched_setaffinity and pthread_setaffinity_np for that.
The manpage for sched_setaffinity references the page for cpuset, on which it is stated that: there should be a "nodev cpuset" in /proc/filesystems, if CPUSET is supported.

I have here now 2 embedded systems, one with kernel 4.1.44 running on a dual core iMX6, and one with kernel 3.10 (Linux4Tegra) running on a Tegra TK1 board, quad core CPU.

On both systems, the "nodev cpuset" is *not* present.
Also, their files /proc/config.gz both have CONGIG_CPUSET disabled.
But: on the kernel 4.1 system, setting my process to core1 works and has a visible effect.
On the kernel 3.10 system, sched_setaffinity produces an error, invalid param.

Because I want to use the TK1 board, I was thinking about looking into how to compile a new Linux image with the CPUSET option enabled (using the board manufacturer's Yocto based stuff, never done that before).
But I am now doubting that this effort will yield success, as, by the above outlined seeming contradiction, my understanding of what's necessary for a Linux build to support the assigning of CPU affinities must be wrong.

Can someone tell me how it really is, exactly?


Background:
Say I have a program on an embedded Linux system with an ARM dual core processor, which does some comparably heavy data shoveling, receiving a lot of UDP packets. To prevent CPU core0 from ever maxing out on peaks and thus losing packets, I'd like to move my system calls (mainly just recv(socketFd...) )to core1, so core0 will be doing whatever the system does anyway when UDP packets arrive, and core1 takes care of the rest. And then for quad core, further processing gets done on cores2+3, such the first two will be stable.
 
Old 01-15-2019, 02:09 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CPU affinity, support for assigning processes - What kernel settings? somanyquestions Linux - Kernel 2 01-16-2019 03:34 AM
assigning value with read command vs assigning value with = sign bubai70 Linux - Server 1 12-11-2017 10:47 PM
LXer: How to Change CPU Affinity of CPU Intensive Multithreaded Applications (Ubuntu) LXer Syndicated Linux News 0 12-10-2012 12:10 PM
CPU binding - How to modify the CPU affinity mask? Thaidog Linux - General 1 03-15-2008 05:54 PM
CPU affinity on kernel 2.4.14-SMP tsik Linux - Kernel 0 11-05-2007 09:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 10:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration