Re: [PATCH 1/3] sched: Fix nohz_kick_needed to consider the nr_busyof the parent domain's group

From: Peter Zijlstra
Date: Tue Oct 29 2013 - 09:26:56 EST

On Tue, Oct 29, 2013 at 09:00:52AM +0530, Preeti U Murthy wrote:
> > Oh nice, that gets rid of the multiple atomics, and it nicely splits
> > this nohz logic into per topology groups -- now if only we could split
> > the rest too :-)
> I am sorry, I don't get you here. By the 'rest', do you refer to
> nohz_kick_needed() as below? Or am I missing something?

Nah, the rest of the NOHZ infrastructure. Currently its global state;
there were some patches a few years ago that attempted to make that
per-node state, but that work stalled due to people switching jobs.

> >> + sd = highest_flag_domain(cpu, SD_ASYM_PACKING);
> >> +
> >> + if (sd && (cpumask_first_and(nohz.idle_cpus_mask,
> >> + sched_domain_span(sd)) < cpu))
> >> + goto need_kick_unlock;
> >> +
> >> rcu_read_unlock();
> >> return 0;
> >
> > This again is a bit sad; most archs will not have SD_ASYM_PACKING set at
> > all; this means that they all will do a complete (and pointless) sched
> > domain tree walk here.
> There will not be a 'complete' sched domain tree walk right? The
> iteration will break at the first level of the sched domain for those
> archs which do not have SD_ASYM_PACKING set at all.

Ah indeed; I think I got confused due to me modifying
highest_flag_domain() earlier to assume a flag is carried from the
lowest domain upwards.

> But it is true that doing a sched domain tree walk regularly is a bad
> idea, might as well update the domain with SD_ASYM_PACKING flag set once
> and query this domain when required.
> I will send out the patch with sd_asym domain introduced rather than the
> above.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at