Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 97248
b: refs/heads/master
c: 80119ef
h: refs/heads/master
v: v3
  • Loading branch information
Alan Cox authored and Linus Torvalds committed May 24, 2008
1 parent 55cb5fc commit cd7bba1
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6c7c6afbb8c0e60d32a563cae7c6889211e9d9d8
refs/heads/master: 80119ef5c8153e0a6cc5edf00c083dc98a9bd348
2 changes: 1 addition & 1 deletion trunk/fs/proc/proc_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions trunk/include/linux/mman.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions trunk/mm/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ EXPORT_SYMBOL(vm_get_page_prot);
int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */
int sysctl_overcommit_ratio = 50; /* default is 50% */
int sysctl_max_map_count __read_mostly = DEFAULT_MAX_MAP_COUNT;
atomic_t vm_committed_space = ATOMIC_INIT(0);
atomic_long_t vm_committed_space = ATOMIC_LONG_INIT(0);

/*
* Check that a process has enough memory to allocate a new virtual
Expand Down Expand Up @@ -177,7 +177,7 @@ int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin)
* cast `allowed' as a signed long because vm_committed_space
* sometimes has a negative value
*/
if (atomic_read(&vm_committed_space) < (long)allowed)
if (atomic_long_read(&vm_committed_space) < (long)allowed)
return 0;
error:
vm_unacct_memory(pages);
Expand Down
4 changes: 2 additions & 2 deletions trunk/mm/nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct page *mem_map;
unsigned long max_mapnr;
unsigned long num_physpages;
unsigned long askedalloc, realalloc;
atomic_t vm_committed_space = ATOMIC_INIT(0);
atomic_long_t vm_committed_space = ATOMIC_LONG_INIT(0);
int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */
int sysctl_overcommit_ratio = 50; /* default is 50% */
int sysctl_max_map_count = DEFAULT_MAX_MAP_COUNT;
Expand Down Expand Up @@ -1410,7 +1410,7 @@ int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin)
* cast `allowed' as a signed long because vm_committed_space
* sometimes has a negative value
*/
if (atomic_read(&vm_committed_space) < (long)allowed)
if (atomic_long_read(&vm_committed_space) < (long)allowed)
return 0;
error:
vm_unacct_memory(pages);
Expand Down
4 changes: 2 additions & 2 deletions trunk/mm/swap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
}
Expand Down

0 comments on commit cd7bba1

Please sign in to comment.