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]
Date:	Wed, 6 Mar 2013 22:33:08 +0100 (CET)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	Feng Tang <feng.tang@...el.com>
cc:	John Stultz <john.stultz@...aro.org>, Ingo Molnar <mingo@...e.hu>,
	"H. Peter Anvin" <hpa@...ux.intel.com>,
	Jason Gunthorpe <jgunthorpe@...idianresearch.com>,
	x86@...nel.org, Len Brown <lenb@...nel.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
	linux-kernel@...r.kernel.org, gong.chen@...ux.intel.com
Subject: Re: [PATCH v3 5/5] timekeeping: utilize the suspend-nonstop clocksource
 to count suspended time

On Wed, 6 Mar 2013, Feng Tang wrote:
> On Wed, Mar 06, 2013 at 03:15:49PM +0100, Thomas Gleixner wrote:
> > If the suspend time measured by the nonstop clocksource is 0.999 sec
> > then we throw it away and then let the RTC code inject inaccurate
> > sleep time? Brilliant design, really.
> 
> Emm, I wrote the code with an assumption that the sleep itself and the
> enter/exit processes will be longer than 1 second.
> 
> I can initialize the ts_delta to (0, 0} and change the check condition
> to 
> 	if (ts_delta.tv_sec || ts_delta.tv_nsec)
> 

To be honest, I hate this abuse of ts_delta as a condition. Use a
separate condition variable to make clear what the hell that code is
doing. This is not a fast path and I really prefer understandable code
over magic microoptimizations for no value.

Thanks,

	tglx
--
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