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: <20120228081659.GF21106@elte.hu>
Date:	Tue, 28 Feb 2012 09:16:59 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	John Stultz <john.stultz@...aro.org>
Cc:	lkml <linux-kernel@...r.kernel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Eric Dumazet <eric.dumazet@...il.com>,
	Richard Cochran <richardcochran@...il.com>
Subject: Re: [PATCH 5/7] time: Shadow cycle_last in timekeeper structure


* John Stultz <john.stultz@...aro.org> wrote:

> @@ -184,7 +186,7 @@ static inline s64 timekeeping_get_ns(void)
>  	cycle_now = clock->read(clock);
>  
>  	/* calculate the delta since the last update_wall_time: */
> -	cycle_delta = (cycle_now - clock->cycle_last) & clock->mask;
> +	cycle_delta = (cycle_now - timekeeper.cycle_last) & clock->mask;

Just a general code design observation: the way how the global 
'timekeeper' structure is accessed is rather ugly.

The standard method is to pass it in to timekeeping_get_ns() 
(and other methods) as a parameter, with the highest level 
taking the address via &timekeeping.

That will also make the code shorter and more obvious: the 
familar tk->cycle_last pattern instead of the current mixed uses 
of timekeeping.cycle_last and tk->cycle_last.

There's many similar patterns throughout this code, they need to 
be fixed as well.

Thanks,

	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