mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
mm: fix atomic_t overflow in vm
The atomic_t type is 32bit but a 64bit system can have more than 2^32 pages of virtual address space available. Without this we overflow on ludicrously large mappings Signed-off-by: Alan Cox <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
6c7c6afbb8
commit
80119ef5c8
5 changed files with 9 additions and 9 deletions
|
|
@ -503,7 +503,7 @@ void vm_acct_memory(long pages)
|
|||
local = &__get_cpu_var(committed_space);
|
||||
*local += pages;
|
||||
if (*local > ACCT_THRESHOLD || *local < -ACCT_THRESHOLD) {
|
||||
atomic_add(*local, &vm_committed_space);
|
||||
atomic_long_add(*local, &vm_committed_space);
|
||||
*local = 0;
|
||||
}
|
||||
preempt_enable();
|
||||
|
|
@ -520,7 +520,7 @@ static int cpu_swap_callback(struct notifier_block *nfb,
|
|||
|
||||
committed = &per_cpu(committed_space, (long)hcpu);
|
||||
if (action == CPU_DEAD || action == CPU_DEAD_FROZEN) {
|
||||
atomic_add(*committed, &vm_committed_space);
|
||||
atomic_long_add(*committed, &vm_committed_space);
|
||||
*committed = 0;
|
||||
drain_cpu_pagevecs((long)hcpu);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue