提交 b2add86e 编写于 作者: R Rik van Riel 提交者: Ingo Molnar

acct, time: Change indentation in __acct_update_integrals()

Change the indentation in __acct_update_integrals() to make the function
a little easier to read.
Suggested-by: NPeter Zijlstra <peterz@infradead.org>
Signed-off-by: NRik van Riel <riel@redhat.com>
Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
Acked-by: NFrederic Weisbecker <fweisbec@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: clark@redhat.com
Cc: eric.dumazet@gmail.com
Cc: fweisbec@gmail.com
Cc: luto@amacapital.net
Link: http://lkml.kernel.org/r/1455152907-18495-3-git-send-email-riel@redhat.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
上级 382c2fe9
...@@ -125,31 +125,32 @@ void xacct_add_tsk(struct taskstats *stats, struct task_struct *p) ...@@ -125,31 +125,32 @@ void xacct_add_tsk(struct taskstats *stats, struct task_struct *p)
static void __acct_update_integrals(struct task_struct *tsk, static void __acct_update_integrals(struct task_struct *tsk,
cputime_t utime, cputime_t stime) cputime_t utime, cputime_t stime)
{ {
if (likely(tsk->mm)) { cputime_t time, dtime;
cputime_t time, dtime; unsigned long flags;
unsigned long flags; u64 delta;
u64 delta;
if (!likely(tsk->mm))
local_irq_save(flags); return;
time = stime + utime;
dtime = time - tsk->acct_timexpd; local_irq_save(flags);
/* Avoid division: cputime_t is often in nanoseconds already. */ time = stime + utime;
delta = cputime_to_nsecs(dtime); dtime = time - tsk->acct_timexpd;
/* Avoid division: cputime_t is often in nanoseconds already. */
if (delta < TICK_NSEC) delta = cputime_to_nsecs(dtime);
goto out;
if (delta < TICK_NSEC)
tsk->acct_timexpd = time; goto out;
/*
* Divide by 1024 to avoid overflow, and to avoid division. tsk->acct_timexpd = time;
* The final unit reported to userspace is Mbyte-usecs, /*
* the rest of the math is done in xacct_add_tsk. * Divide by 1024 to avoid overflow, and to avoid division.
*/ * The final unit reported to userspace is Mbyte-usecs,
tsk->acct_rss_mem1 += delta * get_mm_rss(tsk->mm) >> 10; * the rest of the math is done in xacct_add_tsk.
tsk->acct_vm_mem1 += delta * tsk->mm->total_vm >> 10; */
out: tsk->acct_rss_mem1 += delta * get_mm_rss(tsk->mm) >> 10;
local_irq_restore(flags); tsk->acct_vm_mem1 += delta * tsk->mm->total_vm >> 10;
} out:
local_irq_restore(flags);
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册