vmstats: add cond_resched() to refresh_cpu_vm_stats()
authorDimitri Sivanich <[email protected]>
Mon, 28 Apr 2008 09:13:37 +0000 (02:13 -0700)
committerLinus Torvalds <[email protected]>
Mon, 28 Apr 2008 15:58:26 +0000 (08:58 -0700)
We've found that it can take quite a bit of time (100's of usec) to get
through the zone loop in refresh_cpu_vm_stats().

Adding a cond_resched() to allow other threads to run in the non-preemptive
case.

Signed-off-by: Dimitri Sivanich <[email protected]>
Acked-by: Christoph Lameter <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/vmstat.c

index 4c21670f8d91de346cad33f8a0c5d1811a82a573..ec6035eda933f463ceaa849e8f9f96663a2a025f 100644 (file)
@@ -322,6 +322,7 @@ void refresh_cpu_vm_stats(int cpu)
                                p->expire = 3;
 #endif
                        }
+               cond_resched();
 #ifdef CONFIG_NUMA
                /*
                 * Deal with draining the remote pageset of this