From: Eric Lemoine <Eric.Lemoine@ens-lyon.fr>
To: linux-kernel@vger.kernel.org
Subject: While in irq, who must be charged for a tick?
Date: Thu, 1 Aug 2002 16:46:49 +0200 [thread overview]
Message-ID: <20020801144649.GG414@hookipa> (raw)
I don't understand why a tick is charged to the current process when the
timer interrupt occurs while in hardirq or softirq context. There's
great chance that the hardirq or softirq is not serving 'current'.
Here's what I would do:
--- kernel/timer.c.orig Thu Aug 1 16:08:36 2002
+++ kernel/timer.c Thu Aug 1 16:09:51 2002
@@ -582,7 +582,9 @@
int cpu = smp_processor_id(), system = user_tick ^ 1;
update_one_process(p, user_tick, system, cpu);
- if (p->pid) {
+ if (local_bh_count(cpu) || local_irq_count(cpu) > 1)
+ kstat.per_cpu_system[cpu] += system;
+ else if (p->pid) {
if (--p->counter <= 0) {
p->counter = 0;
p->need_resched = 1;
@@ -593,8 +595,7 @@
kstat.per_cpu_user[cpu] += user_tick;
kstat.per_cpu_system[cpu] += system;
- } else if (local_bh_count(cpu) || local_irq_count(cpu) > 1)
- kstat.per_cpu_system[cpu] += system;
+ }
}
/*
[This is against 2.4.18-vanilla]
I'm certainly missing the point here. Please tell me where I'm wrong.
THX.
--
Eric
reply other threads:[~2002-08-01 14:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20020801144649.GG414@hookipa \
--to=eric.lemoine@ens-lyon.fr \
--cc=linux-kernel@vger.kernel.org \
/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