lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0jExEJRM=aJhEpKoVjvppDz_x+pYG2-HSQUuehccwnVTQ@mail.gmail.com>
Date:   Tue, 22 Jun 2021 16:44:11 +0200
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Lukasz Luba <lukasz.luba@....com>
Cc:     "Rafael J. Wysocki" <rafael@...nel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        Linux PM <linux-pm@...r.kernel.org>,
        Amit Kucheria <amitk@...nel.org>,
        "Zhang, Rui" <rui.zhang@...el.com>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Chris Redpath <Chris.Redpath@....com>, Beata.Michalska@....com,
        Viresh Kumar <viresh.kumar@...aro.org>,
        "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Amit Kachhap <amit.kachhap@...il.com>
Subject: Re: [RFC PATCH 2/4] cpuidle: Add Active Stats calls tracking idle entry/exit

On Tue, Jun 22, 2021 at 3:59 PM Lukasz Luba <lukasz.luba@....com> wrote:
>
>
>
> On 6/22/21 1:33 PM, Rafael J. Wysocki wrote:
> > On Tue, Jun 22, 2021 at 9:59 AM Lukasz Luba <lukasz.luba@....com> wrote:
> >>
> >> The Active Stats framework tracks and accounts the activity of the CPU
> >> for each performance level. It accounts the real residency,
> >
> > No, it doesn't.  It just measures the time between the entry and exit
> > and that's not the real residency (because it doesn't take the exit
> > latency into account, for example).
>
> It's 'just' a 'model' and as other models has limitations, but it's
> better than existing one, which IPA has to use:
> cpu_util + currect_freq_at_sampling_time

But the idle duration is already measured by cpuidle as
last_residency_ns.  Why does it need to be measured once more in
addition to that?

> >
> >> when the CPU was not idle, at a given performance level. This patch adds needed calls
> >> which provide the CPU idle entry/exit events to the Active Stats
> >> framework.
> >
> > And it adds overhead to overhead-sensitive code.
> >
> > AFAICS, some users of that code will not really get the benefit, so
> > adding the overhead to it is questionable.
> >
> > First, why is the existing instrumentation in the idle loop insufficient?
>
> The instrumentation (tracing) cannot be used at run time AFAIK. I need
> this idle + freq information combined in a running platform, not for
> post-processing (like we have in LISA). The thermal governor IPA would
> use them for used power estimation.

What about snapshotting last_residency_ns in the CPU wakeup path?

> >
> > Second, why do you need to add locking to this code?
>
> The idle entry/exit updates the CPU's accounting data structure.
> There is a reader of those data structures: thermal governor,
> run from different CPU, which is the reason why I put locking for them.

So please consider doing it in a lockless manner and avoid running
this code when it is not needed in the first place.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ