Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1322248

[PATCH 2/4] acct,time: change indentation in __acct_update_integrals

From riel@redhat.com
Newsgroups linux.kernel
Subject [PATCH 2/4] acct,time: change indentation in __acct_update_integrals
Date 2016-01-30 04:40 +0100
Message-ID <qWuye-51K-29@gated-at.bofh.it> (permalink)
References <qWuyd-51K-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Rik van Riel <riel@redhat.com>

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>
---
 kernel/tsacct.c | 41 +++++++++++++++++++++--------------------
 1 file changed, 21 insertions(+), 20 deletions(-)

diff --git a/kernel/tsacct.c b/kernel/tsacct.c
index 41667b23dbd0..8908f8b1d26e 100644
--- a/kernel/tsacct.c
+++ b/kernel/tsacct.c
@@ -123,26 +123,27 @@ 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;
-
-		local_irq_save(flags);
-		time = stime + utime;
-		dtime = time - tsk->acct_timexpd;
-		delta = cputime_to_nsecs(dtime);
-
-		if (delta < TICK_NSEC)
-			goto out;
-
-		tsk->acct_timexpd = time;
-		/* The final unit will be Mbyte-usecs, see xacct_add_tsk */
-		tsk->acct_rss_mem1 += delta * get_mm_rss(tsk->mm) / 1024;
-		tsk->acct_vm_mem1 += delta * tsk->mm->total_vm / 1024;
-	out:
-		local_irq_restore(flags);
-	}
+	cputime_t time, dtime;
+	unsigned long flags;
+	u64 delta;
+
+	if (unlikely(!tsk->mm))
+		return;
+
+	local_irq_save(flags);
+	time = stime + utime;
+	dtime = time - tsk->acct_timexpd;
+	delta = cputime_to_nsecs(dtime);
+
+	if (delta < TICK_NSEC)
+		goto out;
+
+	tsk->acct_timexpd = time;
+	/* The final unit will be Mbyte-usecs, see xacct_add_tsk */
+	tsk->acct_rss_mem1 += delta * get_mm_rss(tsk->mm) / 1024;
+	tsk->acct_vm_mem1 += delta * tsk->mm->total_vm / 1024;
+out:
+	local_irq_restore(flags);
 }
 
 /**
-- 
2.5.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] sched,time: reduce nohz_full syscall overhead 40% riel@redhat.com - 2016-01-30 04:40 +0100
  [PATCH 4/4] sched,time: only call account_{user,sys,guest,idle}_time once a jiffy riel@redhat.com - 2016-01-30 04:40 +0100
  [PATCH 2/4] acct,time: change indentation in __acct_update_integrals riel@redhat.com - 2016-01-30 04:40 +0100
    Re: [PATCH 2/4] acct,time: change indentation in  __acct_update_integrals Frederic Weisbecker <fweisbec@gmail.com> - 2016-01-30 17:20 +0100
  [PATCH 3/4] time,acct: drop irq save & restore from __acct_update_integrals riel@redhat.com - 2016-01-30 04:40 +0100
    Re: [PATCH 3/4] time,acct: drop irq save & restore from  __acct_update_integrals Frederic Weisbecker <fweisbec@gmail.com> - 2016-01-30 17:30 +0100

csiph-web