[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180604125318.GA38574@linux.vnet.ibm.com>
Date: Mon, 4 Jun 2018 05:53:18 -0700
From: Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Mel Gorman <mgorman@...hsingularity.net>,
Rik van Riel <riel@...riel.com>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 04/19] sched/numa: Set preferred_node based on best_cpu
* Peter Zijlstra <peterz@...radead.org> [2018-06-04 14:18:00]:
> On Mon, Jun 04, 2018 at 03:30:13PM +0530, Srikar Dronamraju wrote:
> > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> > index ea32a66..94091e6 100644
> > --- a/kernel/sched/fair.c
> > +++ b/kernel/sched/fair.c
> > @@ -1725,8 +1725,9 @@ static int task_numa_migrate(struct task_struct *p)
> > * Tasks that are "trapped" in such domains cannot be migrated
> > * elsewhere, so there is no point in (re)trying.
> > */
> > - if (unlikely(!sd)) {
> > - p->numa_preferred_nid = task_node(p);
> > + if (unlikely(!sd) && p->numa_preferred_nid != task_node(p)) {
> > + /* Set the new preferred node */
> > + sched_setnuma(p, task_node(p));
> > return -EINVAL;
> > }
> >
>
> That looks dodgy.. this would allow things to continue with !sd.
Okay so are we suggesting something like the below?
if (unlikely(!sd)) {
/* Set the new preferred node */
sched_setnuma(p, task_node(p));
return -EINVAL;
}
The reason for using sched_setnuma was to make sure we account numa
tasks correctly.
Powered by blists - more mailing lists