]> git.hungrycats.org Git - linux/commitdiff
[PATCH] acct_update_integrals speedup
authorJay Lan <jlan@engr.sgi.com>
Tue, 11 Jan 2005 09:39:41 +0000 (01:39 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 11 Jan 2005 09:39:41 +0000 (01:39 -0800)
This patch is to provide extra check in acct_update_integrals() function.
The routine would return if 'delta' is 0 to take quick exit if nothing to
be done.

Signed-off-by: Jay Lan <jlan@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/acct.c

index 311ec9c0be533d90019c51910f36c83865655bba..32e39accbb86c4457aa689e10bef6ff72ca832f9 100644 (file)
@@ -541,6 +541,8 @@ void acct_update_integrals(void)
        if (likely(tsk->mm)) {
                long delta = tsk->stime - tsk->acct_stimexpd;
 
+               if (delta == 0)
+                       return;
                tsk->acct_stimexpd = tsk->stime;
                tsk->acct_rss_mem1 += delta * tsk->mm->rss;
                tsk->acct_vm_mem1 += delta * tsk->mm->total_vm;