Bug#848682: process accounting sometimes does not work
Source: linux
Severity: normal
Dear Ben, dear maintainers,
starting from a Debian bug report of mine, Gerlof Langeveld, developer
of system and process monitor atop¹, found two issues with process
accounting². I also started an LKML thread about these³.
[1] http://atoptool.nl/
[2] #833997 atop: process accounting does not work:
https://bugs.debian.org/833997
[3] [REGRESSION] Two issues that prevent process accounting (taskstats) from
working correctly: https://lkml.org/lkml/2016/12/19/182
I am reporting the two issues separately.
I am currently not running Debian a kernel, but Gerlof verified the issue with
Debian kernel. Pprocess accounting works with 3.16, but fails with 4.8 and
4.7 at least. I think it also fails with earlier versions, but I do not
know exactly since which version.
1) Sometimes process accounting does not work at all.
Bug 190271 - process accounting sometimes does not work
https://bugzilla.kernel.org/show_bug.cgi?id=190271
The acct() system call (to activate process accounting) return value 0,
which means that process accounting is activated successfully.
However, no process accounting records are written whatsoever. This
situation can be reproduced with the program 'acctdemo.c'
that you can find as attachment. When this program gives the message
"found a process accounting record!", the situation is okay
and process accounting works fine to the file '/tmp/mypacct'. When the
message 'No process accounting record yet....' is repeatedly given,
process accounting does not work and will not work at all. It might be
that you have to start this program several times before you get
this situation (preferably start/finish lots of processes in the mean time).
This problem is probably caused by a new mechanism introduced in the
kernel code (..../linux/kernel/acct.c) that is called 'slow accounting'
and has to be solved in the kernel code.
I experience this problem on Debian8 with a 4.8 kernel and on CentOS7
with a 4.8 kernel.
Thanks,
Martin
-- System Information:
Debian Release: stretch/sid
APT prefers unstable
APT policy: (500, 'unstable'), (200, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.8.14-tp520-btrfstrim+ (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
Reply to: