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: <alpine.DEB.2.00.1203021510540.20257@router.home>
Date:	Fri, 2 Mar 2012 15:13:25 -0600 (CST)
From:	Christoph Lameter <cl@...ux.com>
To:	John Stultz <john.stultz@...aro.org>
cc:	lkml <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...e.hu>,
	Thomas Gleixner <tglx@...utronix.de>,
	Eric Dumazet <eric.dumazet@...il.com>,
	Richard Cochran <richardcochran@...il.com>
Subject: Re: [PATCH 1/9] time: Condense timekeeper.xtime into xtime_sec

On Thu, 1 Mar 2012, John Stultz wrote:

> +static inline void tk_normalize_xtime(struct timekeeper *tk)
> +{
> +	while (tk->xtime_nsec >= ((u64)NSEC_PER_SEC << tk->shift)) {
> +		tk->xtime_nsec -= (u64)NSEC_PER_SEC << tk->shift;
> +		tk->xtime_sec++;
> +	}
> +}

Could we avoid the loop?

y = ((u64)NSEC_PER_SEC << tk->shift));
tk->xtime_sec += tk->xtime_nsec / y;
tk->xtime_nsec %= y;

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