Chapter 25. Improving CPU performance by using RCU callbacks
RCU) system is a lockless mechanism for mutual exclusion of threads inside the kernel. As a consequence of performing RCU operations, call-backs are sometimes queued on CPUs to be performed at a future moment when removing memory is safe.
To improve CPU performance using RCU callbacks:
- You can remove CPUs from being candidates for running CPU callbacks.
- You can assign a CPU to handle all RCU callbacks. This CPU is called the housekeeping CPU.
- You can relieve CPUs from the responsibility of awakening RCU offload threads.
This combination reduces the interference on CPUs that are dedicated for the user’s workload.
- You have administrator privileges.
tunapackage is installed
25.1. Offloading RCU callbacks
You can offload
RCU callbacks using the
rcu_nocb_poll kernel parameters.
To remove one or more CPUs from the candidates for running RCU callbacks, specify the list of CPUs in the
rcu_nocbskernel parameter, for example:
The second example instructs the kernel that CPU 3 is a no-callback CPU. This means that RCU callbacks will not be done in the
rcuc/$CPUthread pinned to CPU 3, but in the
rcuo/$CPUthread. You can move this trhead to a housekeeping CPU to relieve CPU 3 from being assigned RCU callback jobs.
25.2. Moving RCU callbacks
You can assign a housekeeping CPU to handle all RCU callback threads. To do this, use the
tuna command and move all RCU callbacks to the housekeeping CPU.
Move RCU callback threads to the housekeeping CPU:
# tuna --threads=rcu --cpus=x --move
xis the CPU number of the housekeeping CPU.
This action relieves all CPUs other than CPU X from handling RCU callback threads.
25.3. Relieving CPUs from awakening RCU offload threads
Although the RCU offload threads can perform the RCU callbacks on another CPU, each CPU is responsible for awakening the corresponding RCU offload thread. You can relieve a CPU from this responsibility,
This command causes a timer to periodically raise the RCU offload threads to check if there are callbacks to run.