Messages in this thread Patch in this message | | | Date | Wed, 26 Oct 2016 17:27:39 +0200 (CEST) | From | Thomas Gleixner <> | Subject | Re: [PATCH v5 15/18] x86/intel_rdt: Add tasks files |
| |
On Sat, 22 Oct 2016, Fenghua Yu wrote: > +static void show_rdt_tasks(struct rdtgroup *r, struct seq_file *s) > +{ > + struct task_struct *p; > + > + rcu_read_lock(); > + for_each_process(p) {
So this is restricted to processes, but with the write function I can put a single thread into a group ...
for_each_process_thread() is what you want.
> static int rdt_num_closid_show(struct kernfs_open_file *of, > @@ -594,6 +758,13 @@ static void rdt_reset_pqr_assoc_closid(void *v) > static void rmdir_all_sub(void) > { > struct rdtgroup *rdtgrp, *tmp; > + struct task_struct *p; > + > + /* move all tasks to default resource group */ > + read_lock(&tasklist_lock); > + for_each_process(p) > + p->closid = 0;
Same issue as above ....
> + read_unlock(&tasklist_lock); > > get_cpu(); > /* Reset PQR_ASSOC MSR on this cpu. */ > @@ -723,6 +894,7 @@ static int rdtgroup_rmdir(struct kernfs_node *kn) > { > struct rdtgroup *rdtgrp; > int cpu, ret = 0; > + struct task_struct *p; > > rdtgrp = rdtgroup_kn_lock_live(kn); > if (!rdtgrp) { > @@ -730,6 +902,14 @@ static int rdtgroup_rmdir(struct kernfs_node *kn) > return -ENOENT; > } > > + /* Give any tasks back to the default group */ > + read_lock(&tasklist_lock); > + for_each_process(p) { > + if (p->closid == rdtgrp->closid) > + p->closid = 0;
Once more.
> + } > + read_unlock(&tasklist_lock); > +
Thanks,
tglx
| |