From: tip-bot for Eric Dumazet <dada1@cosmosbay.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, paulus@samba.org, hpa@zytor.com,
mingo@redhat.com, schwidefsky@de.ibm.com, dada1@cosmosbay.com,
benh@kernel.crashing.org, gallatin@myri.com,
akpm@linux-foundation.org, tglx@linutronix.de, mingo@elte.hu
Subject: [tip:sched/urgent] sched: account system time properly
Date: Wed, 29 Apr 2009 13:09:19 GMT [thread overview]
Message-ID: <tip-f5f293a4e3d0a0c52cec31de6762c95050156516@git.kernel.org> (raw)
In-Reply-To: <49F84BC1.7080602@cosmosbay.com>
Commit-ID: f5f293a4e3d0a0c52cec31de6762c95050156516
Gitweb: http://git.kernel.org/tip/f5f293a4e3d0a0c52cec31de6762c95050156516
Author: Eric Dumazet <dada1@cosmosbay.com>
AuthorDate: Wed, 29 Apr 2009 14:44:49 +0200
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 29 Apr 2009 15:02:28 +0200
sched: account system time properly
Andrew Gallatin reported that IRQ and SOFTIRQ times were
sometime not reported correctly on recent kernels, and even
bisected to commit 457533a7d3402d1d91fbc125c8bd1bd16dcd3cd4
([PATCH] fix scaled & unscaled cputime accounting) as the first
bad commit.
Further analysis pointed that commit
79741dd35713ff4f6fd0eafd59fa94e8a4ba922d ([PATCH] idle cputime
accounting) was the real cause of the problem.
account_process_tick() was not taking into account timer IRQ
interrupting the idle task servicing a hard or soft irq.
On mostly idle cpu, irqs were thus not accounted and top or
mpstat could tell user/admin that cpu was 100 % idle, 0.00 %
irq, 0.00 % softirq, while it was not.
[ Impact: fix occasionally incorrect CPU statistics in top/mpstat ]
Reported-by: Andrew Gallatin <gallatin@myri.com>
Re-reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: rick.jones2@hp.com
Cc: brice@myri.com
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
LKML-Reference: <49F84BC1.7080602@cosmosbay.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
kernel/sched.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
index b902e58..26efa47 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4732,7 +4732,7 @@ void account_process_tick(struct task_struct *p, int user_tick)
if (user_tick)
account_user_time(p, one_jiffy, one_jiffy_scaled);
- else if (p != rq->idle)
+ else if ((p != rq->idle) || (irq_count() != HARDIRQ_OFFSET))
account_system_time(p, HARDIRQ_OFFSET, one_jiffy,
one_jiffy_scaled);
else
next prev parent reply other threads:[~2009-04-29 13:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-23 14:19 IRQ / SoftIRQ CPU time accounting broken by 457533a7d3402d1d91fbc125c8bd1bd16dcd3cd4 Andrew Gallatin
2009-04-28 23:30 ` Andrew Morton
2009-04-29 5:01 ` Eric Dumazet
2009-04-29 7:46 ` [PATCH] sched: account system time properly Eric Dumazet
2009-04-29 8:08 ` Martin Schwidefsky
2009-04-29 9:20 ` Eric Dumazet
2009-04-29 9:48 ` Martin Schwidefsky
2009-04-29 10:24 ` Ingo Molnar
2009-04-29 12:44 ` Eric Dumazet
2009-04-29 13:09 ` tip-bot for Eric Dumazet [this message]
2009-04-29 14:58 ` [tip:sched/urgent] " Andrew Morton
2009-04-29 19:06 ` Ingo Molnar
2009-04-29 13:23 ` [PATCH] " Andrew Gallatin
2009-04-29 8:02 ` IRQ / SoftIRQ CPU time accounting broken by 457533a7d3402d1d91fbc125c8bd1bd16dcd3cd4 Martin Schwidefsky
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=tip-f5f293a4e3d0a0c52cec31de6762c95050156516@git.kernel.org \
--to=dada1@cosmosbay.com \
--cc=akpm@linux-foundation.org \
--cc=benh@kernel.crashing.org \
--cc=gallatin@myri.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=paulus@samba.org \
--cc=schwidefsky@de.ibm.com \
--cc=tglx@linutronix.de \
/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
Powered by JetHome