mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00: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 <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:
parent
6c7c6afbb8
commit
80119ef5c8
5 changed files with 9 additions and 9 deletions
|
@ -17,14 +17,14 @@
|
|||
|
||||
extern int sysctl_overcommit_memory;
|
||||
extern int sysctl_overcommit_ratio;
|
||||
extern atomic_t vm_committed_space;
|
||||
extern atomic_long_t vm_committed_space;
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
extern void vm_acct_memory(long pages);
|
||||
#else
|
||||
static inline void vm_acct_memory(long pages)
|
||||
{
|
||||
atomic_add(pages, &vm_committed_space);
|
||||
atomic_long_add(pages, &vm_committed_space);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue