All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lei Wen <adrian.wenl@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Lei Wen <leiwen@marvell.com>,
	mingo@redhat.com, preeti.lkml@gmail.com,
	daniel.lezcano@linaro.org, viresh.kumar@linaro.org,
	xjian@marvell.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched: keep quiescent cpu out of idle balance loop
Date: Thu, 20 Feb 2014 17:15:26 +0800	[thread overview]
Message-ID: <CALZhoSSOWE54X8rAz-2VMhYN-N_3rzthTfRvTQcA5_dQqgoA3w@mail.gmail.com> (raw)
In-Reply-To: <20140220085017.GL6835@laptop.programming.kicks-ass.net>

On Thu, Feb 20, 2014 at 4:50 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> On Thu, Feb 20, 2014 at 10:42:51AM +0800, Lei Wen wrote:
>> >> -     int ilb = cpumask_first(nohz.idle_cpus_mask);
>> >> +     int ilb;
>> >> +     int cpu = smp_processor_id();
>> >> +     struct sched_domain *tmp;
>> >>
>> >> -     if (ilb < nr_cpu_ids && idle_cpu(ilb))
>> >> -             return ilb;
>> >> +     for_each_domain(cpu, tmp) {
>> >> +             ilb = cpumask_first_and(nohz.idle_cpus_mask,
>> >> +                             sched_domain_span(tmp));
>> >> +             if (ilb < nr_cpu_ids && idle_cpu(ilb))
>> >> +                     return ilb;
>> >> +     }
>> >
>> > The ILB code is bad; but you just made it horrible. Don't add pointless
>> > for_each_domain() iterations.
>> >
>> > I'm thinking something like:
>> >
>> >   ilb = cpumask_first_and(nohz.idle_cpus_mask, this_rq()->rd.span);
>> >
>> > Should work just fine, no?
>>
>> Yes, it has the same result as my previous patch did.
>>
>> >
>> > Better still would be to maybe not participate in the ILB in the first
>> > place and leave this selection loop alone.
>>
>> Not quitely get your point here...
>> Do you mean that you want idle cpu selection be put in earlier place
>> than current find_new_ilb is?
>
> I meant that if you stop an idle CPU setting its bit in
> nohz.idle_cpus_mask, you don't have to mask it out either.

Understand it.
I would reformat my previous patch according to your suggestion.

Thanks,
Lei

  reply	other threads:[~2014-02-20  9:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-19  5:20 [PATCH] sched: keep quiescent cpu out of idle balance loop Lei Wen
2014-02-19  9:04 ` Peter Zijlstra
2014-02-20  2:42   ` Lei Wen
2014-02-20  8:50     ` Peter Zijlstra
2014-02-20  9:15       ` Lei Wen [this message]
2014-02-20  9:17       ` Lei Wen
2014-02-20 12:04         ` Peter Zijlstra
2014-02-20 12:23         ` Peter Zijlstra
2014-02-21  2:23           ` [PATCH v2] " Lei Wen
2014-02-21  5:51             ` Mike Galbraith
2014-02-21  7:28               ` Lei Wen
2014-02-21  8:34                 ` Mike Galbraith
2014-02-21  9:15                   ` [PATCH v3] " Lei Wen
2014-02-21  9:41                     ` Mike Galbraith
2014-02-21  9:15                   ` [PATCH v2] " Mike Galbraith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALZhoSSOWE54X8rAz-2VMhYN-N_3rzthTfRvTQcA5_dQqgoA3w@mail.gmail.com \
    --to=adrian.wenl@gmail.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=leiwen@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=preeti.lkml@gmail.com \
    --cc=viresh.kumar@linaro.org \
    --cc=xjian@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.