From: Alexey Dobriyan <adobriyan@gmail.com>
To: Chen Yu <yu.c.chen@intel.com>
Cc: x86@kernel.org, Thomas Gleixner <tglx@linutronix.de>,
Borislav Petkov <bp@alien8.de>, Ingo Molnar <mingo@redhat.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Fenghua Yu <fenghua.yu@intel.com>,
Reinette Chatre <reinette.chatre@intel.com>,
Tony Luck <tony.luck@intel.com>,
Andrew Morton <akpm@linux-foundation.org>,
Michal Hocko <mhocko@suse.com>,
Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Chen Yu <yu.chen.surf@gmail.com>
Subject: Re: [PATCH][v4] x86/resctrl: Add task resctrl information display
Date: Sun, 24 Nov 2019 16:25:13 +0300 [thread overview]
Message-ID: <20191124132513.GA30453@avx2> (raw)
In-Reply-To: <20191122095833.20861-1-yu.c.chen@intel.com>
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 */
next prev parent reply other threads:[~2019-11-24 13:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-22 9:58 [PATCH][v4] x86/resctrl: Add task resctrl information display Chen Yu
2019-11-24 13:25 ` Alexey Dobriyan [this message]
2019-11-25 3:39 ` Yu Chen
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=20191124132513.GA30453@avx2 \
--to=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=fenghua.yu@intel.com \
--cc=hpa@zytor.com \
--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 \
--cc=yu.chen.surf@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;
as well as URLs for NNTP newsgroup(s).