From: Peter Zijlstra <peterz@infradead.org>
To: Alex Shi <alex.shi@intel.com>
Cc: mingo@redhat.com, tglx@linutronix.de,
linux-kernel@vger.kernel.org,
Venkatesh Pallipadi <venki@google.com>,
Suresh Siddha <suresh.b.siddha@intel.com>
Subject: Re: [PATCH 1/2] nohz: clean up select_nohz_load_balancer()
Date: Mon, 10 Sep 2012 17:26:14 +0200 [thread overview]
Message-ID: <1347290774.2124.16.camel@twins> (raw)
In-Reply-To: <1347261059-24747-1-git-send-email-alex.shi@intel.com>
On Mon, 2012-09-10 at 15:10 +0800, Alex Shi wrote:
> There is no load_balancer to be selected now. It just set state of
> nohz tick stopping.
>
> So rename the function, pass the 'cpu' from parameter and then
> remove the useless calling from tick_nohz_restart_sched_tick().
Please check who wrote the code you're patching and attempt to CC them
as well, in this case Venki and Suresh.
I think the patch is fine, although I think we could have picked a
better name, how about nohz_balance_enter_idle() ?
> Signed-off-by: Alex Shi <alex.shi@intel.com>
> ---
> include/linux/sched.h | 4 ++--
> kernel/sched/fair.c | 19 +++++++------------
> kernel/time/tick-sched.c | 3 +--
> 3 files changed, 10 insertions(+), 16 deletions(-)
>
> diff --git a/include/linux/sched.h b/include/linux/sched.h
> index b8c8664..5cba49c 100644
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -273,11 +273,11 @@ extern void init_idle_bootup_task(struct task_struct *idle);
> extern int runqueue_is_locked(int cpu);
>
> #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ)
> -extern void select_nohz_load_balancer(int stop_tick);
> +extern void set_nohz_tick_stopped(int cpu);
> extern void set_cpu_sd_state_idle(void);
> extern int get_nohz_timer_target(void);
> #else
> -static inline void select_nohz_load_balancer(int stop_tick) { }
> +static inline void set_nohz_tick_stopped(int cpu) { }
> static inline void set_cpu_sd_state_idle(void) { }
> #endif
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index c219bf8..5bbc4bf 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -4674,28 +4674,23 @@ void set_cpu_sd_state_idle(void)
> }
>
> /*
> - * This routine will record that this cpu is going idle with tick stopped.
> + * This routine will record that the cpu is going idle with tick stopped.
> * This info will be used in performing idle load balancing in the future.
> */
> -void select_nohz_load_balancer(int stop_tick)
> +void set_nohz_tick_stopped(int cpu)
> {
> - int cpu = smp_processor_id();
> -
> /*
> * If this cpu is going down, then nothing needs to be done.
> */
> if (!cpu_active(cpu))
> return;
>
> - if (stop_tick) {
> - if (test_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu)))
> - return;
> + if (test_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu)))
> + return;
>
> - cpumask_set_cpu(cpu, nohz.idle_cpus_mask);
> - atomic_inc(&nohz.nr_cpus);
> - set_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu));
> - }
> - return;
> + cpumask_set_cpu(cpu, nohz.idle_cpus_mask);
> + atomic_inc(&nohz.nr_cpus);
> + set_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu));
> }
>
> static int __cpuinit sched_ilb_notifier(struct notifier_block *nfb,
> diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
> index 024540f..eacde97 100644
> --- a/kernel/time/tick-sched.c
> +++ b/kernel/time/tick-sched.c
> @@ -372,7 +372,7 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts,
> * the scheduler tick in nohz_restart_sched_tick.
> */
> if (!ts->tick_stopped) {
> - select_nohz_load_balancer(1);
> + set_nohz_tick_stopped(cpu);
> calc_load_enter_idle();
>
> ts->last_tick = hrtimer_get_expires(&ts->sched_timer);
> @@ -569,7 +569,6 @@ static void tick_nohz_restart(struct tick_sched *ts, ktime_t now)
> static void tick_nohz_restart_sched_tick(struct tick_sched *ts, ktime_t now)
> {
> /* Update jiffies first */
> - select_nohz_load_balancer(0);
> tick_do_update_jiffies64(now);
> update_cpu_load_nohz();
>
next prev parent reply other threads:[~2012-09-10 15:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-10 7:10 [PATCH 1/2] nohz: clean up select_nohz_load_balancer() Alex Shi
2012-09-10 7:10 ` [PATCH 2/2] sched: trigger_load_balance clean up Alex Shi
2012-09-11 18:36 ` Suresh Siddha
2012-09-12 7:58 ` Alex Shi
2012-09-12 22:16 ` Suresh Siddha
2012-09-10 15:26 ` Peter Zijlstra [this message]
2012-09-11 1:27 ` [PATCH 1/2] nohz: clean up select_nohz_load_balancer() Alex Shi
2012-09-11 18:33 ` Suresh Siddha
2012-09-13 8:25 ` Peter Zijlstra
2012-09-14 6:15 ` [tip:sched/core] sched/nohz: Clean " tip-bot for Alex Shi
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=1347290774.2124.16.camel@twins \
--to=peterz@infradead.org \
--cc=alex.shi@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@linutronix.de \
--cc=venki@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).