Re: [RFC][PATCH 4/4] sched, numa: Ignore pinned tasks

From: Srikar Dronamraju
Date: Mon May 18 2015 - 10:30:52 EST


* Peter Zijlstra <peterz@xxxxxxxxxxxxx> [2015-05-18 15:06:58]:

> On Mon, 2015-05-18 at 18:30 +0530, Srikar Dronamraju wrote:
> > >
> > > static void account_numa_dequeue(struct rq *rq, struct task_struct *p)
> > > {
> > > + if (p->nr_cpus_allowed == 1) {
> > > + rq->nr_pinned_running--;
> > > + WARN_ON_ONCE(p->numa_preferred_nid != -1);
> > > + }
> > > rq->nr_numa_running -= (p->numa_preferred_nid != -1);
> > > rq->nr_preferred_running -= (p->numa_preferred_nid == task_node(p));
> > > }
> >
> >
> > Shouldnt we reset p->numa_preferred_nid when we are setting the allowed
> > cpus in set_cpus_allowed_common()?
> >
> > Otherwise if an process is set a preferred node based on its numa faults
> > but then is pinned to a different cpu, then we can see this warning.:w!
>
> We should never get preferred_nid set when nr_cpus_allowed == 1, see the
> hunk that changes task_tick_numa.
>
> So we set preferred = -1 on pinning, do not partake in numa balancing
> while this is so, therefore it should still be so when we dequeue,
> right?

lets say if a thread were to do a sched_setaffinity on itself ;
would it not call account_numa_dequeue before account_numa_enqueue?


Also setting preferred = -1 in set_cpus_allowed avoids us from setting
it at account_numa_enqueue. account_numa_enqueue() would probably be
called more times than set_cpus_allowed.

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

--
Thanks and Regards
Srikar Dronamraju

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