Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1509531

Re: [PATCH v5 15/18] x86/intel_rdt: Add tasks files

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH v5 15/18] x86/intel_rdt: Add tasks files
Date 2016-10-26 17:40 +0200
Message-ID <swyt3-5IE-5@gated-at.bofh.it> (permalink)
References <sv4x3-3Ya-11@gated-at.bofh.it> <sv4x4-3Ya-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v5 15/18] x86/intel_rdt: Add tasks files "Fenghua Yu" <fenghua.yu@intel.com> - 2016-10-22 15:30 +0200
  Re: [PATCH v5 15/18] x86/intel_rdt: Add tasks files Thomas Gleixner <tglx@linutronix.de> - 2016-10-26 17:40 +0200

csiph-web