3sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}(hhparenthuba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget7/translations/zh_CN/admin-guide/kernel-per-CPU-kthreadsmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}(hhhh2ubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget7/translations/zh_TW/admin-guide/kernel-per-CPU-kthreadsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}(hhhhFubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget7/translations/it_IT/admin-guide/kernel-per-CPU-kthreadsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}(hhhhZubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget7/translations/ja_JP/admin-guide/kernel-per-CPU-kthreadsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}(hhhhnubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget7/translations/ko_KR/admin-guide/kernel-per-CPU-kthreadsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}(hhhhubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget7/translations/sp_SP/admin-guide/kernel-per-CPU-kthreadsmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(h*Reducing OS jitter due to per-cpu kthreadsh]h*Reducing OS jitter due to per-cpu kthreads}(hhhhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhQ/var/lib/git/docbuild/linux/Documentation/admin-guide/kernel-per-CPU-kthreads.rsthKubh paragraph)}(hXThis document lists per-CPU kthreads in the Linux kernel and presents options to control their OS jitter. Note that non-per-CPU kthreads are not listed here. To reduce OS jitter from non-per-CPU kthreads, bind them to a "housekeeping" CPU dedicated to such work.h]hX This document lists per-CPU kthreads in the Linux kernel and presents options to control their OS jitter. Note that non-per-CPU kthreads are not listed here. To reduce OS jitter from non-per-CPU kthreads, bind them to a “housekeeping” CPU dedicated to such work.}(hhhhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(h Referencesh]h References}(hhhhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhK ubh bullet_list)}(hhh](h list_item)}(hRDocumentation/core-api/irq/irq-affinity.rst: Binding interrupts to sets of CPUs. h]h)}(hQDocumentation/core-api/irq/irq-affinity.rst: Binding interrupts to sets of CPUs.h]hQDocumentation/core-api/irq/irq-affinity.rst: Binding interrupts to sets of CPUs.}(hhhhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubh)}(hSDocumentation/admin-guide/cgroup-v1: Using cgroups to bind tasks to sets of CPUs. h]h)}(hRDocumentation/admin-guide/cgroup-v1: Using cgroups to bind tasks to sets of CPUs.h]hRDocumentation/admin-guide/cgroup-v1: Using cgroups to bind tasks to sets of CPUs.}(hhhhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubh)}(hGman taskset: Using the taskset command to bind tasks to sets of CPUs. h]h)}(hFman taskset: Using the taskset command to bind tasks to sets of CPUs.h]hFman taskset: Using the taskset command to bind tasks to sets of CPUs.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubh)}(haman sched_setaffinity: Using the sched_setaffinity() system call to bind tasks to sets of CPUs. h]h)}(h`man sched_setaffinity: Using the sched_setaffinity() system call to bind tasks to sets of CPUs.h]h`man sched_setaffinity: Using the sched_setaffinity() system call to bind tasks to sets of CPUs.}(hj-hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj'ubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubh)}(ho/sys/devices/system/cpu/cpuN/online: Control CPU N's hotplug state, writing "0" to offline and "1" to online. h]h)}(hn/sys/devices/system/cpu/cpuN/online: Control CPU N's hotplug state, writing "0" to offline and "1" to online.h]hx/sys/devices/system/cpu/cpuN/online: Control CPU N’s hotplug state, writing “0” to offline and “1” to online.}(hjEhjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj?ubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubh)}(hIn order to locate kernel-generated OS jitter on CPU N: cd /sys/kernel/tracing echo 1 > max_graph_depth # Increase the "1" for more detail echo function_graph > current_tracer # run workload cat per_cpu/cpuN/trace h](h)}(h7In order to locate kernel-generated OS jitter on CPU N:h]h7In order to locate kernel-generated OS jitter on CPU N:}(hj]hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjWubh block_quote)}(hhh]h)}(hcd /sys/kernel/tracing echo 1 > max_graph_depth # Increase the "1" for more detail echo function_graph > current_tracer # run workload cat per_cpu/cpuN/traceh]hcd /sys/kernel/tracing echo 1 > max_graph_depth # Increase the “1” for more detail echo function_graph > current_tracer # run workload cat per_cpu/cpuN/trace}(hjphjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjkubah}(h]h ]h"]h$]h&]uh1jihjWubeh}(h]h ]h"]h$]h&]uh1hhhhhhhhNubeh}(h]h ]h"]h$]h&]bullet-uh1hhhhK hhhhubeh}(h] referencesah ]h"] referencesah$]h&]uh1hhhhhhhhK ubh)}(hhh](h)}(hkthreadsh]hkthreads}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK#ubhdefinition_list)}(hhh](hdefinition_list_item)}(hName: ehca_comp/%u h](hterm)}(hName:h]hName:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK&hjubh definition)}(hhh]h)}(h ehca_comp/%uh]h ehca_comp/%u}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK&hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhK&hjubj)}(h7Purpose: Periodically process Infiniband-related work. h](j)}(hPurpose:h]hPurpose:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK)hjubj)}(hhh]h)}(h-Periodically process Infiniband-related work.h]h-Periodically process Infiniband-related work.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK)hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhK)hjhhubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubh)}(h1To reduce its OS jitter, do any of the following:h]h1To reduce its OS jitter, do any of the following:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK+hjhhubhenumerated_list)}(hhh](h)}(hX7Don't use eHCA Infiniband hardware, instead choosing hardware that does not require per-CPU kthreads. This will prevent these kthreads from being created in the first place. (This will work for most people, as this hardware, though important, is relatively old and is produced in relatively low unit volumes.)h]h)}(hX7Don't use eHCA Infiniband hardware, instead choosing hardware that does not require per-CPU kthreads. This will prevent these kthreads from being created in the first place. (This will work for most people, as this hardware, though important, is relatively old and is produced in relatively low unit volumes.)h]hX9Don’t use eHCA Infiniband hardware, instead choosing hardware that does not require per-CPU kthreads. This will prevent these kthreads from being created in the first place. (This will work for most people, as this hardware, though important, is relatively old and is produced in relatively low unit volumes.)}(hj1hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK-hj+ubah}(h]h ]h"]h$]h&]uh1hhj(hhhhhNubh)}(hHDo all eHCA-Infiniband-related work on other CPUs, including interrupts.h]h)}(hHDo all eHCA-Infiniband-related work on other CPUs, including interrupts.h]hHDo all eHCA-Infiniband-related work on other CPUs, including interrupts.}(hjIhjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK2hjCubah}(h]h ]h"]h$]h&]uh1hhj(hhhhhNubh)}(h\Rework the eHCA driver so that its per-CPU kthreads are provisioned only on selected CPUs. h]h)}(hZRework the eHCA driver so that its per-CPU kthreads are provisioned only on selected CPUs.h]hZRework the eHCA driver so that its per-CPU kthreads are provisioned only on selected CPUs.}(hjahj_hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hj[ubah}(h]h ]h"]h$]h&]uh1hhj(hhhhhNubeh}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix.uh1j&hjhhhhhK-ubj)}(hhh](j)}(hName: irq/%d-%s h](j)}(hName:h]hName:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK9hjubj)}(hhh]h)}(h irq/%d-%sh]h irq/%d-%s}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK9hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhK9hj~ubj)}(h%Purpose: Handle threaded interrupts. h](j)}(hPurpose:h]hPurpose:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjhhubj')}(hhh]h)}(hHUse irq affinity to force the irq threads to execute on some other CPU. h]h)}(hGUse irq affinity to force the irq threads to execute on some other CPU.h]hGUse irq affinity to force the irq threads to execute on some other CPU.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK@hjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubah}(h]h ]h"]h$]h&]jyjzj{hj|j}uh1j&hjhhhhhK@ubj)}(hhh](j)}(hName: kcmtpd_ctr_%d h](j)}(hName:h]hName:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKDhjubj)}(hhh]h)}(h kcmtpd_ctr_%dh]h kcmtpd_ctr_%d}(hj.hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKDhj)ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKDhjubj)}(h Purpose: Handle Bluetooth work. h](j)}(hPurpose:h]hPurpose:}(hjLhjJhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKGhjFubj)}(hhh]h)}(hHandle Bluetooth work.h]hHandle Bluetooth work.}(hj]hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKGhjXubah}(h]h ]h"]h$]h&]uh1jhjFubeh}(h]h ]h"]h$]h&]uh1jhhhKGhjhhubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubh)}(h1To reduce its OS jitter, do one of the following:h]h1To reduce its OS jitter, do one of the following:}(hj}hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKIhjhhubj')}(hhh](h)}(hVDon't use Bluetooth, in which case these kthreads won't be created in the first place.h]h)}(hVDon't use Bluetooth, in which case these kthreads won't be created in the first place.h]hZDon’t use Bluetooth, in which case these kthreads won’t be created in the first place.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKKhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hUse irq affinity to force Bluetooth-related interrupts to occur on some other CPU and furthermore initiate all Bluetooth activity on some other CPU. h]h)}(hUse irq affinity to force Bluetooth-related interrupts to occur on some other CPU and furthermore initiate all Bluetooth activity on some other CPU.h]hUse irq affinity to force Bluetooth-related interrupts to occur on some other CPU and furthermore initiate all Bluetooth activity on some other CPU.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKMhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubeh}(h]h ]h"]h$]h&]jyjzj{hj|j}uh1j&hjhhhhhKKubj)}(hhh](j)}(hName: ksoftirqd/%u h](j)}(hName:h]hName:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKRhjubj)}(hhh]h)}(h ksoftirqd/%uh]h ksoftirqd/%u}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKRhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKRhjubj)}(hJPurpose: Execute softirq handlers when threaded or when under heavy load. h](j)}(hPurpose:h]hPurpose:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKUhjubj)}(hhh]h)}(h@Execute softirq handlers when threaded or when under heavy load.h]h@Execute softirq handlers when threaded or when under heavy load.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKUhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKUhjhhubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubh)}(hSTo reduce its OS jitter, each softirq vector must be handled separately as follows:h]hSTo reduce its OS jitter, each softirq vector must be handled separately as follows:}(hj+hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKWhjhhubh)}(hhh](h)}(h TIMER_SOFTIRQh]h TIMER_SOFTIRQ}(hj<hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj7hhhhhK[ubh)}(hDo all of the following:h]hDo all of the following:}(hjJhjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK]hj7hhubj')}(hhh](h)}(hTo the extent possible, keep the CPU out of the kernel when it is non-idle, for example, by avoiding system calls and by forcing both kernel threads and interrupts to execute elsewhere.h]h)}(hTo the extent possible, keep the CPU out of the kernel when it is non-idle, for example, by avoiding system calls and by forcing both kernel threads and interrupts to execute elsewhere.h]hTo the extent possible, keep the CPU out of the kernel when it is non-idle, for example, by avoiding system calls and by forcing both kernel threads and interrupts to execute elsewhere.}(hj_hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK_hjYubah}(h]h ]h"]h$]h&]uh1hhjVhhhhhNubh)}(hXBuild with CONFIG_HOTPLUG_CPU=y. After boot completes, force the CPU offline, then bring it back online. This forces recurring timers to migrate elsewhere. If you are concerned with multiple CPUs, force them all offline before bringing the first one back online. Once you have onlined the CPUs in question, do not offline any other CPUs, because doing so could force the timer back onto one of the CPUs in question. h]h)}(hXBuild with CONFIG_HOTPLUG_CPU=y. After boot completes, force the CPU offline, then bring it back online. This forces recurring timers to migrate elsewhere. If you are concerned with multiple CPUs, force them all offline before bringing the first one back online. Once you have onlined the CPUs in question, do not offline any other CPUs, because doing so could force the timer back onto one of the CPUs in question.h]hXBuild with CONFIG_HOTPLUG_CPU=y. After boot completes, force the CPU offline, then bring it back online. This forces recurring timers to migrate elsewhere. If you are concerned with multiple CPUs, force them all offline before bringing the first one back online. Once you have onlined the CPUs in question, do not offline any other CPUs, because doing so could force the timer back onto one of the CPUs in question.}(hjwhjuhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKbhjqubah}(h]h ]h"]h$]h&]uh1hhjVhhhhhNubeh}(h]h ]h"]h$]h&]jyjzj{hj|j}uh1j&hj7hhhhhK_ubeh}(h] timer-softirqah ]h"] timer_softirqah$]h&]uh1hhjhhhhhK[ubh)}(hhh](h)}(h!NET_TX_SOFTIRQ and NET_RX_SOFTIRQh]h!NET_TX_SOFTIRQ and NET_RX_SOFTIRQ}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKkubh)}(hDo all of the following:h]hDo all of the following:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKmhjhhubj')}(hhh](h)}(h,Force networking interrupts onto other CPUs.h]h)}(hjh]h,Force networking interrupts onto other CPUs.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKohjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(h'Initiate any network I/O on other CPUs.h]h)}(hjh]h'Initiate any network I/O on other CPUs.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKphjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hOnce your application has started, prevent CPU-hotplug operations from being initiated from tasks that might run on the CPU to be de-jittered. (It is OK to force this CPU offline and then bring it back online before you start your application.) h]h)}(hOnce your application has started, prevent CPU-hotplug operations from being initiated from tasks that might run on the CPU to be de-jittered. (It is OK to force this CPU offline and then bring it back online before you start your application.)h]hOnce your application has started, prevent CPU-hotplug operations from being initiated from tasks that might run on the CPU to be de-jittered. (It is OK to force this CPU offline and then bring it back online before you start your application.)}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKqhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubeh}(h]h ]h"]h$]h&]jyjzj{hj|j}uh1j&hjhhhhhKoubeh}(h]!net-tx-softirq-and-net-rx-softirqah ]h"]!net_tx_softirq and net_rx_softirqah$]h&]uh1hhjhhhhhKkubh)}(hhh](h)}(h BLOCK_SOFTIRQh]h BLOCK_SOFTIRQ}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKwubh)}(hDo all of the following:h]hDo all of the following:}(hj hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKyhj hhubj')}(hhh](h)}(h2Force block-device interrupts onto some other CPU.h]h)}(hj1h]h2Force block-device interrupts onto some other CPU.}(hj1hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK{hj/ubah}(h]h ]h"]h$]h&]uh1hhj,hhhhhNubh)}(h%Initiate any block I/O on other CPUs.h]h)}(hjHh]h%Initiate any block I/O on other CPUs.}(hjHhjJhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK|hjFubah}(h]h ]h"]h$]h&]uh1hhj,hhhhhNubh)}(hOnce your application has started, prevent CPU-hotplug operations from being initiated from tasks that might run on the CPU to be de-jittered. (It is OK to force this CPU offline and then bring it back online before you start your application.) h]h)}(hOnce your application has started, prevent CPU-hotplug operations from being initiated from tasks that might run on the CPU to be de-jittered. (It is OK to force this CPU offline and then bring it back online before you start your application.)h]hOnce your application has started, prevent CPU-hotplug operations from being initiated from tasks that might run on the CPU to be de-jittered. (It is OK to force this CPU offline and then bring it back online before you start your application.)}(hjchjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK}hj]ubah}(h]h ]h"]h$]h&]uh1hhj,hhhhhNubeh}(h]h ]h"]h$]h&]jyjzj{hj|j}uh1j&hj hhhhhK{ubeh}(h] block-softirqah ]h"] block_softirqah$]h&]uh1hhjhhhhhKwubh)}(hhh](h)}(hIRQ_POLL_SOFTIRQh]hIRQ_POLL_SOFTIRQ}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hDo all of the following:h]hDo all of the following:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj')}(hhh](h)}(h2Force block-device interrupts onto some other CPU.h]h)}(hjh]h2Force block-device interrupts onto some other CPU.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(h;Initiate any block I/O and block-I/O polling on other CPUs.h]h)}(hjh]h;Initiate any block I/O and block-I/O polling on other CPUs.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hOnce your application has started, prevent CPU-hotplug operations from being initiated from tasks that might run on the CPU to be de-jittered. (It is OK to force this CPU offline and then bring it back online before you start your application.) h]h)}(hOnce your application has started, prevent CPU-hotplug operations from being initiated from tasks that might run on the CPU to be de-jittered. (It is OK to force this CPU offline and then bring it back online before you start your application.)h]hOnce your application has started, prevent CPU-hotplug operations from being initiated from tasks that might run on the CPU to be de-jittered. (It is OK to force this CPU offline and then bring it back online before you start your application.)}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubeh}(h]h ]h"]h$]h&]jyjzj{hj|j}uh1j&hjhhhhhKubeh}(h]irq-poll-softirqah ]h"]irq_poll_softirqah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(hTASKLET_SOFTIRQh]hTASKLET_SOFTIRQ}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(h Do one or more of the following:h]h Do one or more of the following:}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj')}(hhh](h)}(hmAvoid use of drivers that use tasklets. (Such drivers will contain calls to things like tasklet_schedule().)h]h)}(hmAvoid use of drivers that use tasklets. (Such drivers will contain calls to things like tasklet_schedule().)h]hmAvoid use of drivers that use tasklets. (Such drivers will contain calls to things like tasklet_schedule().)}(hj!hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hBConvert all drivers that you must use from tasklets to workqueues.h]h)}(hj5h]hBConvert all drivers that you must use from tasklets to workqueues.}(hj5hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj3ubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(htForce interrupts for drivers using tasklets onto other CPUs, and also do I/O involving these drivers on other CPUs. h]h)}(hsForce interrupts for drivers using tasklets onto other CPUs, and also do I/O involving these drivers on other CPUs.h]hsForce interrupts for drivers using tasklets onto other CPUs, and also do I/O involving these drivers on other CPUs.}(hjPhjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjJubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubeh}(h]h ]h"]h$]h&]jyjzj{hj|j}uh1j&hjhhhhhKubeh}(h]tasklet-softirqah ]h"]tasklet_softirqah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(h SCHED_SOFTIRQh]h SCHED_SOFTIRQ}(hjuhjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhjphhhhhKubh)}(hDo all of the following:h]hDo all of the following:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjphhubj')}(hhh](h)}(hXAvoid sending scheduler IPIs to the CPU to be de-jittered, for example, ensure that at most one runnable kthread is present on that CPU. If a thread that expects to run on the de-jittered CPU awakens, the scheduler will send an IPI that can result in a subsequent SCHED_SOFTIRQ.h]h)}(hXAvoid sending scheduler IPIs to the CPU to be de-jittered, for example, ensure that at most one runnable kthread is present on that CPU. If a thread that expects to run on the de-jittered CPU awakens, the scheduler will send an IPI that can result in a subsequent SCHED_SOFTIRQ.h]hXAvoid sending scheduler IPIs to the CPU to be de-jittered, for example, ensure that at most one runnable kthread is present on that CPU. If a thread that expects to run on the de-jittered CPU awakens, the scheduler will send an IPI that can result in a subsequent SCHED_SOFTIRQ.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hXLCONFIG_NO_HZ_FULL=y and ensure that the CPU to be de-jittered is marked as an adaptive-ticks CPU using the "nohz_full=" boot parameter. This reduces the number of scheduler-clock interrupts that the de-jittered CPU receives, minimizing its chances of being selected to do the load balancing work that runs in SCHED_SOFTIRQ context.h]h)}(hXLCONFIG_NO_HZ_FULL=y and ensure that the CPU to be de-jittered is marked as an adaptive-ticks CPU using the "nohz_full=" boot parameter. This reduces the number of scheduler-clock interrupts that the de-jittered CPU receives, minimizing its chances of being selected to do the load balancing work that runs in SCHED_SOFTIRQ context.h]hXPCONFIG_NO_HZ_FULL=y and ensure that the CPU to be de-jittered is marked as an adaptive-ticks CPU using the “nohz_full=” boot parameter. This reduces the number of scheduler-clock interrupts that the de-jittered CPU receives, minimizing its chances of being selected to do the load balancing work that runs in SCHED_SOFTIRQ context.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hXTo the extent possible, keep the CPU out of the kernel when it is non-idle, for example, by avoiding system calls and by forcing both kernel threads and interrupts to execute elsewhere. This further reduces the number of scheduler-clock interrupts received by the de-jittered CPU. h]h)}(hXTo the extent possible, keep the CPU out of the kernel when it is non-idle, for example, by avoiding system calls and by forcing both kernel threads and interrupts to execute elsewhere. This further reduces the number of scheduler-clock interrupts received by the de-jittered CPU.h]hXTo the extent possible, keep the CPU out of the kernel when it is non-idle, for example, by avoiding system calls and by forcing both kernel threads and interrupts to execute elsewhere. This further reduces the number of scheduler-clock interrupts received by the de-jittered CPU.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubeh}(h]h ]h"]h$]h&]jyjzj{hj|j}uh1j&hjphhhhhKubeh}(h] sched-softirqah ]h"] sched_softirqah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(hHRTIMER_SOFTIRQh]hHRTIMER_SOFTIRQ}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hDo all of the following:h]hDo all of the following:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj')}(hhh](h)}(hTo the extent possible, keep the CPU out of the kernel when it is non-idle. For example, avoid system calls and force both kernel threads and interrupts to execute elsewhere.h]h)}(hTo the extent possible, keep the CPU out of the kernel when it is non-idle. For example, avoid system calls and force both kernel threads and interrupts to execute elsewhere.h]hTo the extent possible, keep the CPU out of the kernel when it is non-idle. For example, avoid system calls and force both kernel threads and interrupts to execute elsewhere.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hXBuild with CONFIG_HOTPLUG_CPU=y. Once boot completes, force the CPU offline, then bring it back online. This forces recurring timers to migrate elsewhere. If you are concerned with multiple CPUs, force them all offline before bringing the first one back online. Once you have onlined the CPUs in question, do not offline any other CPUs, because doing so could force the timer back onto one of the CPUs in question. h]h)}(hXBuild with CONFIG_HOTPLUG_CPU=y. Once boot completes, force the CPU offline, then bring it back online. This forces recurring timers to migrate elsewhere. If you are concerned with multiple CPUs, force them all offline before bringing the first one back online. Once you have onlined the CPUs in question, do not offline any other CPUs, because doing so could force the timer back onto one of the CPUs in question.h]hXBuild with CONFIG_HOTPLUG_CPU=y. Once boot completes, force the CPU offline, then bring it back online. This forces recurring timers to migrate elsewhere. If you are concerned with multiple CPUs, force them all offline before bringing the first one back online. Once you have onlined the CPUs in question, do not offline any other CPUs, because doing so could force the timer back onto one of the CPUs in question.}(hj(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj"ubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubeh}(h]h ]h"]h$]h&]jyjzj{hj|j}uh1j&hjhhhhhKubeh}(h]hrtimer-softirqah ]h"]hrtimer_softirqah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(h RCU_SOFTIRQh]h RCU_SOFTIRQ}(hjMhjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjHhhhhhKubh)}(h!Do at least one of the following:h]h!Do at least one of the following:}(hj[hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjHhhubj')}(hhh](h)}(hX@Offload callbacks and keep the CPU in either dyntick-idle or adaptive-ticks state by doing all of the following: a. CONFIG_NO_HZ_FULL=y and ensure that the CPU to be de-jittered is marked as an adaptive-ticks CPU using the "nohz_full=" boot parameter. Bind the rcuo kthreads to housekeeping CPUs, which can tolerate OS jitter. b. To the extent possible, keep the CPU out of the kernel when it is non-idle, for example, by avoiding system calls and by forcing both kernel threads and interrupts to execute elsewhere. h](h)}(hpOffload callbacks and keep the CPU in either dyntick-idle or adaptive-ticks state by doing all of the following:h]hpOffload callbacks and keep the CPU in either dyntick-idle or adaptive-ticks state by doing all of the following:}(hjphjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjjubj')}(hhh](h)}(hCONFIG_NO_HZ_FULL=y and ensure that the CPU to be de-jittered is marked as an adaptive-ticks CPU using the "nohz_full=" boot parameter. Bind the rcuo kthreads to housekeeping CPUs, which can tolerate OS jitter.h]h)}(hCONFIG_NO_HZ_FULL=y and ensure that the CPU to be de-jittered is marked as an adaptive-ticks CPU using the "nohz_full=" boot parameter. Bind the rcuo kthreads to housekeeping CPUs, which can tolerate OS jitter.h]hCONFIG_NO_HZ_FULL=y and ensure that the CPU to be de-jittered is marked as an adaptive-ticks CPU using the “nohz_full=” boot parameter. Bind the rcuo kthreads to housekeeping CPUs, which can tolerate OS jitter.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhj|ubh)}(hTo the extent possible, keep the CPU out of the kernel when it is non-idle, for example, by avoiding system calls and by forcing both kernel threads and interrupts to execute elsewhere. h]h)}(hTo the extent possible, keep the CPU out of the kernel when it is non-idle, for example, by avoiding system calls and by forcing both kernel threads and interrupts to execute elsewhere.h]hTo the extent possible, keep the CPU out of the kernel when it is non-idle, for example, by avoiding system calls and by forcing both kernel threads and interrupts to execute elsewhere.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhj|ubeh}(h]h ]h"]h$]h&]jy loweralphaj{hj|j}uh1j&hjjubeh}(h]h ]h"]h$]h&]uh1hhjghhhNhNubh)}(hXEnable RCU to do its processing remotely via dyntick-idle by doing all of the following: a. Build with CONFIG_NO_HZ=y. b. Ensure that the CPU goes idle frequently, allowing other CPUs to detect that it has passed through an RCU quiescent state. If the kernel is built with CONFIG_NO_HZ_FULL=y, userspace execution also allows other CPUs to detect that the CPU in question has passed through a quiescent state. c. To the extent possible, keep the CPU out of the kernel when it is non-idle, for example, by avoiding system calls and by forcing both kernel threads and interrupts to execute elsewhere. h](h)}(hXEnable RCU to do its processing remotely via dyntick-idle by doing all of the following:h]hXEnable RCU to do its processing remotely via dyntick-idle by doing all of the following:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubj')}(hhh](h)}(hBuild with CONFIG_NO_HZ=y.h]h)}(hjh]hBuild with CONFIG_NO_HZ=y.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hX Ensure that the CPU goes idle frequently, allowing other CPUs to detect that it has passed through an RCU quiescent state. If the kernel is built with CONFIG_NO_HZ_FULL=y, userspace execution also allows other CPUs to detect that the CPU in question has passed through a quiescent state.h]h)}(hX Ensure that the CPU goes idle frequently, allowing other CPUs to detect that it has passed through an RCU quiescent state. If the kernel is built with CONFIG_NO_HZ_FULL=y, userspace execution also allows other CPUs to detect that the CPU in question has passed through a quiescent state.h]hX Ensure that the CPU goes idle frequently, allowing other CPUs to detect that it has passed through an RCU quiescent state. If the kernel is built with CONFIG_NO_HZ_FULL=y, userspace execution also allows other CPUs to detect that the CPU in question has passed through a quiescent state.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hTo the extent possible, keep the CPU out of the kernel when it is non-idle, for example, by avoiding system calls and by forcing both kernel threads and interrupts to execute elsewhere. h]h)}(hTo the extent possible, keep the CPU out of the kernel when it is non-idle, for example, by avoiding system calls and by forcing both kernel threads and interrupts to execute elsewhere.h]hTo the extent possible, keep the CPU out of the kernel when it is non-idle, for example, by avoiding system calls and by forcing both kernel threads and interrupts to execute elsewhere.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]jyjj{hj|j}uh1j&hjubeh}(h]h ]h"]h$]h&]uh1hhjghhhNhNubeh}(h]h ]h"]h$]h&]jyjzj{hj|j}uh1j&hjHhhhhhKubj)}(hhh](j)}(h*Name: kworker/%u:%d%s (cpu, id, priority) h](j)}(hName:h]hName:}(hj3hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj-ubj)}(hhh]h)}(h#kworker/%u:%d%s (cpu, id, priority)h]h#kworker/%u:%d%s (cpu, id, priority)}(hjDhjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj?ubah}(h]h ]h"]h$]h&]uh1jhj-ubeh}(h]h ]h"]h$]h&]uh1jhhhKhj*ubj)}(h$Purpose: Execute workqueue requests h](j)}(hPurpose:h]hPurpose:}(hjbhj`hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj\ubj)}(hhh]h)}(hExecute workqueue requestsh]hExecute workqueue requests}(hjshjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjnubah}(h]h ]h"]h$]h&]uh1jhj\ubeh}(h]h ]h"]h$]h&]uh1jhhhKhj*hhubeh}(h]h ]h"]h$]h&]uh1jhjHhhhhhNubh)}(h1To reduce its OS jitter, do any of the following:h]h1To reduce its OS jitter, do any of the following:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjHhhubj')}(hhh](h)}(h[Run your workload at a real-time priority, which will allow preempting the kworker daemons.h]h)}(h[Run your workload at a real-time priority, which will allow preempting the kworker daemons.h]h[Run your workload at a real-time priority, which will allow preempting the kworker daemons.}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hXA given workqueue can be made visible in the sysfs filesystem by passing the WQ_SYSFS to that workqueue's alloc_workqueue(). Such a workqueue can be confined to a given subset of the CPUs using the ``/sys/devices/virtual/workqueue/*/cpumask`` sysfs files. The set of WQ_SYSFS workqueues can be displayed using "ls /sys/devices/virtual/workqueue". That said, the workqueues maintainer would like to caution people against indiscriminately sprinkling WQ_SYSFS across all the workqueues. The reason for caution is that it is easy to add WQ_SYSFS, but because sysfs is part of the formal user/kernel API, it can be nearly impossible to remove it, even if its addition was a mistake.h]h)}(hXA given workqueue can be made visible in the sysfs filesystem by passing the WQ_SYSFS to that workqueue's alloc_workqueue(). Such a workqueue can be confined to a given subset of the CPUs using the ``/sys/devices/virtual/workqueue/*/cpumask`` sysfs files. The set of WQ_SYSFS workqueues can be displayed using "ls /sys/devices/virtual/workqueue". That said, the workqueues maintainer would like to caution people against indiscriminately sprinkling WQ_SYSFS across all the workqueues. The reason for caution is that it is easy to add WQ_SYSFS, but because sysfs is part of the formal user/kernel API, it can be nearly impossible to remove it, even if its addition was a mistake.h](hA given workqueue can be made visible in the sysfs filesystem by passing the WQ_SYSFS to that workqueue’s alloc_workqueue(). Such a workqueue can be confined to a given subset of the CPUs using the }(hA given workqueue can be made visible in the sysfs filesystem by passing the WQ_SYSFS to that workqueue's alloc_workqueue(). Such a workqueue can be confined to a given subset of the CPUs using the hjhhhNhNubhliteral)}(h,``/sys/devices/virtual/workqueue/*/cpumask``h]h(/sys/devices/virtual/workqueue/*/cpumask}(hhhjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhX sysfs files. The set of WQ_SYSFS workqueues can be displayed using “ls /sys/devices/virtual/workqueue”. That said, the workqueues maintainer would like to caution people against indiscriminately sprinkling WQ_SYSFS across all the workqueues. The reason for caution is that it is easy to add WQ_SYSFS, but because sysfs is part of the formal user/kernel API, it can be nearly impossible to remove it, even if its addition was a mistake.}(hX sysfs files. The set of WQ_SYSFS workqueues can be displayed using "ls /sys/devices/virtual/workqueue". That said, the workqueues maintainer would like to caution people against indiscriminately sprinkling WQ_SYSFS across all the workqueues. The reason for caution is that it is easy to add WQ_SYSFS, but because sysfs is part of the formal user/kernel API, it can be nearly impossible to remove it, even if its addition was a mistake.hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hXM Do any of the following needed to avoid jitter that your application cannot tolerate: a. Avoid using oprofile, thus avoiding OS jitter from wq_sync_buffer(). b. Limit your CPU frequency so that a CPU-frequency governor is not required, possibly enlisting the aid of special heatsinks or other cooling technologies. If done correctly, and if you CPU architecture permits, you should be able to build your kernel with CONFIG_CPU_FREQ=n to avoid the CPU-frequency governor periodically running on each CPU, including cs_dbs_timer() and od_dbs_timer(). WARNING: Please check your CPU specifications to make sure that this is safe on your particular system. c. As of v3.18, Christoph Lameter's on-demand vmstat workers commit prevents OS jitter due to vmstat_update() on CONFIG_SMP=y systems. Before v3.18, is not possible to entirely get rid of the OS jitter, but you can decrease its frequency by writing a large value to /proc/sys/vm/stat_interval. The default value is HZ, for an interval of one second. Of course, larger values will make your virtual-memory statistics update more slowly. Of course, you can also run your workload at a real-time priority, thus preempting vmstat_update(), but if your workload is CPU-bound, this is a bad idea. However, there is an RFC patch from Christoph Lameter (based on an earlier one from Gilad Ben-Yossef) that reduces or even eliminates vmstat overhead for some workloads at https://lore.kernel.org/r/00000140e9dfd6bd-40db3d4f-c1be-434f-8132-7820f81bb586-000000@email.amazonses.com. d. If running on high-end powerpc servers, build with CONFIG_PPC_RTAS_DAEMON=n. This prevents the RTAS daemon from running on each CPU every second or so. (This will require editing Kconfig files and will defeat this platform's RAS functionality.) This avoids jitter due to the rtas_event_scan() function. WARNING: Please check your CPU specifications to make sure that this is safe on your particular system. e. If running on Cell Processor, build your kernel with CBE_CPUFREQ_SPU_GOVERNOR=n to avoid OS jitter from spu_gov_work(). WARNING: Please check your CPU specifications to make sure that this is safe on your particular system. f. If running on PowerMAC, build your kernel with CONFIG_PMAC_RACKMETER=n to disable the CPU-meter, avoiding OS jitter from rackmeter_do_timer(). h](h)}(hUDo any of the following needed to avoid jitter that your application cannot tolerate:h]hUDo any of the following needed to avoid jitter that your application cannot tolerate:}(hjhjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubj')}(hhh](h)}(hDAvoid using oprofile, thus avoiding OS jitter from wq_sync_buffer().h]h)}(hDAvoid using oprofile, thus avoiding OS jitter from wq_sync_buffer().h]hDAvoid using oprofile, thus avoiding OS jitter from wq_sync_buffer().}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hXLimit your CPU frequency so that a CPU-frequency governor is not required, possibly enlisting the aid of special heatsinks or other cooling technologies. If done correctly, and if you CPU architecture permits, you should be able to build your kernel with CONFIG_CPU_FREQ=n to avoid the CPU-frequency governor periodically running on each CPU, including cs_dbs_timer() and od_dbs_timer(). WARNING: Please check your CPU specifications to make sure that this is safe on your particular system.h](h)}(hXLimit your CPU frequency so that a CPU-frequency governor is not required, possibly enlisting the aid of special heatsinks or other cooling technologies. If done correctly, and if you CPU architecture permits, you should be able to build your kernel with CONFIG_CPU_FREQ=n to avoid the CPU-frequency governor periodically running on each CPU, including cs_dbs_timer() and od_dbs_timer().h]hXLimit your CPU frequency so that a CPU-frequency governor is not required, possibly enlisting the aid of special heatsinks or other cooling technologies. If done correctly, and if you CPU architecture permits, you should be able to build your kernel with CONFIG_CPU_FREQ=n to avoid the CPU-frequency governor periodically running on each CPU, including cs_dbs_timer() and od_dbs_timer().}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubh)}(hhWARNING: Please check your CPU specifications to make sure that this is safe on your particular system.h]hhWARNING: Please check your CPU specifications to make sure that this is safe on your particular system.}(hj) hj' hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubeh}(h]h ]h"]h$]h&]uh1hhjubh)}(hXgAs of v3.18, Christoph Lameter's on-demand vmstat workers commit prevents OS jitter due to vmstat_update() on CONFIG_SMP=y systems. Before v3.18, is not possible to entirely get rid of the OS jitter, but you can decrease its frequency by writing a large value to /proc/sys/vm/stat_interval. The default value is HZ, for an interval of one second. Of course, larger values will make your virtual-memory statistics update more slowly. Of course, you can also run your workload at a real-time priority, thus preempting vmstat_update(), but if your workload is CPU-bound, this is a bad idea. However, there is an RFC patch from Christoph Lameter (based on an earlier one from Gilad Ben-Yossef) that reduces or even eliminates vmstat overhead for some workloads at https://lore.kernel.org/r/00000140e9dfd6bd-40db3d4f-c1be-434f-8132-7820f81bb586-000000@email.amazonses.com.h]h)}(hXgAs of v3.18, Christoph Lameter's on-demand vmstat workers commit prevents OS jitter due to vmstat_update() on CONFIG_SMP=y systems. Before v3.18, is not possible to entirely get rid of the OS jitter, but you can decrease its frequency by writing a large value to /proc/sys/vm/stat_interval. The default value is HZ, for an interval of one second. Of course, larger values will make your virtual-memory statistics update more slowly. Of course, you can also run your workload at a real-time priority, thus preempting vmstat_update(), but if your workload is CPU-bound, this is a bad idea. However, there is an RFC patch from Christoph Lameter (based on an earlier one from Gilad Ben-Yossef) that reduces or even eliminates vmstat overhead for some workloads at https://lore.kernel.org/r/00000140e9dfd6bd-40db3d4f-c1be-434f-8132-7820f81bb586-000000@email.amazonses.com.h](hXAs of v3.18, Christoph Lameter’s on-demand vmstat workers commit prevents OS jitter due to vmstat_update() on CONFIG_SMP=y systems. Before v3.18, is not possible to entirely get rid of the OS jitter, but you can decrease its frequency by writing a large value to /proc/sys/vm/stat_interval. The default value is HZ, for an interval of one second. Of course, larger values will make your virtual-memory statistics update more slowly. Of course, you can also run your workload at a real-time priority, thus preempting vmstat_update(), but if your workload is CPU-bound, this is a bad idea. However, there is an RFC patch from Christoph Lameter (based on an earlier one from Gilad Ben-Yossef) that reduces or even eliminates vmstat overhead for some workloads at }(hXAs of v3.18, Christoph Lameter's on-demand vmstat workers commit prevents OS jitter due to vmstat_update() on CONFIG_SMP=y systems. Before v3.18, is not possible to entirely get rid of the OS jitter, but you can decrease its frequency by writing a large value to /proc/sys/vm/stat_interval. The default value is HZ, for an interval of one second. Of course, larger values will make your virtual-memory statistics update more slowly. Of course, you can also run your workload at a real-time priority, thus preempting vmstat_update(), but if your workload is CPU-bound, this is a bad idea. However, there is an RFC patch from Christoph Lameter (based on an earlier one from Gilad Ben-Yossef) that reduces or even eliminates vmstat overhead for some workloads at hj? hhhNhNubh reference)}(hjhttps://lore.kernel.org/r/00000140e9dfd6bd-40db3d4f-c1be-434f-8132-7820f81bb586-000000@email.amazonses.comh]hjhttps://lore.kernel.org/r/00000140e9dfd6bd-40db3d4f-c1be-434f-8132-7820f81bb586-000000@email.amazonses.com}(hhhjJ hhhNhNubah}(h]h ]h"]h$]h&]refurijL uh1jH hj? ubh.}(hj}hj? hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj; ubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hXIf running on high-end powerpc servers, build with CONFIG_PPC_RTAS_DAEMON=n. This prevents the RTAS daemon from running on each CPU every second or so. (This will require editing Kconfig files and will defeat this platform's RAS functionality.) This avoids jitter due to the rtas_event_scan() function. WARNING: Please check your CPU specifications to make sure that this is safe on your particular system.h]h)}(hXIf running on high-end powerpc servers, build with CONFIG_PPC_RTAS_DAEMON=n. This prevents the RTAS daemon from running on each CPU every second or so. (This will require editing Kconfig files and will defeat this platform's RAS functionality.) This avoids jitter due to the rtas_event_scan() function. WARNING: Please check your CPU specifications to make sure that this is safe on your particular system.h]hXIf running on high-end powerpc servers, build with CONFIG_PPC_RTAS_DAEMON=n. This prevents the RTAS daemon from running on each CPU every second or so. (This will require editing Kconfig files and will defeat this platform’s RAS functionality.) This avoids jitter due to the rtas_event_scan() function. WARNING: Please check your CPU specifications to make sure that this is safe on your particular system.}(hjo hjm hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhji ubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hIf running on Cell Processor, build your kernel with CBE_CPUFREQ_SPU_GOVERNOR=n to avoid OS jitter from spu_gov_work(). WARNING: Please check your CPU specifications to make sure that this is safe on your particular system.h]h)}(hIf running on Cell Processor, build your kernel with CBE_CPUFREQ_SPU_GOVERNOR=n to avoid OS jitter from spu_gov_work(). WARNING: Please check your CPU specifications to make sure that this is safe on your particular system.h]hIf running on Cell Processor, build your kernel with CBE_CPUFREQ_SPU_GOVERNOR=n to avoid OS jitter from spu_gov_work(). WARNING: Please check your CPU specifications to make sure that this is safe on your particular system.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hIf running on PowerMAC, build your kernel with CONFIG_PMAC_RACKMETER=n to disable the CPU-meter, avoiding OS jitter from rackmeter_do_timer(). h]h)}(hIf running on PowerMAC, build your kernel with CONFIG_PMAC_RACKMETER=n to disable the CPU-meter, avoiding OS jitter from rackmeter_do_timer().h]hIf running on PowerMAC, build your kernel with CONFIG_PMAC_RACKMETER=n to disable the CPU-meter, avoiding OS jitter from rackmeter_do_timer().}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]jyjj{hj|j}uh1j&hjubeh}(h]h ]h"]h$]h&]uh1hhjhhhNhNubeh}(h]h ]h"]h$]h&]jyjzj{hj|j}uh1j&hjHhhhhhKubj)}(hhh](j)}(hName: rcuc/%u h](j)}(hName:h]hName:}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM#hj ubj)}(hhh]h)}(hrcuc/%uh]hrcuc/%u}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM#hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhhhM#hj ubj)}(h>Purpose: Execute RCU callbacks in CONFIG_RCU_BOOST=y kernels. h](j)}(hPurpose:h]hPurpose:}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM&hj ubj)}(hhh]h)}(h4Execute RCU callbacks in CONFIG_RCU_BOOST=y kernels.h]h4Execute RCU callbacks in CONFIG_RCU_BOOST=y kernels.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM&hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhhhM&hj hhubeh}(h]h ]h"]h$]h&]uh1jhjHhhhhhNubh)}(h:To reduce its OS jitter, do at least one of the following:h]h:To reduce its OS jitter, do at least one of the following:}(hj, hj* hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM(hjHhhubj')}(hhh](h)}(hBuild the kernel with CONFIG_PREEMPT=n. This prevents these kthreads from being created in the first place, and also obviates the need for RCU priority boosting. This approach is feasible for workloads that do not require high degrees of responsiveness.h]h)}(hBuild the kernel with CONFIG_PREEMPT=n. This prevents these kthreads from being created in the first place, and also obviates the need for RCU priority boosting. This approach is feasible for workloads that do not require high degrees of responsiveness.h]hBuild the kernel with CONFIG_PREEMPT=n. This prevents these kthreads from being created in the first place, and also obviates the need for RCU priority boosting. This approach is feasible for workloads that do not require high degrees of responsiveness.}(hjA hj? hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM*hj; ubah}(h]h ]h"]h$]h&]uh1hhj8 hhhhhNubh)}(hX%Build the kernel with CONFIG_RCU_BOOST=n. This prevents these kthreads from being created in the first place. This approach is feasible only if your workload never requires RCU priority boosting, for example, if you ensure frequent idle time on all CPUs that might execute within the kernel.h]h)}(hX%Build the kernel with CONFIG_RCU_BOOST=n. This prevents these kthreads from being created in the first place. This approach is feasible only if your workload never requires RCU priority boosting, for example, if you ensure frequent idle time on all CPUs that might execute within the kernel.h]hX%Build the kernel with CONFIG_RCU_BOOST=n. This prevents these kthreads from being created in the first place. This approach is feasible only if your workload never requires RCU priority boosting, for example, if you ensure frequent idle time on all CPUs that might execute within the kernel.}(hjY hjW hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM.hjS ubah}(h]h ]h"]h$]h&]uh1hhj8 hhhhhNubh)}(hBuild with CONFIG_RCU_NOCB_CPU=y and boot with the rcu_nocbs= boot parameter offloading RCU callbacks from all CPUs susceptible to OS jitter. This approach prevents the rcuc/%u kthreads from having any work to do, so that they are never awakened.h]h)}(hBuild with CONFIG_RCU_NOCB_CPU=y and boot with the rcu_nocbs= boot parameter offloading RCU callbacks from all CPUs susceptible to OS jitter. This approach prevents the rcuc/%u kthreads from having any work to do, so that they are never awakened.h]hBuild with CONFIG_RCU_NOCB_CPU=y and boot with the rcu_nocbs= boot parameter offloading RCU callbacks from all CPUs susceptible to OS jitter. This approach prevents the rcuc/%u kthreads from having any work to do, so that they are never awakened.}(hjq hjo hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM3hjk ubah}(h]h ]h"]h$]h&]uh1hhj8 hhhhhNubh)}(hX Ensure that the CPU never enters the kernel, and, in particular, avoid initiating any CPU hotplug operations on this CPU. This is another way of preventing any callbacks from being queued on the CPU, again preventing the rcuc/%u kthreads from having any work to do. h]h)}(hX Ensure that the CPU never enters the kernel, and, in particular, avoid initiating any CPU hotplug operations on this CPU. This is another way of preventing any callbacks from being queued on the CPU, again preventing the rcuc/%u kthreads from having any work to do.h]hX Ensure that the CPU never enters the kernel, and, in particular, avoid initiating any CPU hotplug operations on this CPU. This is another way of preventing any callbacks from being queued on the CPU, again preventing the rcuc/%u kthreads from having any work to do.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM7hj ubah}(h]h ]h"]h$]h&]uh1hhj8 hhhhhNubeh}(h]h ]h"]h$]h&]jyjzj{hj|j}uh1j&hjHhhhhhM*ubj)}(hhh](j)}(hName: rcuop/%d and rcuos/%d h](j)}(hName:h]hName:}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM>hj ubj)}(hhh]h)}(hrcuop/%d and rcuos/%dh]hrcuop/%d and rcuos/%d}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM>hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhhhM>hj ubj)}(h;Purpose: Offload RCU callbacks from the corresponding CPU. h](j)}(hPurpose:h]hPurpose:}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMAhj ubj)}(hhh]h)}(h1Offload RCU callbacks from the corresponding CPU.h]h1Offload RCU callbacks from the corresponding CPU.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMAhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhhhMAhj hhubeh}(h]h ]h"]h$]h&]uh1jhjHhhhhhNubh)}(h:To reduce its OS jitter, do at least one of the following:h]h:To reduce its OS jitter, do at least one of the following:}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMChjHhhubj')}(hhh](h)}(h_Use affinity, cgroups, or other mechanism to force these kthreads to execute on some other CPU.h]h)}(h_Use affinity, cgroups, or other mechanism to force these kthreads to execute on some other CPU.h]h_Use affinity, cgroups, or other mechanism to force these kthreads to execute on some other CPU.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMEhj ubah}(h]h ]h"]h$]h&]uh1hhj hhhhhNubh)}(hBuild with CONFIG_RCU_NOCB_CPU=n, which will prevent these kthreads from being created in the first place. However, please note that this will not eliminate OS jitter, but will instead shift it to RCU_SOFTIRQ.h]h)}(hBuild with CONFIG_RCU_NOCB_CPU=n, which will prevent these kthreads from being created in the first place. However, please note that this will not eliminate OS jitter, but will instead shift it to RCU_SOFTIRQ.h]hBuild with CONFIG_RCU_NOCB_CPU=n, which will prevent these kthreads from being created in the first place. However, please note that this will not eliminate OS jitter, but will instead shift it to RCU_SOFTIRQ.}(hj7 hj5 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMGhj1 ubah}(h]h ]h"]h$]h&]uh1hhj hhhhhNubeh}(h]h ]h"]h$]h&]jyjzj{hj|j}uh1j&hjHhhhhhMEubeh}(h] rcu-softirqah ]h"] rcu_softirqah$]h&]uh1hhjhhhhhKubeh}(h]kthreadsah ]h"]kthreadsah$]h&]uh1hhhhhhhhK#ubeh}(h]*reducing-os-jitter-due-to-per-cpu-kthreadsah ]h"]*reducing os jitter due to per-cpu kthreadsah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj error_encodingUTF-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confapep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacefile_insertion_enabled raw_enabledKline_length_limitM'syntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_link embed_imagesenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jd ja jjj\ jY jjj jjj}jjjmjjjjjEjBjT jQ u nametypes}(jd NjNj\ NjNj NjNjNjmNjNjENjT Nuh}(ja hjhjY jjj7jjj}j jjjjjjjpjBjjQ jHu footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.