[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49EF4E14.6090708@ti.com>
Date: Wed, 22 Apr 2009 12:04:20 -0500
From: Jon Hunter <jon-hunter@...com>
To: Chris Friesen <cfriesen@...tel.com>
CC: john stultz <johnstul@...ibm.com>, 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
Chris Friesen wrote:
> Isn't "long long" guaranteed to be 64-bit on all linux systems?
If long long is guaranteed to be 64-bits this is the way to go. Looks
like there was some previous discussion on making u64 always a long
long, but I am not sure that this happened [1]. So may be this does
confirm this?
> Unless the width is critical, I'd prefer to stay away from u64 until it
> gets unified between architectures. I recently ran into a problem
> printk-ing a "u64" value because it was a different type on ppc64 than
> x86-64.
It is not critical but maybe more ideal, as it would be nice to be
explicit that this variable is intended to be 64bits. In fact the issue
you saw with the printk is one of the reasons that I previously
mentioned of why I had opted to stay with long long. I also found that
this issue was discussed in the thread I mentioned above [1]. Seems like
a common problem.
The alternative is to use u64 and make sure that all printks cast the
variable to long long where necessary. However, this is not clean and
you do run the risk of a new print being added that does not take this
into account and breaks the code for some architectures. So I wished to
avoid this.
For this specific case using long long should be fine. Even if there is
a case where long long is not 64bits, then this would not break
functionality, simply increase of decrease the dynamic range of
max_delta_ns and min_delta_ns.
Cheers
Jon
[1] http://lkml.indiana.edu/hypermail/linux/kernel/0807.2/2805.html
--
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