From: Xunlei Pang <xpang@redhat.com>
To: Oliver Neukum <oneukum@suse.com>, Chen Yu <yu.c.chen@intel.com>
Cc: linux-pm@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
"H . Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, "Rafael J . Wysocki" <rjw@rjwysocki.net>,
John Stultz <john.stultz@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>,
Xunlei Pang <xlpang@redhat.com>, Zhang Rui <rui.zhang@intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH][RFC v4] timekeeping: ignore the bogus sleep time if pm_trace is enabled
Date: Thu, 18 Aug 2016 19:04:28 +0800 [thread overview]
Message-ID: <57B5963C.7030101@redhat.com> (raw)
In-Reply-To: <1471516611.2157.22.camel@suse.com>
On 2016/08/18 at 18:36, Oliver Neukum wrote:
> On Thu, 2016-08-18 at 18:43 +0800, Chen Yu wrote:
>> Previously we encountered some memory overflow issues due to
>> the bogus sleep time brought by inconsistent rtc, which is
>> triggered when pm_trace is enabled, please refer to:
>> https://patchwork.kernel.org/patch/9286365/
>> It's improper in the first place to call __timekeeping_inject_sleeptime()
>> in case that pm_trace is enabled simply because that "hash" time value
>> will wreckage the timekeeping subsystem.
> Hi,
>
> do you know since when this bug exists?
Hi Oliver,
I think it should be since __timekeeping_inject_sleeptime() was updated to use @delta
of timespec64 type, which lets it survive the former timespec_valid_strict() check and
then results in an index larger than 31 into sleep_time_bin[] in subsequent call.
Regards,
Xunlei
>
>> /**
>> @@ -1662,6 +1668,12 @@ void timekeeping_resume(void)
>> } else if (timespec64_compare(&ts_new, &timekeeping_suspend_time) > 0) {
>> ts_delta = timespec64_sub(ts_new, timekeeping_suspend_time);
>> sleeptime_injected = true;
>> + /*
>> + * If rtc is used as persist clock thus it
>> + * would be bogus when pm_trace is enabled.
>> + */
>> + if (!persistent_clock_is_usable())
>> + sleeptime_injected = false;
>> }
>>
>> if (sleeptime_injected)
> How about
>
> sleeptime_injected = persistent_clock_is_usable();
>
> Regards
> Oliver
>
>
next prev parent reply other threads:[~2016-08-18 11:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-18 10:43 [PATCH][RFC v4] timekeeping: ignore the bogus sleep time if pm_trace is enabled Chen Yu
2016-08-18 10:36 ` Oliver Neukum
2016-08-18 11:04 ` Xunlei Pang [this message]
2016-08-18 11:24 ` Chen Yu
2016-08-27 7:08 ` Xunlei Pang
2016-08-28 1:57 ` Chen Yu
2016-08-28 8:28 ` Chen Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57B5963C.7030101@redhat.com \
--to=xpang@redhat.com \
--cc=hpa@zytor.com \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=oneukum@suse.com \
--cc=rjw@rjwysocki.net \
--cc=rui.zhang@intel.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=xlpang@redhat.com \
--cc=yu.c.chen@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).