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]
Date:	Tue, 21 Apr 2009 22:07:27 -0500
From:	Jon Hunter <jon-hunter@...com>
To:	john stultz <johnstul@...ibm.com>
CC:	Ingo Molnar <mingo@...e.hu>, Thomas Gleixner <tglx@...utronix.de>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC][PATCH] Dynamic Tick: Allow 32-bit machines to sleep for
 more than 2.15 seconds

john stultz wrote:
> One other minor comment nit, if we're really meaning that max_delta_ns
> is a 64bit value, should we not just be using s64 and be explicit
> instead of converting longs to long longs?

Thanks for the feedback. I am in two minds about this. I agree and I 
would prefer to use s64/u64 as this is explicit with regard to the size 
of the data type. However, for right or wrong I ended up with long long 
because...

a). The function clockevent_delta2ns() uses LONG_MAX (or in my 
suggestion LLONG_MAX) as the upper limit. LONG_MAX and LLONG_MAX are 
defined as a long and long long respectively.

#define LONG_MAX        ((long)(~0UL>>1))
#define LLONG_MAX       ((long long)(~0ULL>>1))

b). There are a couple prints in the kernel for display max_delta_ns and 
min_delta_ns. The prints use %lu and %llu to indicate long and long long 
types respectively.

So to avoid using casts or possibly a type mismatch for some 
architecture that I may have overlooked I kept it as long long. So this 
assumes that long long will be a 64-bit type which I don't like. 
However, this would not cause any compilation issues even if long long 
turned out to be 32-bits or 128-bits (if this is even possible). We 
could use u64 and cast where necessary to be safe/correct if this is 
preferred.

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