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 <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
@@ -139,7 +139,7 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
|
||||
#define K(x) ((x) << (PAGE_SHIFT - 10))
|
||||
si_meminfo(&i);
|
||||
si_swapinfo(&i);
|
||||
committed = atomic_read(&vm_committed_space);
|
||||
committed = atomic_long_read(&vm_committed_space);
|
||||
allowed = ((totalram_pages - hugetlb_total_pages())
|
||||
* sysctl_overcommit_ratio / 100) + total_swap_pages;
|
||||
|
||||
|
Reference in New Issue
Block a user