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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191124132513.GA30453@avx2>
Date:   Sun, 24 Nov 2019 16:25:13 +0300
From:   Alexey Dobriyan <adobriyan@...il.com>
To:     Chen Yu <yu.c.chen@...el.com>
Cc:     x86@...nel.org, Thomas Gleixner <tglx@...utronix.de>,
        Borislav Petkov <bp@...en8.de>, Ingo Molnar <mingo@...hat.com>,
        "H. Peter Anvin" <hpa@...or.com>,
        Fenghua Yu <fenghua.yu@...el.com>,
        Reinette Chatre <reinette.chatre@...el.com>,
        Tony Luck <tony.luck@...el.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Michal Hocko <mhocko@...e.com>,
        Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
        linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Chen Yu <yu.chen.surf@...il.com>
Subject: Re: [PATCH][v4] x86/resctrl: Add task resctrl information display

On Fri, Nov 22, 2019 at 05:58:33PM +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}/resctrl to provide this
> information.

> --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c

> +		seq_printf(s, "/%s", rdtg->kn->name);
> +		list_for_each_entry(crg, &rdtg->mon.crdtgrp_list,
> +				    mon.crdtgrp_list) {
> +			if (tsk->rmid != crg->mon.rmid)
> +				continue;
> +			seq_printf(s, "%smon_groups/%s",
> +				   rdtg == &rdtgroup_default ? "" : "/",
> +				   crg->kn->name);
> +			break;
> +		}
> +		seq_puts(s, "\n");

This should be seq_putc().


> --- /dev/null
> +++ b/include/linux/resctrl.h
> @@ -0,0 +1,16 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _RESCTRL_H
> +#define _RESCTRL_H
> +
> +#ifdef CONFIG_PROC_CPU_RESCTRL
> +
> +#include <linux/proc_fs.h>

Forward declaring stuff should be more than enough.

> +int proc_resctrl_show(struct seq_file *m,
> +		      struct pid_namespace *ns,
> +		      struct pid *pid,
> +		      struct task_struct *tsk);
> +
> +#endif
> +
> +#endif /* _RESCTRL_H */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ