Commit 6570a9a1 authored by Rik van Riel's avatar Rik van Riel Committed by Greg Kroah-Hartman

show nohz_full cpus in sysfs

Currently there is no way to query which CPUs are in nohz_full
mode from userspace.

Export the CPU list running in nohz_full mode in sysfs,
specifically in the file /sys/devices/system/cpu/nohz_full

This can be used by system management tools like libvirt,
openstack, and others to ensure proper task placement.
Signed-off-by: default avatarRik van Riel <>
Acked-by: default avatarMike Galbraith <>
Acked-by: default avatarChris Metcalf <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 59f30abe
......@@ -16,6 +16,7 @@
#include <linux/acpi.h>
#include <linux/of.h>
#include <linux/cpufeature.h>
#include <linux/tick.h>
#include "base.h"
......@@ -276,6 +277,19 @@ static ssize_t print_cpus_isolated(struct device *dev,
static DEVICE_ATTR(isolated, 0444, print_cpus_isolated, NULL);
static ssize_t print_cpus_nohz_full(struct device *dev,
struct device_attribute *attr, char *buf)
int n = 0, len = PAGE_SIZE-2;
n = scnprintf(buf, len, "%*pbl\n", cpumask_pr_args(tick_nohz_full_mask));
return n;
static DEVICE_ATTR(nohz_full, 0444, print_cpus_nohz_full, NULL);
static void cpu_device_release(struct device *dev)
......@@ -443,6 +457,9 @@ static struct attribute *cpu_root_attrs[] = {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment