Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tick/nohz: Expose housekeeping CPUs in sysfs

Expose the current system-defined list of housekeeping CPUs in a new
sysfs file: /sys/devices/system/cpu/housekeeping.

This provides userspace performance tuning tools and resource managers
with a canonical, reliable method to accurately identify the cores
responsible for essential kernel maintenance workloads (RCU, timer
callbacks, and unbound workqueues). Currently, tooling must manually
calculate the housekeeping set by parsing complex kernel boot parameters
(like isolcpus= and nohz_full=) and system topology, which is prone to
error. This dedicated file simplifies the configuration of low-latency
workloads.

Signed-off-by: Aaron Tomlin <atomlin@atomlin.com>
Link: https://patch.msgid.link/20251011012853.7539-2-atomlin@atomlin.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Aaron Tomlin and committed by
Greg Kroah-Hartman
cd22926a f10c23fa

+25
+11
Documentation/ABI/testing/sysfs-devices-system-cpu
··· 764 764 participate in load balancing. These CPUs are set by 765 765 boot parameter "isolcpus=". 766 766 767 + What: /sys/devices/system/cpu/housekeeping 768 + Date: Oct 2025 769 + Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org> 770 + Description: 771 + (RO) the list of logical CPUs that are designated by the kernel as 772 + "housekeeping". Each CPU are responsible for handling essential 773 + system-wide background tasks, including RCU callbacks, delayed 774 + timer callbacks, and unbound workqueues, minimizing scheduling 775 + jitter on low-latency, isolated CPUs. These CPUs are set when boot 776 + parameter "isolcpus=nohz" or "nohz_full=" is specified. 777 + 767 778 What: /sys/devices/system/cpu/crash_hotplug 768 779 Date: Aug 2023 769 780 Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org>
+14
drivers/base/cpu.c
··· 300 300 } 301 301 static DEVICE_ATTR(isolated, 0444, print_cpus_isolated, NULL); 302 302 303 + static ssize_t housekeeping_show(struct device *dev, 304 + struct device_attribute *attr, char *buf) 305 + { 306 + const struct cpumask *hk_mask; 307 + 308 + hk_mask = housekeeping_cpumask(HK_TYPE_KERNEL_NOISE); 309 + 310 + if (housekeeping_enabled(HK_TYPE_KERNEL_NOISE)) 311 + return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(hk_mask)); 312 + return sysfs_emit(buf, "\n"); 313 + } 314 + static DEVICE_ATTR_RO(housekeeping); 315 + 303 316 #ifdef CONFIG_NO_HZ_FULL 304 317 static ssize_t nohz_full_show(struct device *dev, 305 318 struct device_attribute *attr, ··· 522 509 &dev_attr_offline.attr, 523 510 &dev_attr_enabled.attr, 524 511 &dev_attr_isolated.attr, 512 + &dev_attr_housekeeping.attr, 525 513 #ifdef CONFIG_NO_HZ_FULL 526 514 &dev_attr_nohz_full.attr, 527 515 #endif