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]
Date:	Tue, 17 Aug 2010 10:51:25 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Suresh Siddha <suresh.b.siddha@...el.com>
Cc:	"mingo@...e.hu" <mingo@...e.hu>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"chris@...stnet.net" <chris@...stnet.net>,
	"debian00@...ceadsl.fr" <debian00@...ceadsl.fr>,
	"hpa@...or.com" <hpa@...or.com>,
	"jonathan.protzenko@...il.com" <jonathan.protzenko@...il.com>,
	"mans@...sr.com" <mans@...sr.com>,
	"psastudio@...l.ru" <psastudio@...l.ru>,
	"rjw@...k.pl" <rjw@...k.pl>,
	"stephan.eicher@....de" <stephan.eicher@....de>,
	"sxxe@....de" <sxxe@....de>,
	"thomas@...hlinux.org" <thomas@...hlinux.org>,
	"venki@...gle.com" <venki@...gle.com>,
	"wonghow@...il.com" <wonghow@...il.com>,
	"stable@...nel.org" <stable@...nel.org>, tglx <tglx@...utronix.de>
Subject: Re: [patch 1/3] sched: init rt_avg stat whenever rq comes online

On Mon, 2010-08-16 at 21:25 +0200, Peter Zijlstra wrote:
> You can use something like:
> 
> suspend:
>  __get_cpu_var(cyc2ns_suspend) = sched_clock();
> 
> resume:
>  for_each_possible_cpu(i)
>    per_cpu(cyc2ns_offset, i) += per_cpu(cyc2ns_suspend);
> 
> or something like that to keep sched_clock() stable, which is exactly
> what most (all?) its users expect when we report the TSC is usable. 

That's actually broken, you only want a single offset, otherwise we
de-sync the TSC, which is bad.

So simply store the sched_clock() value at suspend time on the single
CPU that is still running, then on resume make sure sched_clock()
continues there by adding that stamp to all CPU offsets.


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