Re: [TRIVIAL PATCH] Ensure pfn_to_nid() is always defined for i386

From: Martin J. Bligh
Date: Mon Jan 05 2004 - 18:18:54 EST


>> + * for now assume that 64Gb is max amount of RAM for whole system
>> + * 64Gb / 4096bytes/page = 16777216 pages
>> + */
>> +#define MAX_NR_PAGES 16777216
>> +#define MAX_ELEMENTS 256
>> +#define PAGES_PER_ELEMENT (MAX_NR_PAGES/MAX_ELEMENTS)
>
> Why not do the calculation in the define, and use PAGE_SIZE?
>
> If PAGE_SIZE isn't 4k will it break the rest of this code, or will the
> calculations make sence with larger PAGE_SIZE?
>
> Might as well make it easier to go in the direction of variable PAGE_SIZE
> instead of keeping the assumption.

The patch is just moving the code, not changing it ;-)
But yes, that value could probably be derived instead of hardcoded.
Separate patch though.

M.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/