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: <Pine.LNX.4.64.0804021820370.26791@localhost.localdomain>
Date:	Wed, 2 Apr 2008 18:37:31 +0200 (CEST)
From:	Roman Zippel <zippel@...ux-m68k.org>
To:	John Stultz <johnstul@...ibm.com>
cc:	lkml <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 2/2] Introduce CLOCK_MONOTONIC_RAW

Hi,

On Wed, 2 Apr 2008, John Stultz wrote:

> > +	u64 raw_nsec;
> > +	long raw_sec;
> 
> 
> So, with the raw_sec being stored in the clocksource, and there not
> being a monotonic_raw value, doesn't this mean the MONOTONIC_RAW value
> will clear to zero on clocksource changes? 

It's copied during the clock change.

> > @@ -215,6 +218,8 @@ static inline void clocksource_calculate
> > 
> >  	/* Go back from cycles -> shifted ns, this time use ntp adjused mult */
> >  	c->xtime_interval = (u64)c->cycle_interval * c->mult;
> > +	c->raw_interval = ((u64)c->cycle_interval * c->mult_orig) <<
> > +			  (NTP_SCALE_SHIFT - c->shift);
> >  }
> 
> Could you explain further how this extra shift scaling is beneficial?

The value has a constant scale, which allows a few optimizations, e.g. 
look at update_wall_time(), where the 64bit-shift and 64bit-compare 
has become a simple 32bit-compare, as it's now very easy to extract the 
full nanosecond part and to drop the fraction part.

> (Additionally, if we're using it for more then just NTP's shift, we
> might want to change its name).

I don't mind.

bye, Roman
--
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