Questions: Processor Affinity and CPU Binding

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

A web server process runs for 10ms on Core 2, gets preempted, and the scheduler migrates it to Core 5. What is the primary performance cost of this migration?

ACore 5 runs at a lower clock speed than Core 2
BThe process must rebuild its working set in Core 5's cache, fetching data from slower shared cache or main memory
CMigrating a process requires copying its memory to Core 5's local memory bank
DThe scheduler takes longer to dispatch on Core 5 because it must load new CPU state
Question 2 Multiple Choice

On a 2-socket NUMA server, a database process is pinned to cores on socket 0 but its data buffers were allocated in socket 1's memory. What is the consequence?

AThe process cannot access socket 1's memory and will crash
BEvery memory access must cross the inter-socket interconnect, incurring 2–3x the latency of local memory access
CThe OS will automatically migrate the data to socket 0's memory over time
DPerformance is identical because modern NUMA systems use cache coherence to hide the difference
Question 3 True / False

Processor affinity improves performance by preventing the OS scheduler from migrating a process to a CPU whose cache does not contain the process's working set.

TTrue
FFalse
Question 4 True / False

Hard affinity is generally preferable to soft affinity because it guarantees the process generally runs on a warm cache.

TTrue
FFalse
Question 5 Short Answer

Why is processor affinity described as preventing the scheduler from 'undoing' something the hardware has already built up? What has the hardware built up, and how does migration undo it?

Think about your answer, then reveal below.