From: tip-bot for Vikas Shivappa <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, tony.luck@linux.intel.com,
mingo@kernel.org, hpa@zytor.com, vikas.shivappa@linux.intel.com,
tglx@linutronix.de
Subject: [tip:x86/cache] x86/intel_rdt/cqm: Add tasks file support
Date: Tue, 1 Aug 2017 13:52:09 -0700 [thread overview]
Message-ID: <tip-d6aaba615a482ce7d3ec218cf7b8d02d0d5753b8@git.kernel.org> (raw)
In-Reply-To: <1501017287-28083-16-git-send-email-vikas.shivappa@linux.intel.com>
Commit-ID: d6aaba615a482ce7d3ec218cf7b8d02d0d5753b8
Gitweb: http://git.kernel.org/tip/d6aaba615a482ce7d3ec218cf7b8d02d0d5753b8
Author: Vikas Shivappa <vikas.shivappa@linux.intel.com>
AuthorDate: Tue, 25 Jul 2017 14:14:34 -0700
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Tue, 1 Aug 2017 22:41:24 +0200
x86/intel_rdt/cqm: Add tasks file support
The root directory, ctrl_mon and monitor groups are populated
with a read/write file named "tasks". When read, it shows all the task
IDs assigned to the resource group.
Tasks can be added to groups by writing the PID to the file. A task can
be present in one "ctrl_mon" group "and" one "monitor" group. IOW a
PID_x can be seen in a ctrl_mon group and a monitor group at the same
time. When a task is added to a ctrl_mon group, it is automatically
removed from the previous ctrl_mon group where it belonged. Similarly if
a task is moved to a monitor group it is removed from the previous
monitor group . Also since the monitor groups can only have subset of
tasks of parent ctrl_mon group, a task can be moved to a monitor group
only if its already present in the parent ctrl_mon group.
Task membership is indicated by a new field in the task_struct "u32
rmid" which holds the RMID for the task. RMID=0 is reserved for the
default root group where the tasks belong to at mount.
[tony: zero the rmid if rdtgroup was deleted when task was being moved]
Signed-off-by: Tony Luck <tony.luck@linux.intel.com>
Signed-off-by: Vikas Shivappa <vikas.shivappa@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: ravi.v.shankar@intel.com
Cc: tony.luck@intel.com
Cc: fenghua.yu@intel.com
Cc: peterz@infradead.org
Cc: eranian@google.com
Cc: vikas.shivappa@intel.com
Cc: ak@linux.intel.com
Cc: davidcc@google.com
Cc: reinette.chatre@intel.com
Link: http://lkml.kernel.org/r/1501017287-28083-16-git-send-email-vikas.shivappa@linux.intel.com
---
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 19 +++++++++++++++++--
include/linux/sched.h | 1 +
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
index 8404054..aedad1d 100644
--- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
+++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
@@ -314,6 +314,7 @@ static void move_myself(struct callback_head *head)
if (atomic_dec_and_test(&rdtgrp->waitcount) &&
(rdtgrp->flags & RDT_DELETED)) {
current->closid = 0;
+ current->rmid = 0;
kfree(rdtgrp);
}
@@ -352,7 +353,20 @@ static int __rdtgroup_move_task(struct task_struct *tsk,
atomic_dec(&rdtgrp->waitcount);
kfree(callback);
} else {
- tsk->closid = rdtgrp->closid;
+ /*
+ * For ctrl_mon groups move both closid and rmid.
+ * For monitor groups, can move the tasks only from
+ * their parent CTRL group.
+ */
+ if (rdtgrp->type == RDTCTRL_GROUP) {
+ tsk->closid = rdtgrp->closid;
+ tsk->rmid = rdtgrp->mon.rmid;
+ } else if (rdtgrp->type == RDTMON_GROUP) {
+ if (rdtgrp->mon.parent->closid == tsk->closid)
+ tsk->rmid = rdtgrp->mon.rmid;
+ else
+ ret = -EINVAL;
+ }
}
return ret;
}
@@ -432,7 +446,8 @@ static void show_rdt_tasks(struct rdtgroup *r, struct seq_file *s)
rcu_read_lock();
for_each_process_thread(p, t) {
- if (t->closid == r->closid)
+ if ((r->type == RDTCTRL_GROUP && t->closid == r->closid) ||
+ (r->type == RDTMON_GROUP && t->rmid == r->mon.rmid))
seq_printf(s, "%d\n", t->pid);
}
rcu_read_unlock();
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 8839fd0..067a41a 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -900,6 +900,7 @@ struct task_struct {
#endif
#ifdef CONFIG_INTEL_RDT
u32 closid;
+ u32 rmid;
#endif
#ifdef CONFIG_FUTEX
struct robust_list_head __user *robust_list;
next prev parent reply other threads:[~2017-08-01 20:53 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-25 21:14 [PATCH 00/28 V2] Cqm3 patch series(along with MBM support) Vikas Shivappa
2017-07-25 21:14 ` [PATCH 01/28] x86/perf/cqm: Wipe out perf based cqm Vikas Shivappa
2017-08-01 20:46 ` [tip:x86/cache] " tip-bot for Vikas Shivappa
2017-07-25 21:14 ` [PATCH 02/28] x86/intel_rdt/cqm: Documentation for resctrl based RDT Monitoring Vikas Shivappa
2017-08-01 20:46 ` [tip:x86/cache] " tip-bot for Vikas Shivappa
2017-07-25 21:14 ` [PATCH 03/28] x86/intel_rdt: Introduce a common compile option for RDT Vikas Shivappa
2017-08-01 20:47 ` [tip:x86/cache] " tip-bot for Vikas Shivappa
2017-07-25 21:14 ` [PATCH 04/28] x86/intel_rdt: Change file names to accommodate RDT monitor code Vikas Shivappa
2017-08-01 20:47 ` [tip:x86/cache] " tip-bot for Vikas Shivappa
2017-07-25 21:14 ` [PATCH 05/28] x86/intel_rdt: Mark rdt_root and closid_alloc as static Vikas Shivappa
2017-08-01 20:48 ` [tip:x86/cache] " tip-bot for Reinette Chatre
2017-07-25 21:14 ` [PATCH 06/28] x86/intel_rdt: Cleanup namespace to support RDT monitoring Vikas Shivappa
2017-08-01 20:48 ` [tip:x86/cache] " tip-bot for Vikas Shivappa
2017-07-25 21:14 ` [PATCH 07/28] x86/intel_rdt: make rdt_resources_all more readable Vikas Shivappa
2017-08-01 20:48 ` [tip:x86/cache] x86/intel_rdt: Make " tip-bot for Vikas Shivappa
2017-07-25 21:14 ` [PATCH 08/28] x86/intel_rdt/cqm: Add RDT monitoring initialization Vikas Shivappa
2017-08-01 20:49 ` [tip:x86/cache] " tip-bot for Vikas Shivappa
2017-07-25 21:14 ` [PATCH 09/28] x86/intel_rdt/cqm: Add RMID(Resource monitoring ID) management Vikas Shivappa
2017-08-01 20:14 ` Thomas Gleixner
2017-08-02 7:41 ` Shivappa Vikas
2017-08-01 20:49 ` [tip:x86/cache] x86/intel_rdt/cqm: Add RMID (Resource " tip-bot for Vikas Shivappa
2017-07-25 21:14 ` [PATCH 10/28] x86/intel_rdt: Simplify info and base file lists Vikas Shivappa
2017-08-01 20:34 ` Thomas Gleixner
2017-08-01 20:50 ` [tip:x86/cache] " tip-bot for Tony luck
2017-07-25 21:14 ` [PATCH 11/28] x86/intel_rdt/cqm: Add info files for RDT monitoring Vikas Shivappa
2017-08-01 20:40 ` Thomas Gleixner
2017-08-01 20:50 ` [tip:x86/cache] " tip-bot for Vikas Shivappa
2017-07-25 21:14 ` [PATCH 12/28] x86/intel_rdt: Prepare for RDT monitoring mkdir support Vikas Shivappa
2017-08-01 20:50 ` [tip:x86/cache] " tip-bot for Vikas Shivappa
2017-07-25 21:14 ` [PATCH 13/28] x86/intel_rdt/cqm: Add mkdir support for RDT monitoring Vikas Shivappa
2017-08-01 20:51 ` [tip:x86/cache] " tip-bot for Vikas Shivappa
2017-07-25 21:14 ` [PATCH 14/28] x86/intel_rdt: Change closid type from int to u32 Vikas Shivappa
2017-08-01 20:51 ` [tip:x86/cache] " tip-bot for Vikas Shivappa
2017-07-25 21:14 ` [PATCH 15/28] x86/intel_rdt/cqm: Add tasks file support Vikas Shivappa
2017-08-01 20:52 ` tip-bot for Vikas Shivappa [this message]
2017-07-25 21:14 ` [PATCH 16/28] x86/intel_rdt: Prepare to add RDT monitor cpus " Vikas Shivappa
2017-08-01 19:49 ` Thomas Gleixner
2017-08-01 21:35 ` Shivappa Vikas
2017-08-01 20:52 ` [tip:x86/cache] " tip-bot for Vikas Shivappa
2017-07-25 21:14 ` [PATCH 17/28] x86/intel_rdt/cqm: Add " Vikas Shivappa
2017-08-01 20:52 ` [tip:x86/cache] " tip-bot for Vikas Shivappa
2017-07-25 21:14 ` [PATCH 18/28] x86/intel_rdt: Prepare for RDT monitor data support Vikas Shivappa
2017-08-01 20:53 ` [tip:x86/cache] " tip-bot for Vikas Shivappa
2017-07-25 21:14 ` [PATCH 19/28] x86/intel_rdt/cqm: Add mon_data Vikas Shivappa
2017-08-01 20:53 ` [tip:x86/cache] " tip-bot for Vikas Shivappa
2017-07-25 21:14 ` [PATCH 20/28] x86/intel_rdt: Separate the ctrl bits from rmdir Vikas Shivappa
2017-08-01 20:54 ` [tip:x86/cache] " tip-bot for Vikas Shivappa
2017-07-25 21:14 ` [PATCH 21/28] x86/intel_rdt/cqm: Add rmdir support Vikas Shivappa
2017-08-01 20:54 ` [tip:x86/cache] " tip-bot for Vikas Shivappa
2017-07-25 21:14 ` [PATCH 22/28] x86/intel_rdt/cqm: Add mount,umount support Vikas Shivappa
2017-08-01 20:54 ` [tip:x86/cache] " tip-bot for Vikas Shivappa
2017-07-25 21:14 ` [PATCH 23/28] x86/intel_rdt: Introduce rdt_enable_key for scheduling Vikas Shivappa
2017-08-01 20:55 ` [tip:x86/cache] " tip-bot for Vikas Shivappa
2017-07-25 21:14 ` [PATCH 24/28] x86/intel_rdt/cqm: Add sched_in support Vikas Shivappa
2017-08-01 20:55 ` [tip:x86/cache] " tip-bot for Vikas Shivappa
2017-07-25 21:14 ` [PATCH 25/28] x86/intel_rdt/cqm: Add hotcpu support Vikas Shivappa
2017-08-01 20:55 ` [tip:x86/cache] x86/intel_rdt/cqm: Add CPU hotplug support tip-bot for Vikas Shivappa
2017-07-25 21:14 ` [PATCH 26/28] x86/intel_rdt/mbm: Basic counting of MBM events (total and local) Vikas Shivappa
2017-08-01 20:56 ` [tip:x86/cache] " tip-bot for Tony Luck
2017-07-25 21:14 ` [PATCH 27/28] x86/intel_rdt/mbm: Add mbm counter initialization Vikas Shivappa
2017-08-01 20:56 ` [tip:x86/cache] " tip-bot for Vikas Shivappa
2017-07-25 21:14 ` [PATCH 28/28] x86/intel_rdt/mbm: Handle counter overflow Vikas Shivappa
2017-08-01 20:57 ` [tip:x86/cache] " tip-bot for Vikas Shivappa
2017-07-25 22:39 ` [PATCH] x86/intel_rdt: Show bitmask of shareable resource with other executing units Luck, Tony
2017-08-01 20:57 ` [tip:x86/cache] " tip-bot for Fenghua Yu
2017-07-25 22:42 ` [RFC PATCH] Add "-f" and "-F" flags to watch a "/sys? style file (single number) Luck, Tony
2017-08-01 20:51 ` [PATCH 00/28 V2] Cqm3 patch series(along with MBM support) Thomas Gleixner
2017-08-01 21:39 ` Shivappa Vikas
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=tip-d6aaba615a482ce7d3ec218cf7b8d02d0d5753b8@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=tony.luck@linux.intel.com \
--cc=vikas.shivappa@linux.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
Powered by JetHome