mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-17 23:15:52 +00:00
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: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Rik van Riel <riel@redhat.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Frederic 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.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
parent
382c2fe994
commit
b2add86edd
@ -125,31 +125,32 @@ void xacct_add_tsk(struct taskstats *stats, struct task_struct *p)
|
||||
static void __acct_update_integrals(struct task_struct *tsk,
|
||||
cputime_t utime, cputime_t stime)
|
||||
{
|
||||
if (likely(tsk->mm)) {
|
||||
cputime_t time, dtime;
|
||||
unsigned long flags;
|
||||
u64 delta;
|
||||
cputime_t time, dtime;
|
||||
unsigned long flags;
|
||||
u64 delta;
|
||||
|
||||
local_irq_save(flags);
|
||||
time = stime + utime;
|
||||
dtime = time - tsk->acct_timexpd;
|
||||
/* Avoid division: cputime_t is often in nanoseconds already. */
|
||||
delta = cputime_to_nsecs(dtime);
|
||||
if (!likely(tsk->mm))
|
||||
return;
|
||||
|
||||
if (delta < TICK_NSEC)
|
||||
goto out;
|
||||
local_irq_save(flags);
|
||||
time = stime + utime;
|
||||
dtime = time - tsk->acct_timexpd;
|
||||
/* Avoid division: cputime_t is often in nanoseconds already. */
|
||||
delta = cputime_to_nsecs(dtime);
|
||||
|
||||
tsk->acct_timexpd = time;
|
||||
/*
|
||||
* Divide by 1024 to avoid overflow, and to avoid division.
|
||||
* The final unit reported to userspace is Mbyte-usecs,
|
||||
* the rest of the math is done in xacct_add_tsk.
|
||||
*/
|
||||
tsk->acct_rss_mem1 += delta * get_mm_rss(tsk->mm) >> 10;
|
||||
tsk->acct_vm_mem1 += delta * tsk->mm->total_vm >> 10;
|
||||
out:
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
if (delta < TICK_NSEC)
|
||||
goto out;
|
||||
|
||||
tsk->acct_timexpd = time;
|
||||
/*
|
||||
* Divide by 1024 to avoid overflow, and to avoid division.
|
||||
* The final unit reported to userspace is Mbyte-usecs,
|
||||
* the rest of the math is done in xacct_add_tsk.
|
||||
*/
|
||||
tsk->acct_rss_mem1 += delta * get_mm_rss(tsk->mm) >> 10;
|
||||
tsk->acct_vm_mem1 += delta * tsk->mm->total_vm >> 10;
|
||||
out:
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user