mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -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
|
|
@ -3414,7 +3414,7 @@ int __init ip_rt_init(void)
|
|||
alloc_large_system_hash("IP route cache",
|
||||
sizeof(struct rt_hash_bucket),
|
||||
rhash_entries,
|
||||
(num_physpages >= 128 * 1024) ?
|
||||
(totalram_pages >= 128 * 1024) ?
|
||||
15 : 17,
|
||||
0,
|
||||
&rt_hash_log,
|
||||
|
|
|
|||
|
|
@ -2862,7 +2862,7 @@ void __init tcp_init(void)
|
|||
alloc_large_system_hash("TCP established",
|
||||
sizeof(struct inet_ehash_bucket),
|
||||
thash_entries,
|
||||
(num_physpages >= 128 * 1024) ?
|
||||
(totalram_pages >= 128 * 1024) ?
|
||||
13 : 15,
|
||||
0,
|
||||
&tcp_hashinfo.ehash_size,
|
||||
|
|
@ -2879,7 +2879,7 @@ void __init tcp_init(void)
|
|||
alloc_large_system_hash("TCP bind",
|
||||
sizeof(struct inet_bind_hashbucket),
|
||||
tcp_hashinfo.ehash_size,
|
||||
(num_physpages >= 128 * 1024) ?
|
||||
(totalram_pages >= 128 * 1024) ?
|
||||
13 : 15,
|
||||
0,
|
||||
&tcp_hashinfo.bhash_size,
|
||||
|
|
|
|||
Loading…
Reference in a new issue