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: <1289850517.3004.21.camel@localhost.localdomain>
Date:	Mon, 15 Nov 2010 11:48:37 -0800
From:	john stultz <johnstul@...ibm.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Linus Walleij <linus.walleij@...ricsson.com>,
	linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
	Nicolas Pitre <nico@...xnic.net>,
	Colin Cross <ccross@...gle.com>,
	Ingo Molnar <mingo@...hat.com>,
	Rabin Vincent <rabin.vincent@...ricsson.com>
Subject: Re: [PATCH] clocksource: document some basic concepts

On Mon, 2010-11-15 at 11:48 +0100, Peter Zijlstra wrote:
> On Mon, 2010-11-15 at 11:33 +0100, Linus Walleij wrote:
> > +sched_clock()
> > +-------------
> > +
> > +In addition to the clock sources and clock events there is a special weak
> > +function in the kernel called sched_clock(). This function shall return the
> > +number of nanoseconds since the system was started. An architecture may or
> > +may not provide an implementation of sched_clock() on its own.
> > +
> > +As the name suggests, sched_clock() is used for scheduling the system,
> > +determining the absolute timeslice for a certain process in the CFS scheduler
> > +for example. It is also used for printk timestamps when you have selected to
> > +include time information in printk for things like bootcharts.
> > +
> > +Compared to clock sources, sched_clock() has to be very fast: it is called
> > +much more often, especially by the scheduler. If you have to do trade-offs
> > +between accuracy compared to the clock source, you may sacrifice accuracy
> > +for speed in sched_clock(). It however require the same basic characteristics
> > +as the clock source, i.e. it has to be monotonic.
> 
> Not so, we prefer it be synchronized and monotonic, but we don't require
> so, see below.
> 
> > +The sched_clock() function may wrap only on unsigned long long boundaries,
> > +i.e. after 64 bits. Since this is a nanosecond value this will mean it wraps
> > +after circa 585 years. (For most practical systems this means "never".)
> 
> Currently true, John Stultz was going to look into ammending this by
> teaching the kernel/sched_clock.c bits about early wraps (and a way for
> architectures to specify this)

I'd like to, although at the moment I don't have much space on my plate
to do this, so in the mean time, if someone has time and interest into
looking at this, ping me and I can lay out the basics of what likely
should be done.

thanks
-john


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