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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 13 Jul 2016 17:32:03 +0000
From:	"Yu, Fenghua" <fenghua.yu@...el.com>
To:	Thomas Gleixner <tglx@...utronix.de>
CC:	Ingo Molnar <mingo@...e.hu>,
	"Anvin, H Peter" <h.peter.anvin@...el.com>,
	"Luck, Tony" <tony.luck@...el.com>, Tejun Heo <tj@...nel.org>,
	"Borislav Petkov" <bp@...e.de>,
	Stephane Eranian <eranian@...gle.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Marcelo Tosatti <mtosatti@...hat.com>,
	"David Carrillo-Cisneros" <davidcc@...gle.com>,
	"Shankar, Ravi V" <ravi.v.shankar@...el.com>,
	Vikas Shivappa <vikas.shivappa@...ux.intel.com>,
	"Prakhya, Sai Praneeth" <sai.praneeth.prakhya@...el.com>,
	linux-kernel <linux-kernel@...r.kernel.org>, x86 <x86@...nel.org>
Subject: RE: [PATCH 24/32] Task fork and exit for rdtgroup

On Wed, July 2016, Thomas Gleixner wrote
> On Tue, 12 Jul 2016, Fenghua Yu wrote:
> > +void rdtgroup_post_fork(struct task_struct *child) {
> > +	if (!use_rdtgroup_tasks)
> > +		return;
> > +
> > +	spin_lock_irq(&rdtgroup_task_lock);
> > +	if (list_empty(&child->rg_list)) {
> 
> Why would the list be non empty after a fork?

In this situation for a pid:
1.rdtgroup_fork(): rg_list=null.
2.setup_task_rg_lists(): rg_list is setup
3.rdtgroup_fork(): rg_list is not empty

This situation happens only during rscctrl mount time. Before mount, post_fork()
returns from !use_rdtgroup_tasks and doesn't set up rg_list. After mount, rg_list()
is always empty in post_fork(). But we need to check rg_list for above situation.

Does that make sense? Any suggestion for better soluation?

> 
> > +		struct rdtgroup *rdtgrp = current->rdtgroup;
> > +
> > +		list_add_tail(&child->rg_list, &rdtgrp->pset.tasks);
> > +		child->rdtgroup = rdtgrp;
> > +		atomic_inc(&rdtgrp->pset.refcount);
> > +	}
> > +	spin_unlock_irq(&rdtgroup_task_lock);
> > +}
> > diff --git a/kernel/exit.c b/kernel/exit.c index 9e6e135..04346b6
> > 100644
> > --- a/kernel/exit.c
> > +++ b/kernel/exit.c
> > @@ -59,6 +59,7 @@
> >  #include <asm/unistd.h>
> >  #include <asm/pgtable.h>
> >  #include <asm/mmu_context.h>
> > +#include <asm/intel_rdt.h>
> >
> >  static void __unhash_process(struct task_struct *p, bool group_dead)
> > { @@ -757,6 +758,7 @@ void do_exit(long code)
> >  	perf_event_exit_task(tsk);
> >
> >  	cgroup_exit(tsk);
> > +	rdtgroup_exit(tsk);
> 
> -ENOSUCHFUNCTION
> 
> Please provide the implementations first and then hook it up not the other
> way round.

Will do.
> 
> Thanks,
> 
> 	tglx

Download attachment "IMG_20160712_165549743.jpg" of type "image/jpeg" (211443 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ