Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I just encountered a new concept today, 'processor affinity', which is related to how the processes in a system utilizes the available sockets/cpus/cores of a hardware. This made me think about how Linux could utilize the available resources of a system.
Since I am not that much familiar with how the linux kernel works on hardware, I came up with the following questions:
1. As I add more CPUs or upgrade an existing CPU with more cores, would the kernel automatically recognize the changes and utilize all available resources?
2. If not, should I be making any tweaks, probably recompile the kernel?
3. Suppose my CPU utilization is 50% on only 1 core of 1 CPU, and I have 4 CPUs with 4 cores each, is it safe that i set the processor affinity of my OS to utilize all the CPUs and all their cores? Would this affect the processes owned by the applications running on my system?
4. Or is there any need to do #3?
Please take the above concept from the context of an enterprise server.
Additionally, suppose I have a process (which typically runs for 1 hour), and it currently runs on only 1 core on 1 CPU, if I decide to distribute the processing on multiple cores, would the process run faster? or would the interprocess communication still result to a 1 hour processing?
1. Yes - if using a SMP-aware kernel. That is, almost every distros released in the last few years.
2. n/a
3. the kernel will handle it automatically. Much better than any of us could.
4. no
Properly constructed multi-processing (aka multi-threaded) code will run significantly faster in almost all cases. Poorly designed code may have race and/or locking issues that may not only slow things down, but make it (much) worse.
If it's your own code, the proper design is your responsibility.
1. Yes - if using a SMP-aware kernel. That is, almost every distros released in the last few years.
2. n/a
3. the kernel will handle it automatically. Much better than any of us could.
4. no
Properly constructed multi-processing (aka multi-threaded) code will run significantly faster in almost all cases. Poorly designed code may have race and/or locking issues that may not only slow things down, but make it (much) worse.
If it's your own code, the proper design is your responsibility.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.