original_kernel/net/sched
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
..
Kconfig
Makefile
act_api.c
act_gact.c net sched: fix some kernel memory leaks 2010-08-17 15:12:15 -07:00
act_ipt.c
act_mirred.c net sched: fix some kernel memory leaks 2010-08-17 15:12:15 -07:00
act_nat.c net sched: fix some kernel memory leaks 2010-08-17 15:12:15 -07:00
act_pedit.c
act_police.c net sched: fix kernel leak in act_police 2010-09-01 14:29:34 -07:00
act_simple.c net sched: fix some kernel memory leaks 2010-08-17 15:12:15 -07:00
act_skbedit.c net sched: fix some kernel memory leaks 2010-08-17 15:12:15 -07:00
cls_api.c
cls_basic.c
cls_cgroup.c sched: Fix softirq time accounting 2010-10-18 20:52:20 +02:00
cls_flow.c cls_flow: add sanity check for the packet length 2010-08-04 21:53:15 -07:00
cls_fw.c
cls_route.c
cls_rsvp.c
cls_rsvp.h cls_rsvp: add sanity check for the packet length 2010-08-04 21:53:15 -07:00
cls_rsvp6.c
cls_tcindex.c
cls_u32.c cls_u32: signedness bug 2010-10-05 00:40:39 -07:00
em_cmp.c
em_meta.c
em_nbyte.c
em_text.c
em_u32.c
ematch.c
sch_api.c pkt_sched: Check .walk and .leaf class handlers 2010-08-11 01:37:00 -07:00
sch_atm.c sch_atm: Fix potential NULL deref. 2010-09-12 11:56:44 -07:00
sch_blackhole.c
sch_cbq.c
sch_drr.c
sch_dsmark.c
sch_fifo.c
sch_generic.c
sch_gred.c
sch_hfsc.c net/sched/sch_hfsc.c: initialize parent's cl_cfmin properly in init_vf() 2010-09-01 14:29:35 -07:00
sch_htb.c
sch_ingress.c
sch_mq.c
sch_multiq.c
sch_netem.c
sch_prio.c
sch_red.c
sch_sfq.c pkt_sched: Fix sch_sfq vs tc_modify_qdisc oops 2010-08-11 01:36:59 -07:00
sch_tbf.c net: Use NET_XMIT_SUCCESS where possible. 2010-08-10 02:51:11 -07:00
sch_teql.c net: Use NET_XMIT_SUCCESS where possible. 2010-08-10 02:51:11 -07:00