Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1714659

Re: [PATCH v7 1/2] sched/deadline: Add support for SD_PREFER_SIBLING on find_later_rq()

From Byungchul Park <byungchul.park@lge.com>
Newsgroups linux.kernel
Subject Re: [PATCH v7 1/2] sched/deadline: Add support for SD_PREFER_SIBLING on find_later_rq()
Date 2017-08-18 10:00 +0200
Message-ID <ufKmf-tm-21@gated-at.bofh.it> (permalink)
References <ufIDM-7Ok-17@gated-at.bofh.it> <ufIDM-7Ok-15@gated-at.bofh.it> <ufJTc-7z-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Aug 18, 2017 at 12:21:46AM -0700, Joel Fernandes (Google) wrote:
> Hi Byungchul,
> 
> On Thu, Aug 17, 2017 at 11:05 PM, Byungchul Park <byungchul.park@lge.com> wrote:
> > It would be better to avoid pushing tasks to other cpu within
> > a SD_PREFER_SIBLING domain, instead, get more chances to check other
> > siblings.
> >
> > Signed-off-by: Byungchul Park <byungchul.park@lge.com>
> > ---
> >  kernel/sched/deadline.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++---
> >  1 file changed, 52 insertions(+), 3 deletions(-)
> >
> > diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> > index 0223694..8f69a37 100644
> > --- a/kernel/sched/deadline.c
> > +++ b/kernel/sched/deadline.c
> > @@ -1319,12 +1319,35 @@ static struct task_struct *pick_earliest_pushable_dl_task(struct rq *rq, int cpu
> >
> >  static DEFINE_PER_CPU(cpumask_var_t, local_cpu_mask_dl);
> >
> > +/*
> > + * Find the first cpu in: mask & sd & ~prefer
> > + */
> > +static int find_cpu(const struct cpumask *mask,
> > +                   const struct sched_domain *sd,
> > +                   const struct sched_domain *prefer)
> > +{
> > +       const struct cpumask *sds = sched_domain_span(sd);
> > +       const struct cpumask *ps  = prefer ? sched_domain_span(prefer) : NULL;
> > +       int cpu = -1;
> > +
> > +       while ((cpu = cpumask_next(cpu, mask)) < nr_cpu_ids) {
> 
> This can be simplified to for_each_cpu(cpu, mask) ?

Indeed, exactly.

I will use that, thank you.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v7 1/2] sched/deadline: Add support for SD_PREFER_SIBLING on find_later_rq() Byungchul Park <byungchul.park@lge.com> - 2017-08-18 08:10 +0200
  Re: [PATCH v7 1/2] sched/deadline: Add support for SD_PREFER_SIBLING  on find_later_rq() "Joel Fernandes (Google)" <joel.opensrc@gmail.com> - 2017-08-18 09:30 +0200
    Re: [PATCH v7 1/2] sched/deadline: Add support for SD_PREFER_SIBLING  on find_later_rq() Byungchul Park <byungchul.park@lge.com> - 2017-08-18 10:00 +0200

csiph-web