From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754506Ab3F1MdG (ORCPT ); Fri, 28 Jun 2013 08:33:06 -0400 Received: from cantor2.suse.de ([195.135.220.15]:35754 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751339Ab3F1MdE (ORCPT ); Fri, 28 Jun 2013 08:33:04 -0400 Date: Fri, 28 Jun 2013 13:33:00 +0100 From: Mel Gorman To: Srikar Dronamraju Cc: Peter Zijlstra , Ingo Molnar , Andrea Arcangeli , Johannes Weiner , Linux-MM , LKML Subject: Re: [PATCH 3/8] sched: Select a preferred node with the most numa hinting faults Message-ID: <20130628123300.GU1875@suse.de> References: <1372257487-9749-1-git-send-email-mgorman@suse.de> <1372257487-9749-4-git-send-email-mgorman@suse.de> <20130628061428.GB17195@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20130628061428.GB17195@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 28, 2013 at 11:44:28AM +0530, Srikar Dronamraju wrote: > * Mel Gorman [2013-06-26 15:38:02]: > > > This patch selects a preferred node for a task to run on based on the > > NUMA hinting faults. This information is later used to migrate tasks > > towards the node during balancing. > > > > Signed-off-by: Mel Gorman > > --- > > include/linux/sched.h | 1 + > > kernel/sched/core.c | 10 ++++++++++ > > kernel/sched/fair.c | 16 ++++++++++++++-- > > kernel/sched/sched.h | 2 +- > > 4 files changed, 26 insertions(+), 3 deletions(-) > > > > diff --git a/include/linux/sched.h b/include/linux/sched.h > > index 72861b4..ba46a64 100644 > > --- a/include/linux/sched.h > > +++ b/include/linux/sched.h > > @@ -1507,6 +1507,7 @@ struct task_struct { > > struct callback_head numa_work; > > > > unsigned long *numa_faults; > > + int numa_preferred_nid; > > #endif /* CONFIG_NUMA_BALANCING */ > > > > struct rcu_head rcu; > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > > index f332ec0..019baae 100644 > > --- a/kernel/sched/core.c > > +++ b/kernel/sched/core.c > > @@ -1593,6 +1593,7 @@ static void __sched_fork(struct task_struct *p) > > p->numa_scan_seq = p->mm ? p->mm->numa_scan_seq : 0; > > p->numa_migrate_seq = p->mm ? p->mm->numa_scan_seq - 1 : 0; > > p->numa_scan_period = sysctl_numa_balancing_scan_delay; > > + p->numa_preferred_nid = -1; > > Though we may not want to inherit faults, I think the tasks generally > share pages with their siblings, parent. So will it make sense to > inherit the preferred node? > If it really shared data with its parent then it will be detected by the PTE scanner later as normal. I would expect that initially it would be scheduled to run on CPUs on the local node and I would think that inheriting it here will not make a detectable difference. If you think it will, I can do it but then the data should certainly be cleared on exec. -- Mel Gorman SUSE Labs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx160.postini.com [74.125.245.160]) by kanga.kvack.org (Postfix) with SMTP id 2CD326B0031 for ; Fri, 28 Jun 2013 08:33:04 -0400 (EDT) Date: Fri, 28 Jun 2013 13:33:00 +0100 From: Mel Gorman Subject: Re: [PATCH 3/8] sched: Select a preferred node with the most numa hinting faults Message-ID: <20130628123300.GU1875@suse.de> References: <1372257487-9749-1-git-send-email-mgorman@suse.de> <1372257487-9749-4-git-send-email-mgorman@suse.de> <20130628061428.GB17195@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20130628061428.GB17195@linux.vnet.ibm.com> Sender: owner-linux-mm@kvack.org List-ID: To: Srikar Dronamraju Cc: Peter Zijlstra , Ingo Molnar , Andrea Arcangeli , Johannes Weiner , Linux-MM , LKML On Fri, Jun 28, 2013 at 11:44:28AM +0530, Srikar Dronamraju wrote: > * Mel Gorman [2013-06-26 15:38:02]: > > > This patch selects a preferred node for a task to run on based on the > > NUMA hinting faults. This information is later used to migrate tasks > > towards the node during balancing. > > > > Signed-off-by: Mel Gorman > > --- > > include/linux/sched.h | 1 + > > kernel/sched/core.c | 10 ++++++++++ > > kernel/sched/fair.c | 16 ++++++++++++++-- > > kernel/sched/sched.h | 2 +- > > 4 files changed, 26 insertions(+), 3 deletions(-) > > > > diff --git a/include/linux/sched.h b/include/linux/sched.h > > index 72861b4..ba46a64 100644 > > --- a/include/linux/sched.h > > +++ b/include/linux/sched.h > > @@ -1507,6 +1507,7 @@ struct task_struct { > > struct callback_head numa_work; > > > > unsigned long *numa_faults; > > + int numa_preferred_nid; > > #endif /* CONFIG_NUMA_BALANCING */ > > > > struct rcu_head rcu; > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > > index f332ec0..019baae 100644 > > --- a/kernel/sched/core.c > > +++ b/kernel/sched/core.c > > @@ -1593,6 +1593,7 @@ static void __sched_fork(struct task_struct *p) > > p->numa_scan_seq = p->mm ? p->mm->numa_scan_seq : 0; > > p->numa_migrate_seq = p->mm ? p->mm->numa_scan_seq - 1 : 0; > > p->numa_scan_period = sysctl_numa_balancing_scan_delay; > > + p->numa_preferred_nid = -1; > > Though we may not want to inherit faults, I think the tasks generally > share pages with their siblings, parent. So will it make sense to > inherit the preferred node? > If it really shared data with its parent then it will be detected by the PTE scanner later as normal. I would expect that initially it would be scheduled to run on CPUs on the local node and I would think that inheriting it here will not make a detectable difference. If you think it will, I can do it but then the data should certainly be cleared on exec. -- Mel Gorman SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org