lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 14 Jan 2020 10:24:50 +0100
From:   Borislav Petkov <bp@...en8.de>
To:     Chen Yu <yu.c.chen@...el.com>
Cc:     x86@...nel.org, Bhupesh Sharma <bhsharma@...hat.com>,
        Dave Young <dyoung@...hat.com>,
        Aubrey Li <aubrey.li@...ux.intel.com>,
        Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
        Krzysztof Kozlowski <krzk@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        "H. Peter Anvin" <hpa@...or.com>,
        Alexey Dobriyan <adobriyan@...il.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Reinette Chatre <reinette.chatre@...el.com>,
        Fenghua Yu <fenghua.yu@...el.com>,
        Tony Luck <tony.luck@...el.com>,
        Chris Down <chris@...isdown.name>,
        Michal Hocko <mhocko@...e.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH][v6] x86/resctrl: Add task resctrl information display

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ