Martin Schlemmer wrote: > On Tue, 2004-01-06 at 00:33, Matthew Dobson wrote: > >>Jesse Barnes wrote: >> >>>On Mon, Jan 05, 2004 at 01:22:57PM -0800, Matthew Dobson wrote: >>> >>> >>>>Jesse had acked the patch in an earlier itteration. The only thing >>>>that's changed is some line offsets whilst porting the patch forward. >>>> >>>>Jesse (or anyone else?), any objections to this patch as a superset of >>>>yours? >>> >>> >>>No objections here. Of course, you'll have to rediff against the >>>current tree since that stuff has been merged for awhile now. On a >>>somewhat related note, Martin mentioned that he'd like to get rid of >>>memblks. I'm all for that too; they just seem to get in the way. >>> >>>Jesse >>> >> >>Yeah... didn't actually attatch the patch to that last email, did I? >>Brain slowly transitioning back into "on" mode after a couple weeks >>solidly in the "off" position. >> > > > Get this with gcc-3.3.2 cvs: > > -- > include/linux/mm.h: In function `page_nodenum': > include/linux/mm.h:337: warning: right shift count >= width of type > include/linux/mm.h:337: warning: suggest parentheses around + or - > inside shift > -- > > Think we could get those () in to make it more clear and the compiler > happy? > > > Thanks, Ok... Not sure how gcc thinks it could be shifting >= width of type? page->flags is an unsigned long, NODEZONE_SHIFT + ZONES_SHIFT is by definition less than BITS_PER_LONG, but who knows, maybe the parens will kill both warnings, eh? Rediffed to include the parens, and here's a changelog, too! This patch does the following: 1) Rename ZONE_SHIFT to NODEZONE_SHIFT. This value is the number of bits to shift page->flags to get the node/zone part of the bitfield. 2) Add a macro called NODEZONE which takes a node number and zone number and returns a 'nodezone', a bitshifted composition of the two. 3) Create page_zonenum & page_nodenum, inline functions to return the node/zone a page belongs to with some simple bit twiddling, no pointer dereferences necessary. 4) Modify page_zone() and set_page_zone() to use the new NODEZONE_SHIFT. 5) Modify memmap_init_zone() & free_area_init_core() to use the new NODEZONE macros. 6) Fix up some comments to reflect the above changes. Cheers! -Matt