From: Frederic Weisbecker <fweisbec@gmail.com>
To: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Tony Luck <tony.luck@intel.com>,
Fenghua Yu <fenghua.yu@intel.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Peter Zijlstra <peterz@infradead.org>
Subject: [PATCH 4/6] ia64: Reuse system and user vtime accounting functions on task switch
Date: Tue, 25 Sep 2012 17:06:05 +0200 [thread overview]
Message-ID: <1348585567-2925-5-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1348585567-2925-1-git-send-email-fweisbec@gmail.com>
To avoid code duplication.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
---
arch/ia64/kernel/time.c | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index 351df58..80ff9ac 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -104,20 +104,15 @@ void vtime_task_switch(struct task_struct *prev)
{
struct thread_info *pi = task_thread_info(prev);
struct thread_info *ni = task_thread_info(current);
- cputime_t delta_stime;
- __u64 now;
-
- now = ia64_get_itc();
- delta_stime = cycle_to_cputime(pi->ac_stime + (now - pi->ac_stamp));
if (idle_task(smp_processor_id()) != prev)
- account_system_time(prev, 0, delta_stime, delta_stime);
+ vtime_account_system(prev);
else
- account_idle_time(delta_stime);
+ vtime_account_idle(prev);
vtime_account_user(prev);
- pi->ac_stamp = ni->ac_stamp = now;
+ pi->ac_stamp = ni->ac_stamp;
ni->ac_stime = ni->ac_utime = 0;
}
--
1.7.5.4
next prev parent reply other threads:[~2012-09-25 15:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-25 15:06 [GIT PULL] cputime: More cleanups v2 Frederic Weisbecker
2012-09-25 15:06 ` [PATCH 1/6] cputime: Use a proper subsystem naming for vtime related APIs Frederic Weisbecker
2012-09-25 15:06 ` [PATCH 2/6] vtime: Consolidate system/idle context detection Frederic Weisbecker
2012-09-25 15:06 ` [PATCH 3/6] ia64: Consolidate user vtime accounting Frederic Weisbecker
2012-09-25 15:06 ` Frederic Weisbecker [this message]
2012-09-25 15:06 ` [PATCH 5/6] cputime: Gather time/stats accounting config options into a single menu Frederic Weisbecker
2012-09-25 15:06 ` [PATCH 6/6] cputime: Make finegrained irqtime accounting generally available Frederic Weisbecker
-- strict thread matches above, loose matches on Subject: below --
2012-09-10 19:43 [PATCH 0/6] cputime: More cleanups Frederic Weisbecker
2012-09-10 19:43 ` [PATCH 4/6] ia64: Reuse system and user vtime accounting functions on task switch Frederic Weisbecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1348585567-2925-5-git-send-email-fweisbec@gmail.com \
--to=fweisbec@gmail.com \
--cc=benh@kernel.crashing.org \
--cc=fenghua.yu@intel.com \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--cc=schwidefsky@de.ibm.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®