lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Wed, 1 Nov 2017 17:01:29 +0800
From:   qing hao <v.qingh@...il.com>
To:     linux-kernel@...r.kernel.org
Subject: cpuacct.stat is too much bigger than cpuacct.usage

Hello,

I found that on kernel linux3.10, 64-bit, not virtual machine, when I
attach my process to a newly created cgroup
(/sys/fs/cgroup/cpu,cpuacct/p1), the cputime collection of
cpuacct.stat and cpuacct.usage have a big difference. Cputime in
cpuacct.stat is too much bigger than cpuacct.usage.
 (I tried on linux4.4, and doesn't has such issue. I searched mailing
list, but didn't find related fix.)

Is there any explanation, or is this a kernel bug? Which file's CPU
time is more accurate that I can trust?  I need separated sys time and
user time.

# cat run.sh
#! /bin/bash

sudo echo $$ > /sys/fs/cgroup/cpu,cpuacct/p1/tasks
MAX=200000
for i in $(seq ${MAX})
do
    echo "test" > /tmp/p1
    rm /tmp/p1
done

# cat cpuacct.stat cpuacct.usage
user 7756
system 37760  --> utime + stime = 377s + 77s = 454s
360566710120 --> total cputime is 360s

# getconf CLK_TCK
100

# pwd
/sys/devices/system/cpu
# cat present
0-3
# cat online
0-3

Looking forward for you reply. Thanks.

-Qing

Powered by blists - more mailing lists