[lkml]   [2017]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectBisected softirq accounting issue in v4.11-rc1~170^2~28

(While evaluating some changes to the page allocator) I ran into an
issue with ksoftirqd getting too much CPU sched time.

I bisected the problem to
a499a5a14dbd ("sched/cputime: Increment kcpustat directly on irqtime account")

a499a5a14dbd1d0315a96fc62a8798059325e9e6 is the first bad commit
commit a499a5a14dbd1d0315a96fc62a8798059325e9e6
Author: Frederic Weisbecker <>
Date: Tue Jan 31 04:09:32 2017 +0100

sched/cputime: Increment kcpustat directly on irqtime account

The irqtime is accounted is nsecs and stored in
cpu_irq_time.hardirq_time and cpu_irq_time.softirq_time. Once the
accumulated amount reaches a new jiffy, this one gets accounted to the

This was necessary when kcpustat was stored in cputime_t, which could at
worst have jiffies granularity. But now kcpustat is stored in nsecs
so this whole discretization game with temporary irqtime storage has
become unnecessary.

We can now directly account the irqtime to the kcpustat.

Signed-off-by: Frederic Weisbecker <>
Cc: Benjamin Herrenschmidt <>
Cc: Fenghua Yu <>
Cc: Heiko Carstens <>
Cc: Linus Torvalds <>
Cc: Martin Schwidefsky <>
Cc: Michael Ellerman <>
Cc: Paul Mackerras <>
Cc: Peter Zijlstra <>
Cc: Rik van Riel <>
Cc: Stanislaw Gruszka <>
Cc: Thomas Gleixner <>
Cc: Tony Luck <>
Cc: Wanpeng Li <>
Signed-off-by: Ingo Molnar <>

The reproducer is running a userspace udp_sink[1] program, and taskset
pinning the process to the same CPU as softirq RX is running on, and
starting a UDP flood with pktgen (tool part of kernel tree:

[1] udp_sink

The expected results (after commit 4cd13c21b207 ("softirq: Let
ksoftirqd do its job")) is that the scheduler split the CPU time 50/50
between udp_sink and ksoftirqd.

After this commit, the udp_sink program does not get any sched CPU
time, and no packets are delivered to userspace. (All packets are
dropped by softirq due to a full socket queue, nstat UdpRcvbufErrors).

A related symptom is that ksoftirqd no longer get accounted in top.


Full .config uploaded here[2]:

Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat

 \ /
  Last update: 2017-03-28 10:15    [W:0.113 / U:0.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site