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]
Date:	Fri, 5 Jul 2013 11:07:41 +0100
From:	Mel Gorman <mgorman@...e.de>
To:	Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
Cc:	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Ingo Molnar <mingo@...nel.org>,
	Andrea Arcangeli <aarcange@...hat.com>,
	Johannes Weiner <hannes@...xchg.org>,
	Linux-MM <linux-mm@...ck.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 11/13] sched: Check current->mm before allocating NUMA
 faults

On Thu, Jul 04, 2013 at 06:18:23PM +0530, Srikar Dronamraju wrote:
> * Mel Gorman <mgorman@...e.de> [2013-07-03 15:21:38]:
> 
> > task_numa_placement checks current->mm but after buffers for faults
> > have already been uselessly allocated. Move the check earlier.
> > 
> > [peterz@...radead.org: Identified the problem]
> > Signed-off-by: Mel Gorman <mgorman@...e.de>
> > ---
> >  kernel/sched/fair.c | 22 ++++++++++++++--------
> >  1 file changed, 14 insertions(+), 8 deletions(-)
> > 
> > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> > index 336074f..3c796b0 100644
> > --- a/kernel/sched/fair.c
> > +++ b/kernel/sched/fair.c
> > @@ -870,8 +870,6 @@ static void task_numa_placement(struct task_struct *p)
> >  	int seq, nid, max_nid = 0;
> >  	unsigned long max_faults = 0;
> > 
> > -	if (!p->mm)	/* for example, ksmd faulting in a user's mm */
> > -		return;
> >  	seq = ACCESS_ONCE(p->mm->numa_scan_seq);
> >  	if (p->numa_scan_seq == seq)
> >  		return;
> > @@ -945,6 +943,12 @@ void task_numa_fault(int last_nid, int node, int pages, bool migrated)
> >  	if (!sched_feat_numa(NUMA))
> >  		return;
> > 
> > +	/* for example, ksmd faulting in a user's mm */
> > +	if (!p->mm) {
> > +		p->numa_scan_period = sysctl_numa_balancing_scan_period_max;
> 
> Naive question:
> Why are we resetting the scan_period?
> 

At the time I wrote it I was thinking of tick times and meant to recheck
if it's necessary but then it slipped my mind. The reset is unnecessary
as curr->mm is already checked.

-- 
Mel Gorman
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ