mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
mm: rename global_page_state to global_zone_page_state
global_page_state is error prone as a recent bug report pointed out [1].
It only returns proper values for zone based counters as the enum it
gets suggests. We already have global_node_page_state so let's rename
global_page_state to global_zone_page_state to be more explicit here.
All existing users seems to be correct:
$ git grep "global_page_state(NR_" | sed 's@.*(\(NR_[A-Z_]*\)).*@\1@' | sort | uniq -c
2 NR_BOUNCE
2 NR_FREE_CMA_PAGES
11 NR_FREE_PAGES
1 NR_KERNEL_STACK_KB
1 NR_MLOCK
2 NR_PAGETABLE
This patch shouldn't introduce any functional change.
[1] http://lkml.kernel.org/r/[email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Michal Hocko <[email protected]>
Signed-off-by: Johannes Weiner <[email protected]>
Cc: Tetsuo Handa <[email protected]>
Cc: Josef Bacik <[email protected]>
Cc: Vladimir Davydov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
4da243ac1c
commit
c41f012ade
9 changed files with 25 additions and 25 deletions
|
|
@ -3514,7 +3514,7 @@ static int init_user_reserve(void)
|
|||
{
|
||||
unsigned long free_kbytes;
|
||||
|
||||
free_kbytes = global_page_state(NR_FREE_PAGES) << (PAGE_SHIFT - 10);
|
||||
free_kbytes = global_zone_page_state(NR_FREE_PAGES) << (PAGE_SHIFT - 10);
|
||||
|
||||
sysctl_user_reserve_kbytes = min(free_kbytes / 32, 1UL << 17);
|
||||
return 0;
|
||||
|
|
@ -3535,7 +3535,7 @@ static int init_admin_reserve(void)
|
|||
{
|
||||
unsigned long free_kbytes;
|
||||
|
||||
free_kbytes = global_page_state(NR_FREE_PAGES) << (PAGE_SHIFT - 10);
|
||||
free_kbytes = global_zone_page_state(NR_FREE_PAGES) << (PAGE_SHIFT - 10);
|
||||
|
||||
sysctl_admin_reserve_kbytes = min(free_kbytes / 32, 1UL << 13);
|
||||
return 0;
|
||||
|
|
@ -3579,7 +3579,7 @@ static int reserve_mem_notifier(struct notifier_block *nb,
|
|||
|
||||
break;
|
||||
case MEM_OFFLINE:
|
||||
free_kbytes = global_page_state(NR_FREE_PAGES) << (PAGE_SHIFT - 10);
|
||||
free_kbytes = global_zone_page_state(NR_FREE_PAGES) << (PAGE_SHIFT - 10);
|
||||
|
||||
if (sysctl_user_reserve_kbytes > free_kbytes) {
|
||||
init_user_reserve();
|
||||
|
|
|
|||
Loading…
Reference in a new issue