Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1465178

Re: [PATCH][RFC v4] timekeeping: ignore the bogus sleep time if pm_trace is enabled

From Chen Yu <yu.c.chen@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH][RFC v4] timekeeping: ignore the bogus sleep time if pm_trace is enabled
Date 2016-08-18 13:20 +0200
Message-ID <s7twB-7tk-1@gated-at.bofh.it> (permalink)
References <s7sTT-6Vc-13@gated-at.bofh.it> <s7t3z-6Zk-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Oliver,
On Thu, Aug 18, 2016 at 12:36:51PM +0200, 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?
> 
I think as Xunlei mentioned, the memory overflow issue should exist since
we changed timespec to timespec64 in timekeeping_debug, which should be
in 3.17. But the bogus sleep time caused by pm_trace should always be there as
long as we use rtc for sleep compensation.
> >  /**
> > @@ -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();
> 
OK, this is simpler, will do in next version.

thanks,
Yu
> 

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH][RFC v4] timekeeping: ignore the bogus sleep time if pm_trace is enabled Chen Yu <yu.c.chen@intel.com> - 2016-08-18 12:40 +0200
  Re: [PATCH][RFC v4] timekeeping: ignore the bogus sleep time if  pm_trace is enabled Oliver Neukum <oneukum@suse.com> - 2016-08-18 12:50 +0200
    Re: [PATCH][RFC v4] timekeeping: ignore the bogus sleep time if  pm_trace is enabled Xunlei Pang <xpang@redhat.com> - 2016-08-18 13:10 +0200
    Re: [PATCH][RFC v4] timekeeping: ignore the bogus sleep time if  pm_trace is enabled Chen Yu <yu.c.chen@intel.com> - 2016-08-18 13:20 +0200

csiph-web