mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
mm: replace various uses of num_physpages by totalram_pages
Sizing of memory allocations shouldn't depend on the number of physical pages found in a system, as that generally includes (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. Some of the calculations (i.e. those not intending to use high memory) should likely even use (totalram_pages - totalhigh_pages). Signed-off-by: Jan Beulich <[email protected]> Acked-by: Rusty Russell <[email protected]> Acked-by: Ingo Molnar <[email protected]> Cc: Dave Airlie <[email protected]> Cc: Kyle McMartin <[email protected]> Cc: Jeremy Fitzhardinge <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Patrick McHardy <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
4738e1b9cf
commit
4481374ce8
21 changed files with 38 additions and 41 deletions
|
|
@ -1184,10 +1184,10 @@ SCTP_STATIC __init int sctp_init(void)
|
|||
/* Size and allocate the association hash table.
|
||||
* The methodology is similar to that of the tcp hash tables.
|
||||
*/
|
||||
if (num_physpages >= (128 * 1024))
|
||||
goal = num_physpages >> (22 - PAGE_SHIFT);
|
||||
if (totalram_pages >= (128 * 1024))
|
||||
goal = totalram_pages >> (22 - PAGE_SHIFT);
|
||||
else
|
||||
goal = num_physpages >> (24 - PAGE_SHIFT);
|
||||
goal = totalram_pages >> (24 - PAGE_SHIFT);
|
||||
|
||||
for (order = 0; (1UL << order) < goal; order++)
|
||||
;
|
||||
|
|
|
|||
Loading…
Reference in a new issue