[lkml]   [2018]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [RFC PATCH v3 03/10] PM: Introduce an Energy Model management framework
On Tuesday 19 Jun 2018 at 13:34:08 (+0200), Peter Zijlstra wrote:
> On Mon, May 21, 2018 at 03:24:58PM +0100, Quentin Perret wrote:
> > +struct em_freq_domain *em_cpu_get(int cpu)
> > +{
> > + struct em_freq_domain *fd;
> > + unsigned long flags;
> > +
> > + read_lock_irqsave(&em_data_lock, flags);
> > + fd = per_cpu(em_data, cpu);
> > + read_unlock_irqrestore(&em_data_lock, flags);
> Why can't this use RCU? This is the exact thing read_locks are terrible
> at and RCU excells at.

So the idea was that clients (the scheduler for ex) can get a reference
to a frequency domain object once, and they're guaranteed it always
exists without asking for it again.

For example, my proposal was to have the scheduler (patch 05) build its
own private list of frequency domains on which it can iterate efficiently
in the wake-up path. If we protect this per_cpu variable with RCU, then
this isn't possible any-more. The scheduler will have to re-ask
em_cpu_get() at every wake-up, and that makes iterating over frequency
domains a whole lot more complex.

Does that make any sense ?


 \ /
  Last update: 2018-06-19 14:59    [W:0.199 / U:1.824 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site