Files
kernel-tenderloin-3.0/include/linux
Venkatesh Pallipadi 75e1056f5c sched: Fix softirq time accounting
Peter Zijlstra found a bug in the way softirq time is accounted in
VIRT_CPU_ACCOUNTING on this thread:

   http://lkml.indiana.edu/hypermail//linux/kernel/1009.2/01366.html

The problem is, softirq processing uses local_bh_disable internally. There
is no way, later in the flow, to differentiate between whether softirq is
being processed or is it just that bh has been disabled. So, a hardirq when bh
is disabled results in time being wrongly accounted as softirq.

Looking at the code a bit more, the problem exists in !VIRT_CPU_ACCOUNTING
as well. As account_system_time() in normal tick based accouting also uses
softirq_count, which will be set even when not in softirq with bh disabled.

Peter also suggested solution of using 2*SOFTIRQ_OFFSET as irq count
for local_bh_{disable,enable} and using just SOFTIRQ_OFFSET while softirq
processing. The patch below does that and adds API in_serving_softirq() which
returns whether we are currently processing softirq or not.

Also changes one of the usages of softirq_count in net/sched/cls_cgroup.c
to in_serving_softirq.

Looks like many usages of in_softirq really want in_serving_softirq. Those
changes can be made individually on a case by case basis.

Signed-off-by: Venkatesh Pallipadi <venki@google.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1286237003-12406-2-git-send-email-venki@google.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2010-10-18 20:52:20 +02:00
..
2010-08-05 13:26:20 +01:00
2010-08-12 06:38:24 +10:00
2010-09-08 10:50:00 -06:00
2010-08-12 08:43:30 -07:00
2010-08-12 08:43:30 -07:00
2010-08-12 08:43:30 -07:00
2010-08-18 01:09:01 -04:00
2010-09-09 18:57:23 -07:00
2010-08-06 15:36:47 -05:00
2010-08-04 11:00:45 +02:00
2010-08-12 04:14:05 +01:00
2010-08-18 08:35:46 -04:00
2010-07-12 14:41:40 +02:00
2010-10-18 20:52:20 +02:00
2010-07-19 11:54:16 +02:00
2010-08-11 09:23:22 +02:00
2010-08-11 18:21:02 +02:00
2010-08-09 20:45:05 -07:00
2010-08-10 11:49:21 -07:00
2010-08-12 11:27:58 +02:00
2010-10-11 18:15:28 -07:00
2010-09-09 18:57:24 -07:00
2010-06-29 10:07:09 +02:00
2010-08-02 06:39:44 +03:00
2010-08-01 10:47:00 +03:00
2010-07-06 13:45:24 -04:00
2010-08-09 16:48:45 -04:00
2010-07-14 17:14:00 +10:00
2010-09-09 09:05:06 -07:00
2010-08-11 00:29:47 -04:00
2010-07-02 21:59:08 -07:00
2010-07-05 16:14:52 -06:00
2010-07-05 16:14:25 -06:00
2010-07-31 19:53:06 +08:00
2010-07-19 01:58:48 +02:00
2010-07-19 01:58:48 +02:00
2010-08-04 21:53:17 -07:00
2010-08-09 16:47:27 -04:00
2010-07-22 13:46:21 -07:00
2010-07-23 17:08:41 +04:00
2010-10-18 20:52:20 +02:00
2010-09-08 15:04:10 +02:00
2010-09-27 20:24:54 -07:00
2010-08-09 16:48:44 -04:00
2010-09-09 20:41:20 +02:00
2010-08-18 08:35:47 -04:00
2010-08-06 10:37:02 -04:00
2010-08-11 08:59:02 -07:00
2010-09-13 10:26:52 +02:00