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: <alpine.DEB.2.20.1610261706420.4983@nanos>
Date:   Wed, 26 Oct 2016 17:27:39 +0200 (CEST)
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Fenghua Yu <fenghua.yu@...el.com>
cc:     "H. Peter Anvin" <h.peter.anvin@...el.com>,
        Ingo Molnar <mingo@...e.hu>, Tony Luck <tony.luck@...el.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Stephane Eranian <eranian@...gle.com>,
        Borislav Petkov <bp@...e.de>,
        Dave Hansen <dave.hansen@...el.com>,
        Nilay Vaish <nilayvaish@...il.com>, Shaohua Li <shli@...com>,
        David Carrillo-Cisneros <davidcc@...gle.com>,
        Ravi V Shankar <ravi.v.shankar@...el.com>,
        Sai Prakhya <sai.praneeth.prakhya@...el.com>,
        Vikas Shivappa <vikas.shivappa@...ux.intel.com>,
        linux-kernel <linux-kernel@...r.kernel.org>, x86 <x86@...nel.org>
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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ