linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Chen Yu <yu.c.chen@intel.com>
Cc: x86@kernel.org, Bhupesh Sharma <bhsharma@redhat.com>,
	Dave Young <dyoung@redhat.com>,
	Aubrey Li <aubrey.li@linux.intel.com>,
	Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Tony Luck <tony.luck@intel.com>,
	Chris Down <chris@chrisdown.name>, Michal Hocko <mhocko@suse.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][v6] x86/resctrl: Add task resctrl information display
Date: Tue, 14 Jan 2020 10:24:50 +0100	[thread overview]
Message-ID: <20200114092450.GA31032@zn.tnic> (raw)
In-Reply-To: <20200110070608.18902-1-yu.c.chen@intel.com>

On Fri, Jan 10, 2020 at 03:06:08PM +0800, Chen Yu wrote:
> Monitoring tools that want to find out which resctrl control
> and monitor groups a task belongs to must currently read
> the "tasks" file in every group until they locate the process
> ID.
> 
> Add an additional file /proc/{pid}/cpu_resctrl to provide this
> information.
> 
> The output is as followed, for example:
> 
>  1)   ""
>       Resctrl is not available.
> 
>  2)   "/"
>       Task is part of the root group, task is not associated to
>       any monitor group.
> 
>  3)   "/mon_groups/mon0"
>       Task is part of the root group and monitor group mon0.
> 
>  4)   "/group0"
>       Task is part of resctrl control group group0, task is not
>       associated to any monitor group.
> 
>  5)   "/group0/mon_groups/mon1"
>       Task is part of resctrl control group group0 and monitor
>       group mon1.

So this way to present the information is totally non-intuitive,
IMNSVHO. What's wrong with:

1)
	res_group:
	mon_group:

2)
	res_group: /
	mon_group:

3)
	res_group: /
	mon_group: mon0

4)
	res_group: group0
	mon_group:

5)
	res_group: group0
	mon_group: mon1

?

You can even call the file "cpu_resctrl_groups" so that it is clear that
it will dump groups and then do:

	res: group0
	mon: mon1

which is both human-readable and easily greppable.

> diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> index 2e3b06d6bbc6..dcbf62d6b689 100644
> --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> @@ -725,6 +725,85 @@ static int rdtgroup_tasks_show(struct kernfs_open_file *of,
>  	return ret;
>  }
>  
> +#ifdef CONFIG_PROC_CPU_RESCTRL
> +
> +/*
> + * A task can only be part of one resctrl
> + * control group and of one monitor
> + * group which is associated to that resctrl
> + * control group.

Extend those comments to 80 cols.

> + * So one line is simple and clear enough:

Actually, the one line format you've done is confusing and can be done
much more human- and tool-readable.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

  reply	other threads:[~2020-01-14  9:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-10  7:06 [PATCH][v6] x86/resctrl: Add task resctrl information display Chen Yu
2020-01-14  9:24 ` Borislav Petkov [this message]
2020-01-14 16:04   ` Chen Yu

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=20200114092450.GA31032@zn.tnic \
    --to=bp@alien8.de \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=aubrey.li@linux.intel.com \
    --cc=bhsharma@redhat.com \
    --cc=chris@chrisdown.name \
    --cc=dyoung@redhat.com \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=krzk@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+samsung@kernel.org \
    --cc=mhocko@suse.com \
    --cc=mingo@redhat.com \
    --cc=reinette.chatre@intel.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    --cc=yu.c.chen@intel.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;
as well as URLs for NNTP newsgroup(s).