From: Frederic Weisbecker <fweisbec@gmail.com>
To: riel@redhat.com, Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org, tj@kernel.org,
umgwanakikbuti@gmail.com, lizefan@huawei.com,
gregkh@linuxfoundation.org
Subject: Re: [PATCH 1/2] show isolated cpus in sysfs
Date: Fri, 24 Apr 2015 23:11:29 +0200 [thread overview]
Message-ID: <20150424211120.GA26965@lerouge> (raw)
In-Reply-To: <1429903468-11099-2-git-send-email-riel@redhat.com>
On Fri, Apr 24, 2015 at 03:24:27PM -0400, riel@redhat.com wrote:
> From: Rik van Riel <riel@redhat.com>
>
> 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: Li Zefan <lizefan@huawei.com>
> Signed-off-by: Rik van Riel <riel@redhat.com>
This patch should go through Peterz.
> ---
> drivers/base/cpu.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
> index f160ea44a86d..ea23ee7b545b 100644
> --- a/drivers/base/cpu.c
> +++ b/drivers/base/cpu.c
> @@ -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
> --
> 2.1.0
>
next prev parent reply other threads:[~2015-04-24 21:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-24 19:24 [PATCH 0/2 resend] show isolated & nohz_full " riel
2015-04-24 19:24 ` [PATCH 1/2] show isolated " riel
2015-04-24 21:11 ` Frederic Weisbecker [this message]
2015-04-24 21:16 ` Tejun Heo
2015-04-24 21:22 ` Rik van Riel
2015-04-24 21:49 ` Greg KH
2015-05-04 21:15 ` Rik van Riel
2015-04-24 19:24 ` [PATCH 2/2] show nohz_full " riel
2015-04-28 19:18 ` Chris Metcalf
2015-04-25 5:29 ` [PATCH 0/2 resend] show isolated & " Mike Galbraith
-- strict thread matches above, loose matches on Subject: below --
2015-03-27 21:50 [PATCH 0/2] " riel
2015-03-27 21:50 ` [PATCH 1/2] show isolated " riel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150424211120.GA26965@lerouge \
--to=fweisbec@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=peterz@infradead.org \
--cc=riel@redhat.com \
--cc=tj@kernel.org \
--cc=umgwanakikbuti@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome