提交 59f30abe 编写于 作者: R Rik van Riel 提交者: Greg Kroah-Hartman

show isolated cpus in sysfs

After system bootup, there is no totally reliable way to see
which CPUs are isolated, because the kernel may modify the
CPUs specified on the isolcpus= kernel command line option.

Export the CPU list that actually got isolated in sysfs,
specifically in the file /sys/devices/system/cpu/isolated

This can be used by system management tools like libvirt,
openstack, and others to ensure proper placement of tasks.
Suggested-by: NLi Zefan <lizefan@huawei.com>
Signed-off-by: NRik van Riel <riel@redhat.com>
Acked-by: NMike Galbraith <umgwanakikbuti@gmail.com>
Acked-by: NChris Metcalf <cmetcalf@ezchip.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 e2608180
无相关合并请求
......@@ -265,6 +265,17 @@ static ssize_t print_cpus_offline(struct device *dev,
}
static DEVICE_ATTR(offline, 0444, print_cpus_offline, NULL);
static ssize_t print_cpus_isolated(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(cpu_isolated_map));
return n;
}
static DEVICE_ATTR(isolated, 0444, print_cpus_isolated, NULL);
static void cpu_device_release(struct device *dev)
{
/*
......@@ -431,6 +442,7 @@ static struct attribute *cpu_root_attrs[] = {
&cpu_attrs[2].attr.attr,
&dev_attr_kernel_max.attr,
&dev_attr_offline.attr,
&dev_attr_isolated.attr,
#ifdef CONFIG_GENERIC_CPU_AUTOPROBE
&dev_attr_modalias.attr,
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部