Re: [PATCH 1/7] sched: Add static_key for asymmetric cpu capacity optimizations

2018-02-19 Thread Morten Rasmussen
On Fri, Feb 16, 2018 at 05:51:23PM +0100, Peter Zijlstra wrote: > On Fri, Feb 16, 2018 at 03:41:01PM +, Morten Rasmussen wrote: > > On Fri, Feb 16, 2018 at 02:47:04PM +0100, Peter Zijlstra wrote: > > > ? possibly with: > > > > > > else > > >

Re: [PATCH 1/7] sched: Add static_key for asymmetric cpu capacity optimizations

2018-02-19 Thread Morten Rasmussen
On Fri, Feb 16, 2018 at 05:51:23PM +0100, Peter Zijlstra wrote: > On Fri, Feb 16, 2018 at 03:41:01PM +, Morten Rasmussen wrote: > > On Fri, Feb 16, 2018 at 02:47:04PM +0100, Peter Zijlstra wrote: > > > ? possibly with: > > > > > > else > > >

Re: [PATCH 1/7] sched: Add static_key for asymmetric cpu capacity optimizations

2018-02-16 Thread Peter Zijlstra
On Fri, Feb 16, 2018 at 05:39:27PM +, Quentin Perret wrote: > AFAIU it should be safe, but without your check you'll have to go through > cpus_read_lock()/unlock() every time a CPU is hotplugged. There is probably > no good reason to re-do that again and again if the state of the key > never

Re: [PATCH 1/7] sched: Add static_key for asymmetric cpu capacity optimizations

2018-02-16 Thread Peter Zijlstra
On Fri, Feb 16, 2018 at 05:39:27PM +, Quentin Perret wrote: > AFAIU it should be safe, but without your check you'll have to go through > cpus_read_lock()/unlock() every time a CPU is hotplugged. There is probably > no good reason to re-do that again and again if the state of the key > never

Re: [PATCH 1/7] sched: Add static_key for asymmetric cpu capacity optimizations

2018-02-16 Thread Quentin Perret
Hi Morten, On Friday 16 Feb 2018 at 15:41:01 (+), Morten Rasmussen wrote: > On Fri, Feb 16, 2018 at 02:47:04PM +0100, Peter Zijlstra wrote: > > On Thu, Feb 15, 2018 at 04:20:48PM +, Morten Rasmussen wrote: > > > +static void update_asym_cpucapacity(int cpu) > > > +{ > > > + if

Re: [PATCH 1/7] sched: Add static_key for asymmetric cpu capacity optimizations

2018-02-16 Thread Quentin Perret
Hi Morten, On Friday 16 Feb 2018 at 15:41:01 (+), Morten Rasmussen wrote: > On Fri, Feb 16, 2018 at 02:47:04PM +0100, Peter Zijlstra wrote: > > On Thu, Feb 15, 2018 at 04:20:48PM +, Morten Rasmussen wrote: > > > +static void update_asym_cpucapacity(int cpu) > > > +{ > > > + if

Re: [PATCH 1/7] sched: Add static_key for asymmetric cpu capacity optimizations

2018-02-16 Thread Peter Zijlstra
On Fri, Feb 16, 2018 at 03:41:01PM +, Morten Rasmussen wrote: > On Fri, Feb 16, 2018 at 02:47:04PM +0100, Peter Zijlstra wrote: > > On Thu, Feb 15, 2018 at 04:20:48PM +, Morten Rasmussen wrote: > > > +static void update_asym_cpucapacity(int cpu) > > > +{ > > > + if

Re: [PATCH 1/7] sched: Add static_key for asymmetric cpu capacity optimizations

2018-02-16 Thread Peter Zijlstra
On Fri, Feb 16, 2018 at 03:41:01PM +, Morten Rasmussen wrote: > On Fri, Feb 16, 2018 at 02:47:04PM +0100, Peter Zijlstra wrote: > > On Thu, Feb 15, 2018 at 04:20:48PM +, Morten Rasmussen wrote: > > > +static void update_asym_cpucapacity(int cpu) > > > +{ > > > + if

Re: [PATCH 1/7] sched: Add static_key for asymmetric cpu capacity optimizations

2018-02-16 Thread Morten Rasmussen
On Fri, Feb 16, 2018 at 02:47:04PM +0100, Peter Zijlstra wrote: > On Thu, Feb 15, 2018 at 04:20:48PM +, Morten Rasmussen wrote: > > +static void update_asym_cpucapacity(int cpu) > > +{ > > + if (!static_branch_unlikely(_asym_cpucapacity) && > > + lowest_flag_domain(cpu,

Re: [PATCH 1/7] sched: Add static_key for asymmetric cpu capacity optimizations

2018-02-16 Thread Morten Rasmussen
On Fri, Feb 16, 2018 at 02:47:04PM +0100, Peter Zijlstra wrote: > On Thu, Feb 15, 2018 at 04:20:48PM +, Morten Rasmussen wrote: > > +static void update_asym_cpucapacity(int cpu) > > +{ > > + if (!static_branch_unlikely(_asym_cpucapacity) && > > + lowest_flag_domain(cpu,

Re: [PATCH 1/7] sched: Add static_key for asymmetric cpu capacity optimizations

2018-02-16 Thread Peter Zijlstra
On Thu, Feb 15, 2018 at 04:20:48PM +, Morten Rasmussen wrote: > +static void update_asym_cpucapacity(int cpu) > +{ > + if (!static_branch_unlikely(_asym_cpucapacity) && > + lowest_flag_domain(cpu, SD_ASYM_CPUCAPACITY)) > + static_branch_enable(_asym_cpucapacity); > +}

Re: [PATCH 1/7] sched: Add static_key for asymmetric cpu capacity optimizations

2018-02-16 Thread Peter Zijlstra
On Thu, Feb 15, 2018 at 04:20:48PM +, Morten Rasmussen wrote: > +static void update_asym_cpucapacity(int cpu) > +{ > + if (!static_branch_unlikely(_asym_cpucapacity) && > + lowest_flag_domain(cpu, SD_ASYM_CPUCAPACITY)) > + static_branch_enable(_asym_cpucapacity); > +}

[PATCH 1/7] sched: Add static_key for asymmetric cpu capacity optimizations

2018-02-15 Thread Morten Rasmussen
The existing asymmetric cpu capacity code should cause minimal overhead for others. Putting it behind a static_key, it has been done for SMT optimizations, would make it easier to extend and improve without causing harm to others moving forward. cc: Ingo Molnar cc: Peter

[PATCH 1/7] sched: Add static_key for asymmetric cpu capacity optimizations

2018-02-15 Thread Morten Rasmussen
The existing asymmetric cpu capacity code should cause minimal overhead for others. Putting it behind a static_key, it has been done for SMT optimizations, would make it easier to extend and improve without causing harm to others moving forward. cc: Ingo Molnar cc: Peter Zijlstra