Re: [PATCH] replace various uses of num_physpages by totalram_pages
From: Jan Beulich
Date: Wed Jul 01 2009 - 02:54:30 EST
>>> Rusty Russell <rusty@xxxxxxxxxxxxxxx> 01.07.09 06:57 >>>
>On Tue, 30 Jun 2009 08:38:32 pm Jan Beulich wrote:
>> Sizing of memory allocations shouldn't depend on the number of physical
>> pages found in a system, as that generally include (perhaps a huge
>> amount of) non-RAM pages. The amount of what actually is usable as
>> storage should instead be used as a basis here.
>
>I like this patch. Where's num_physpages used after this: should it be an
>arch-specific or even a static?
It's still being used for some hash value initialization in under net/, and in
the generic power management code (kernel/power/). While the earlier
part certainly looks replaceable, I'm not certain about the latter.
In any case it would seem like a first step might now be to no longer export
the symbol (or, for a transitional period, make it an unused export).
Once all uses are gone, making it arch specific (reducing its scope as much
as possible, up to complete elimination) would certainly seem desirable
(not the least to perhaps finally address comments like "How many end-
of-memory variables you have, grandma!").
Jan
--
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/