* While in irq, who must be charged for a tick?
@ 2002-08-01 14:46 Eric Lemoine
0 siblings, 0 replies; only message in thread
From: Eric Lemoine @ 2002-08-01 14:46 UTC (permalink / raw)
To: linux-kernel
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-08-01 14:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-01 14:46 While in irq, who must be charged for a tick? Eric Lemoine
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox