While in irq, who must be charged for a tick?
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:
timer.c Thu Aug 1 16:09:51 2002 renamed from timer.c.orig Thu Aug 1 16:08:36 2002 +4 -3
@@ -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.
Signature · 1 line
Eric