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]
Message-ID: <20090403163248.GA21669@elte.hu>
Date:	Fri, 3 Apr 2009 18:32:48 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc:	Corey Ashford <cjashfor@...ux.vnet.ibm.com>,
	linux-kernel@...r.kernel.org, Paul Mackerras <paulus@...ba.org>
Subject: Re: perf_counter: request for three more sample data options


* Peter Zijlstra <a.p.zijlstra@...llo.nl> wrote:

> On Fri, 2009-04-03 at 00:25 -0700, Corey Ashford wrote:
> 
> > >> I am guessing the only difficult thing here would be obtaining the 
> > >> current time from an IRQ, especially NMI handler.  Is this difficult?
> > > 
> > > Yes, quite :-) I'll have to see what we can do there -- we could do a
> > > best effort thing with little to no guarantees I think.
> > > 
> > 
> > Best effort would be fine, I think.  I would assume that means 
> > that 99.9% of the time, you'll get a correct timestamp, and the 
> > rest are rubbish?  Or would there be a way to detect when you're 
> > not able to give a correct timestamp and in that case replace 
> > the timestamp field with a special sentinel, like all hex f's?
> 
> What I was thinking of was re-using some of the cpu_clock() 
> infrastructure. That provides us with a jiffy based GTOD sample, 
> cpu_clock() then uses TSC and a few filters to compute a current 
> timestamp.
> 
> I was thinking about cutting back those filters and thus trusting 
> the TSC more -- which on x86 can do any random odd thing. So 
> provided the TSC is not doing funny the results will be ok-ish.
> 
> This does mean however, that its not possible to know when its 
> gone bad.

Note that on latest mainline and on Nehalem CPUs that filter is 
being cut back already. So there's an opt-in mechanism to trust 
sched_clock() some more.

> Also, cpu_clock() can only provide monotonicity per-cpu, if a 
> value read on one cpu is compared to a value read on another cpu, 
> there can be a drift of at most 1-2 jiffies.

That should be a good start i think. If it causes any measurable 
jitter then the performance monitoring community is probably going 
to be the first one to notice! ;-) So there's good synergy IMO.

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