Questions tagged [affinity]

Anything related to processor affinity, also known as CPU pinning. The processor affinity is a propriety of a process or a thread in an OS on multi-processor or multi-core systems that influences the OS' scheduling algorithm, binding the execution of that process (or thread) to a specific processor (or core). DO NOT use this tag as a synonym for [affinetransform] tag.

330 questions
4
votes
1 answer

How can I ensure that a process runs in a specific physical CPU core and thread?

This question asks about ensuring two processes run on the same CPU. Using sched_setaffinity I can limit a process to a number of logical CPUs, but how can I ensure that these are mapped to specific physical CPUs and threads? I expect that the…
Nathan Fellman
  • 122,701
  • 101
  • 260
  • 319
4
votes
2 answers

Performance of running a multithreaded program on a single core by setting affinity?

In short: Under what scenarios can running a multithreaded app on a single core destroy performance? What about setting the affinity of a multithreaded app to only use one core? In long: I'm trying to run the physics of a 2D engine on it's own…
NaturalDre
  • 181
  • 4
  • 9
4
votes
3 answers

Kubernetes Pod anti-affinity - evenly spread pods based on a label?

We are finding that our Kubernetes cluster tends to have hot-spots where certain nodes get far more instances of our apps than other nodes. In this case, we are deploying lots of instances of Apache Airflow, and some nodes have 3x more web or…
John Humphreys
  • 37,047
  • 37
  • 155
  • 255
4
votes
1 answer

Intel OpenMP library slows down memory bandwidth significantly on AMD platforms by setting KMP_AFFINITY=scatter

For memory-bound programs it is not always faster to use many threads, say the same number as the cores, since threads may compete for memory channels. Usually on a two-socket machine, less threads are better but we need to set affinity policy that…
AeroD
  • 53
  • 7
4
votes
3 answers

Benchmarking processor affinity impact

I'm working on a NUMA architecture, where each compute node has 2 sockets and 4 cores by socket, for a total of 8 cores by compute node, and 24GB of RAM by node. I have to proof that setting processor affinity can have a significant impact on…
Charles Brunet
  • 21,797
  • 24
  • 83
  • 124
4
votes
2 answers

Is Core Affinity Something that We Can Safely Do in .NET?

I have looked here in StackOverflow for information implementing Core Affinity for a Thread, in .NET. Some answers say that .NET does not support it for its own (managed) threads, and only supports it for the non-managed threads running on the…
spaceman
  • 1,061
  • 1
  • 11
  • 31
4
votes
2 answers

Is it possible to prevent children inheriting the CPU/core affinity of the parent?

I'm particularly interesting in doing this on Linux, regarding Java programs. There are already a few questions that say you have no control from Java, and some RFEs closed by Sun/Oracle. If you have access to source code and use a low-level…
Sam Brightman
  • 2,831
  • 4
  • 36
  • 38
4
votes
1 answer

Office 365 EWS does not return X-BackendOverrideCookie

Office 365 does not return the X-BackendOverrideCookie in response headers. I set the X-AnchorMailbox and X-PreferServerAffinity in the request headers properly. This does not trigger X-BackendOverrideCookie to be returned, as it says in MSDN. Why…
4
votes
2 answers

Ada program works in Linux but not in GPS Windows 10

Thanks in advance for any help. I am currently doing some beginner work on ada programming and I have installed GNAT Programming Studio (GPS) from http://libre.adacore.com/download/configurations# I have Windows 10 64-bits. I was given the following…
4
votes
0 answers

Equivalences in omp_places?

I'm having some trouble with omp_places and seem to find contradictory information From http://openmp.org/mp-documents/OpenMP_Examples_4.0.1.pdf I find that: omp_places={0:2}:8:2 is equivalent to: …
Tue
  • 371
  • 1
  • 14
4
votes
1 answer

Why does NextValue call of performanceCounter change thread affinity mask

I have a C# project, where I have to both access the current workload of my processor, and ensure, that I run some specific code on every kernel of the processor. My problem is, that accessing the workload of my processor seems to prevent me from…
Boris
  • 5,094
  • 4
  • 45
  • 71
4
votes
1 answer

Set cpu affinity on a loadable linux kernel module

I need to create a kernel module that enables ARM PMU counters on every core in the computer. I have trouble setting the cpu affinity. Ive tried sched_get_affinity, but apparently, it only works for user space processes. My code is below. Any…
4
votes
1 answer

Do the changes to cpumask using sched_setaffinity() take place immediately

I am writing a linux kernel module that needs to pin two threads on two different cpus. I am planning to use sched_setaffinity() after exporting it in the kernel. Is there any other exported function for the same ? Also, if I set only 1 CPU in the…
Sukanto
  • 992
  • 3
  • 11
  • 21
4
votes
1 answer

How to use Java Native Access to set process affinity for processes besides Java.exe?

Although it is fairly easy to do manually, I am attempting to automate the setting of cpu affinity in Windows 7 for various VMs after their initial creation time. The project is in Java and I am trying to avoid directly including C code, so I have…
4
votes
0 answers

to do or not to: modifying thread affinity to improve performance

I have a math-intensive Android application here that does realtime audio generation. It generates sound data and this process is difficult if not impossible to modify to support multithreading. The test systems are ARM-based quad core CPUs (Nexus…
Lyve
  • 218
  • 1
  • 11