On Mon, Aug 07, 2006 at 12:35:49AM -0500, Manoj Srivastava wrote: > I don't like this patch. It would mean that a assignment to a > constant (which can be optimized away) is being replaced by a > function call -- with all that entails (context switches, branch > misses), etc.
> I would much rather do: > #include <asm/page.h> > #ifndef PAGE_SIZE > # define PAGE_SIZE getpagesize() > #endif > and only have the function call penalty hit powerpc > machines. It also minimizes the diff from upstream to three lines, > which is better :) Even if PAGE_SIZE is defined, it should not be used because it's not a meaningful compile-time value -- the kernel page size is a *runtime* variable, not a fixed value determined by the build environment. The kernel team has commented that PAGE_SIZE will be removed for all architectures in the near future, but even if it isn't, it's still incorrect to use a hard-coded value given that the kernel page size may (and does) vary between kernels for the same architecture. At least it would be better to do: #ifdef PAGE_SIZE #undef PAGE_SIZE #endif #define PAGE_SIZE getpagesize() Cheers, -- Steve Langasek Give me a lever long enough and a Free OS Debian Developer to set it on, and I can move the world. [EMAIL PROTECTED] http://www.debian.org/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]