Re: [PATCH v2 5/6] sched/dl: Optimize select_task_rq_dl() for non-DL curr task

From: Peter Zijlstra
Date: Tue Nov 04 2014 - 10:11:25 EST


On Tue, Nov 04, 2014 at 09:45:49AM -0500, Steven Rostedt wrote:
> > +++ b/kernel/sched/deadline.c
> > @@ -954,6 +954,9 @@ select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags)
> > struct task_struct *curr;
> > struct rq *rq;
> >
> > + if (p->nr_cpus_allowed == 1)
> > + goto out;
> > +
>
> This looks fine, and I'm wondering if we shouldn't just move this into
> kernel/sched/core.c: select_task_rq(). Why bother calling the select_rq
> code if the task is pinned?
>
> This change will make fair.c, rt.c, and deadline.c all start with the
> same logic. If this should be an optimization, just move it to core.c
> and be done with it.

Yeah, that makes sense. Back when, in the olden days, nr_cpus_allowed
was specific to the rt class, but we fixed that.
--
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/