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
2
votes
3 answers

Problem of sorting OpenMP threads into NUMA nodes by experiment

I'm attempting to create a std::vector> with one set for each NUMA-node, containing the thread-ids obtained using omp_get_thread_num(). Topo: Idea: Create data which is larger than L3 cache, set first touch using thread 0, perform…
Nitin Malapally
  • 534
  • 2
  • 10
2
votes
1 answer

Set Java Multithreading Affinity

I'm using IntelliJ with the ForkJoin framework, and am trying to benchmark two versions of my code. One is using forkjoin, one is sequential. Unfortunately, it seems that the JDK/Windows auto-distribute the sequential one across 4 cores to a…
Jana Mandic
  • 115
  • 6
2
votes
5 answers

These days, what are good reasons for setting thread affinity rather than leaving it to the OS?

Searching answers here for "thread affinity", I see a lot of interest in doing it but little justification for it save possibly getting stable QueryPerformanceTimer results. Assuming a modern OS and a modern 2-4 socket workstation/server class…
timday
  • 24,582
  • 12
  • 83
  • 135
2
votes
1 answer

Python multithreading/multiprocessing & limiting CPU core affinity

In Python, you can create new threads and processes to run a given task with multiprocessing.Pool, multiprocessing.ThreadPool, concurrent.futures.ProcessPoolExecutor, and concurrent.futures.ThreadPoolExecutor. By default, those threads/processes run…
2
votes
1 answer

Kubernetes anti-affinity rule to spread Deployment Pods to at least 2 nodes

I have the following anti-affinity rule configured in my k8s Deployment: spec: ... selector: matchLabels: app: my-app environment: qa ... template: metadata: labels: app: my-app environment: qa …
2
votes
1 answer

Setting Affinity of an Application on cmd

I have this problem when I'm using Voicemeeter and Discord together, my voice is just crackling and cutting out. I found out the solution to this problem. It's by going to the task manager, heading to details, right clicking audiodg.exe, and then…
2
votes
1 answer

Is CPU affinity enforced across system calls?

So if I set a process's CPU affinity using: sched_setaffinity() and then perform some other system call using that process, is that system call ALSO guaranteed to execute on the same CPU enforced by sched_setaffinity? Essentially, I'm trying to…
Roguebantha
  • 814
  • 4
  • 19
2
votes
1 answer

Check value of PF_NO_SETAFFINITY

Is it possible to tell whether a process/thread has the PF_NO_SETAFFINITY flag set? I'm running taskset on a series of process ids and some are throwing errors of the following form: taskset: failed to set pid 30's affinity: Invalid argument I…
Will
  • 1,171
  • 2
  • 14
  • 26
2
votes
1 answer

Set the process affinity on a large number of processes

I'm running taskset over a large number of pids (500+). The total time is 30s+. Is there a fast way to set many pids to the same cpu? It doesn't improve performance much to run the taskset processes in parallel.[1] Thanks! [1] I tried both…
Will
  • 1,171
  • 2
  • 14
  • 26
2
votes
3 answers

Colocate pods in Kubernetes

I have a kubernetes cluster which is spread across 2 zones- zone1 and zone2. I have 2 applications- a web application and a database. The web application's configurations are stored in the database. Both the application as well as the database are…
Rana
  • 41
  • 8
2
votes
0 answers

Forcing affinity of a program to a certain CPU (big.LITTLE) core irrevocably [C]

I have 8 CPUs being implemented on ARM's big.LITTLE archiectuture. 0-3 as LITTLE CPUs and 4-7 as big CPUs. I am trying to set the CPU affinity of an executing program using the following code: // Set CPU affinity to multiple cores void…
Somdip Dey
  • 3,346
  • 6
  • 28
  • 60
2
votes
1 answer

How do I replace SetProcessAffinityMask()/GetProcessAffinityMask() for systems with more than 32 cores?

SetProcessAffinityMask() function accepts a DWORD mask so it can't be used correctly on systems with more than 32 processors. Looks like SetThreadGroupAffinity() is intended to somehow address the problem, but I can' find any useful code samples…
sharptooth
  • 167,383
  • 100
  • 513
  • 979
2
votes
1 answer

How to use all NUMA nodes with openMP on Windows 10

I have access to a dual-socket system consisting of two NUMA nodes to do some data processing. My code is relatively straightforward and I'm using openMP for a main parallelizable loop that looks like this (k is a function parameter and buffer is a…
JeanOlivier
  • 302
  • 2
  • 17
2
votes
2 answers

Pinning a process to any CPU respecting affinity

Let's say I want to programmatically pin the current process to a single CPU, but I don't care which CPU that is. One easy way to use sched_setaffinity with a fixed CPU number, probably 0 since there should always be a "CPU 0"1. However, this…
BeeOnRope
  • 60,350
  • 16
  • 207
  • 386
2
votes
0 answers

Linux cpu hotplug not working as expected

I'm testing linux cpu hotpluging on normal 4-core ARM based on Android 8.1 kernel 4.4 sys. Problem seems that after onlining a CPU again taskset and kernel refuses to move and/or schedule any tasks on the core. E.g. doing: echo 0 >…
Xenen GLiu
  • 21
  • 1