Comment 18 for bug 1982727

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Hi everyone, sorry - I think I need to de-ambiguize a few things here.

Let me give the involved configs names:
A) CONFIG_TASK_DELAY_ACCT = yes, delayacct = 0
B) CONFIG_TASK_DELAY_ACCT = yes, delayacct = 1
C) CONFIG_TASK_DELAY_ACCT = no

#1 intentional config change
a) Past kernels had:
  - CONFIG_TASK_DELAY_ACCT enabled (which means the kernel CAN account that)
  - delayacct was enabled by default
  - so they were case (B) by default
  - So iotop worked out of the box to show e.g. swapin

b) newer kernels (post [1]) had:
  - CONFIG_TASK_DELAY_ACCT enabled (which means the kernel CAN account that)
  - delayacct was DISABLED by default
  - so they were case (A) by default
  - so iotop was unable to show swapin out of the box
  - It hinted at it and said "CONFIG_TASK_DELAY_ACCT and kernel.task_delayacct sysctl not enabled in kernel, cannot determine SWAPIN and IO %"

Now this is an intentional change in the kernel it saves some cpu and memory (not much but it sums up) for something not used in most cases.

Actually iotop is correctly detecting this situation of missing the stats (so what should it show) and hints at the problem.
I agree, in a perfect world it should instead hint at "sudo sysctl -w kernel.task_delayacct=1" or the "delayacct" kernel parameter, because as mentioned above CONFIG_TASK_DELAY_ACCT is enabled in kernel config.

The confusion starts at the fixes that are in upstream and the communication about it.
They are -not- changing the situation with (B).
There is no accounting done, it can not display anything.

What it does fix is that (C) (which aren't any Ubuntu kernels btw) that can therefore not read /proc/sys/kernel/task_delayacct do no more crash. Instead - with the fix - (C) will behave like (A).

So if your problem was:
- (C) is crashing -> that is fixed here
  - but since it isn't a situation you can get with Ubuntu kernels AFAIK this won't be SRUable
  - setting won't fix due to that for the SRU tasks
- (A) why don't I see results, then you need to change the runtime config
   - that is just a choice in the new kernel (since the default safes mem&cpu)
   - boot with delayacct
   - or run "sudo sysctl -w kernel.task_delayacct=1"
   - then you'll be in (B) and it works
- (B) just worked before and after

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e4042ad492357fa995921376462b04a025dd53b6