On Wed, 2018-01-24 at 10:05 -0500, David Miller wrote: > From: Paolo Abeni <pab...@redhat.com> > Date: Wed, 24 Jan 2018 15:54:05 +0100 > > > Niklas suggested a possible relation with CONFIG_IRQ_TIME_ACCOUNTING=y > > and indeed he was right. > > > > The patched kernel under test had CONFIG_IRQ_TIME_ACCOUNTING set, and > > very little CPU time was accounted to the kworker: > > > > [2125 is the relevant kworker's pid] > > grep sum_exec_runtime /proc/2125/sched; sleep 10; grep sum_exec_runtime > > /proc/2125/sched > > se.sum_exec_runtime : 13408.239286 > > se.sum_exec_runtime : 13456.907197 > > > > despite such process was processing a lot of packets and basically > > burning a CPU. > > So IRQ_TIME_ACCOUNTING makes the scheduler think that the worker > threads are using nearly no task time at all.
Yes, this is the behavior I observe in the test. But a quick look at the scheduler code - I'm not very familiar with it - let me think this is not the intended/expected behaviour for the ksoftirqd (and after this series, for the kworker serving the softirq). > The existing ksoftirqd code should hit the same problem, right? I just tried the vanilla kernel with CONFIG_IRQ_TIME_ACCOUNTING=y, and in the same test scenario, I observe the 'good' behavior: the user space process and ksoftirqd share almost fairly the relevant CPU, and the CPU time spend in softirq processing is accounted to ksoftirqd. Cheers, Paolo