Re: [PATCH 13/32] nohz: Adaptive tick stop and restart on nohz cpuset

Peter Zijlstra
2011-08-29T15:33:20Z

On Mon, 2011-08-15 at 17:52 +0200, Frederic Weisbecker wrote:
> +static void cpuset_nohz_restart_tick(void)
> +{
> + __get_cpu_var(task_nohz_mode) = 0;
> + tick_nohz_restart_sched_tick();
> +}
> +
> +void cpuset_update_nohz(void)
> +{
> + if (!tick_nohz_adaptive_mode())
> + return;
> +
> + if (!cpuset_nohz_can_stop_tick())
> + cpuset_nohz_restart_tick();
> +}
> +#endif
> +
> static void
> ttwu_stat(struct task_struct *p, int cpu, int wake_flags)
> {
> @@ -2560,6 +2592,8 @@ static void sched_ttwu_pending(void)
> ttwu_do_activate(rq, p, 0);
> }
>
> + cpuset_update_nohz();
> +
> raw_spin_unlock(&rq->lock);
> }
>
> @@ -2620,6 +2654,7 @@ static void ttwu_queue(struct task_struct *p, int cpu)
>
> raw_spin_lock(&rq->lock);
> ttwu_do_activate(rq, p, 0);
> + cpuset_update_nohz();
> raw_spin_unlock(&rq->lock);
> }

That really has nothing to do with cpusets, why doesn't that live in the
tick_nohz_* namespace? Something like tick_nohz_sched_wakeup() or so.