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] [day] [month] [year] [list]
Message-ID: <CAMuHMdXc7kbvbT5-ahYi1Yex4iyYzH44WUnFT26RObxWL_3UXA@mail.gmail.com>
Date:	Thu, 19 Mar 2015 09:54:06 +0100
From:	Geert Uytterhoeven <geert@...ux-m68k.org>
To:	"Rafael J. Wysocki" <rjw@...ysocki.net>
Cc:	Geert Uytterhoeven <geert+renesas@...der.be>,
	Kevin Hilman <khilman@...nel.org>,
	Ulf Hansson <ulf.hansson@...aro.org>,
	Linux PM list <linux-pm@...r.kernel.org>,
	Linux-sh list <linux-sh@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] PM / Domains: Skip latency measurements if timekeeping is suspended

Hi Rafael,

On Wed, Mar 18, 2015 at 11:30 PM, Rafael J. Wysocki <rjw@...ysocki.net> wrote:
> On Wednesday, March 18, 2015 05:25:46 PM Geert Uytterhoeven wrote:
>> The PM Domain code uses ktime_get() to perform various latency
>> measurements.  However, if ktime_get() is called while timekeeping is
>> suspended, the following warning is printed:
>>
>>     WARNING: CPU: 0 PID: 1340 at kernel/time/timekeeping.c:576 ktime_get+0x30/0xf4()
>>
>> This happens when resuming the PM Domain that contains the clock events
>> source. Chain of operations is:
>>
>>     timekeeping_resume()
>>     {
>>         clockevents_resume()
>>             sh_cmt_clock_event_resume()
>>                 pm_genpd_syscore_poweron()
>>                     pm_genpd_sync_poweron()
>>                         genpd_power_on()
>>                             ktime_get(), but timekeeping_suspended == 1
>>         ...
>>         timekeeping_suspended = 0;
>>     }
>>
>> Skip all latency measurements if timekeeping is suspended to fix this.
>
> I don't think that this is where we should fix it.  At least using
> timekeeping_suspended outside of the timekeeping core would not be
> welcome by its maintainers.

It's a public symbol, declared in a header file ;-)

>> Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
>> ---
>> I'm not sure if this is needed for all latency measurements.
>> So far I only encountered it while powering-on a clock domain during
>> resume from s2ram.
>
> The problem seems to be that the clock domain is powered on in a
> syscore resume routine which happens to be called before timekeeping_resume().

The clock domain is powered on from _within_ timekeeping_resume().

> It looks like we either need to force the right ordering somehow or have a
> special variant of GENPD_DEV_TIMED_CALLBACK() for syscore suspend/resume that
> won't do the latency measurement at all (which doesn't make much sense at
> this point, because time is effectively "frozen" then).

That's an option.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ