lkml.org 
[lkml]   [2012]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v1 1/2] sched: unified sched_powersavings sysfs tunable
* Peter Zijlstra <a.p.zijlstra@chello.nl> [2012-01-25 15:53:01]:

> On Mon, 2012-01-16 at 21:52 +0530, Vaidyanathan Srinivasan wrote:
> > +++ b/block/blk.h
> > @@ -167,14 +167,15 @@ static inline int queue_congestion_off_threshold(struct request_queue *q)
> > static inline int blk_cpu_to_group(int cpu)
> > {
> > int group = NR_CPUS;
> > -#ifdef CONFIG_SCHED_MC
> > - const struct cpumask *mask = cpu_coregroup_mask(cpu);
> > - group = cpumask_first(mask);
> > -#elif defined(CONFIG_SCHED_SMT)
> > - group = cpumask_first(topology_thread_cpumask(cpu));
> > +#ifdef CONFIG_SCHED_POWERSAVE
> > + if (smt_capable())
> > + group = cpumask_first(topology_thread_cpumask(cpu));
> > + else
> > + group = cpumask_first(cpu_coregroup_mask(cpu));
> > #else
> > return cpu;
> > #endif
> > + /* Possible dead code?? */
> > if (likely(group < NR_CPUS))
> > return group;
> > return cpu;
>
> After going, WTF is block doing! I had a closer look and this doesn't
> seem right at all. The old code would use coregroup_mask when SCHED_MC
> && SCHED_SMT, the new code does something else.
>
> Jens, what is this thing trying to do?

I understood the requirement as get first cpu in the 'core' on
a hyper-threaded system and first cpu in the 'socket' on
a non-threaded system for best cache affinity. Based on Jens
explanation and Peter's patch, identifying last-level shared cache
works best for this case.

--Vaidy



\
 
 \ /
  Last update: 2012-01-27 10:37    [W:0.067 / U:1.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site