Index: linux-2.6-work/lib/percpu_counter.c
===================================================================
--- linux-2.6-work.orig/lib/percpu_counter.c	2011-07-31 20:37:12.580765739 +1000
+++ linux-2.6-work/lib/percpu_counter.c	2011-08-25 11:43:57.828695957 +1000
@@ -149,11 +149,15 @@ EXPORT_SYMBOL(percpu_counter_destroy);
 int percpu_counter_batch __read_mostly = 32;
 EXPORT_SYMBOL(percpu_counter_batch);
 
+/*
+ * We set the batch at 2 * num_online_cpus(), with a minimum of 32 and
+ * a maximum of 1024.
+ */
 static void compute_batch_value(void)
 {
 	int nr = num_online_cpus();
 
-	percpu_counter_batch = max(32, nr*2);
+	percpu_counter_batch = min(1024, max(32, nr*2));
 }
 
 static int __cpuinit percpu_counter_hotcpu_callback(struct notifier_block *nb,
