diff -uNrp linux-2.6.18.i686.orig/fs/proc/proc_misc.c linux-2.6.18.i686/fs/proc/proc_misc.c
--- linux-2.6.18.i686.orig/fs/proc/proc_misc.c	2010-06-02 15:52:05.886634000 -0700
+++ linux-2.6.18.i686/fs/proc/proc_misc.c	2010-06-02 16:56:25.987551000 -0700
@@ -135,7 +135,7 @@ static int meminfo_read_proc(char *page,
 #define K(x) ((x) << (PAGE_SHIFT - 10))
 	si_meminfo(&i);
 	si_swapinfo(&i);
-	committed = atomic_read(&vm_committed_space);
+	committed = percpu_counter_read_positive(&vm_committed_as);
 	allowed = ((totalram_pages - hugetlb_total_pages())
 		* sysctl_overcommit_ratio / 100) + total_swap_pages;
 
diff -uNrp linux-2.6.18.i686.orig/include/linux/mman.h linux-2.6.18.i686/include/linux/mman.h
--- linux-2.6.18.i686.orig/include/linux/mman.h	2006-09-19 20:42:06.000000000 -0700
+++ linux-2.6.18.i686/include/linux/mman.h	2010-06-02 16:56:25.990548000 -0700
@@ -12,21 +12,18 @@
 
 #ifdef __KERNEL__
 #include <linux/mm.h>
+#include <linux/percpu_counter.h>
 
 #include <asm/atomic.h>
 
 extern int sysctl_overcommit_memory;
 extern int sysctl_overcommit_ratio;
-extern atomic_t vm_committed_space;
+extern struct percpu_counter vm_committed_as;
 
-#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);
+	percpu_counter_add(&vm_committed_as, pages);
 }
-#endif
 
 static inline void vm_unacct_memory(long pages)
 {
diff -uNrp linux-2.6.18.i686.orig/include/linux/mm.h linux-2.6.18.i686/include/linux/mm.h
--- linux-2.6.18.i686.orig/include/linux/mm.h	2010-06-02 15:52:35.777315000 -0700
+++ linux-2.6.18.i686/include/linux/mm.h	2010-06-02 16:56:25.993548000 -0700
@@ -1011,6 +1011,7 @@ extern void memmap_init_zone(unsigned lo
 				unsigned long, enum memmap_context);
 extern void setup_per_zone_pages_min(void);
 extern void mem_init(void);
+extern void __init mmap_init(void);
 extern void show_mem(void);
 extern void si_meminfo(struct sysinfo * val);
 extern void si_meminfo_node(struct sysinfo *val, int nid);
diff -uNrp linux-2.6.18.i686.orig/kernel/fork.c linux-2.6.18.i686/kernel/fork.c
--- linux-2.6.18.i686.orig/kernel/fork.c	2010-06-02 15:52:29.267621000 -0700
+++ linux-2.6.18.i686/kernel/fork.c	2010-06-02 16:56:25.996548000 -0700
@@ -1562,6 +1562,7 @@ void __init proc_caches_init(void)
 	mm_cachep = kmem_cache_create("mm_struct",
 			sizeof(struct mm_struct), ARCH_MIN_MMSTRUCT_ALIGN,
 			SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
+	mmap_init();
 }
 
 
diff -uNrp linux-2.6.18.i686.orig/mm/mmap.c linux-2.6.18.i686/mm/mmap.c
--- linux-2.6.18.i686.orig/mm/mmap.c	2010-06-02 15:52:35.733316000 -0700
+++ linux-2.6.18.i686/mm/mmap.c	2010-06-02 17:02:22.983676000 -0700
@@ -76,7 +76,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);
+struct percpu_counter vm_committed_as;
 
 /*
  * Check that a process has enough memory to allocate a new virtual
@@ -169,11 +169,7 @@ int __vm_enough_memory(struct mm_struct 
 	   leave 3% of the size of this process for other processes */
 	allowed -= mm->total_vm / 32;
 
-	/*
-	 * cast `allowed' as a signed long because vm_committed_space
-	 * sometimes has a negative value
-	 */
-	if (atomic_read(&vm_committed_space) < (long)allowed)
+	if (percpu_counter_read_positive(&vm_committed_as) < allowed)
 		return 0;
 error:
 	vm_unacct_memory(pages);
@@ -2476,3 +2472,9 @@ void mm_drop_all_locks(struct mm_struct 
 
 	mutex_unlock(&mm_all_locks_mutex);
 }
+
+void __init mmap_init(void)
+{
+
+	percpu_counter_init(&vm_committed_as, 0);
+}
diff -uNrp linux-2.6.18.i686.orig/mm/nommu.c linux-2.6.18.i686/mm/nommu.c
--- linux-2.6.18.i686.orig/mm/nommu.c	2010-06-02 15:51:57.656985000 -0700
+++ linux-2.6.18.i686/mm/nommu.c	2010-06-02 17:07:13.444916000 -0700
@@ -37,7 +37,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);
+struct percpu_counter vm_committed_as;
 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;
@@ -267,6 +267,14 @@ asmlinkage unsigned long sys_brk(unsigne
 	return mm->brk = brk;
 }
 
+/*
+ * initialise the VMA 
+ */
+void __init mmap_init(void)
+{
+	percpu_counter_init(&vm_committed_as, 0);
+}
+
 #ifdef DEBUG
 static void show_process_blocks(void)
 {
@@ -1186,11 +1194,7 @@ int __vm_enough_memory(struct mm_struct 
 	   leave 3% of the size of this process for other processes */
 	allowed -= current->mm->total_vm / 32;
 
-	/*
-	 * cast `allowed' as a signed long because vm_committed_space
-	 * sometimes has a negative value
-	 */
-	if (atomic_read(&vm_committed_space) < (long)allowed)
+	if (percpu_counter_read_positive(&vm_committed_as) < allowed)
 		return 0;
 error:
 	vm_unacct_memory(pages);
diff -uNrp linux-2.6.18.i686.orig/mm/swap.c linux-2.6.18.i686/mm/swap.c
--- linux-2.6.18.i686.orig/mm/swap.c	2010-06-02 15:52:23.886841000 -0700
+++ linux-2.6.18.i686/mm/swap.c	2010-06-02 16:56:26.014550000 -0700
@@ -565,49 +565,6 @@ unsigned pagevec_lookup_tag(struct pagev
 
 EXPORT_SYMBOL(pagevec_lookup_tag);
 
-#ifdef CONFIG_SMP
-/*
- * We tolerate a little inaccuracy to avoid ping-ponging the counter between
- * CPUs
- */
-#define ACCT_THRESHOLD	max(16, NR_CPUS * 2)
-
-static DEFINE_PER_CPU(long, committed_space) = 0;
-
-void vm_acct_memory(long pages)
-{
-	long *local;
-
-	preempt_disable();
-	local = &__get_cpu_var(committed_space);
-	*local += pages;
-	if (*local > ACCT_THRESHOLD || *local < -ACCT_THRESHOLD) {
-		atomic_add(*local, &vm_committed_space);
-		*local = 0;
-	}
-	preempt_enable();
-}
-
-#ifdef CONFIG_HOTPLUG_CPU
-
-/* Drop the CPU's cached committed space back into the central pool. */
-static int cpu_swap_callback(struct notifier_block *nfb,
-			     unsigned long action,
-			     void *hcpu)
-{
-	long *committed;
-
-	committed = &per_cpu(committed_space, (long)hcpu);
-	if (action == CPU_DEAD) {
-		atomic_add(*committed, &vm_committed_space);
-		*committed = 0;
-		__lru_add_drain((long)hcpu);
-	}
-	return NOTIFY_OK;
-}
-#endif /* CONFIG_HOTPLUG_CPU */
-#endif /* CONFIG_SMP */
-
 /*
  * Perform any setup for the swap system
  */
@@ -624,5 +581,4 @@ void __init swap_setup(void)
 	 * Right now other parts of the system means that we
 	 * _really_ don't want to cluster much more
 	 */
-	hotcpu_notifier(cpu_swap_callback, 0);
 }
