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>] [thread-next>] [day] [month] [year] [list]
Message-ID: <460930BB.2050905@free.fr>
Date:	Tue, 27 Mar 2007 16:56:59 +0200
From:	John <linux.kernel@...e.fr>
To:	linux-kernel@...r.kernel.org
CC:	tglx@...esys.com, mingo@...e.hu, johnstul@...ibm.com,
	akpm@...l.org, linux.kernel@...e.fr
Subject: 2.6.20.3-rt8 clock_nanosleep() sleeps 10 ms

Hello everyone,

I'm using 2.6.20.3 patched with -rt8 (and glibc 2.3.6).
http://people.redhat.com/mingo/realtime-preempt/older/patch-2.6.20-rt8

I've written a small program where I call clock_nanosleep() in a loop
requesting a 2-ms pause, then call clock_gettime().

cf. clock_nanosleep_bug.cxx

As far as clock_gettime() is concerned 10 ms have gone by.

$ g++ -Wall -O2 clock_nanosleep_bug.cxx -lrt -o testcase
$ ldd testcase
         linux-gate.so.1 =>  (0xffffe000)
         librt.so.1 => /lib/tls/librt.so.1 (0xb7f81000)
         libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7eb3000)
         libm.so.6 => /lib/tls/libm.so.6 (0xb7e90000)
         libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xb7e87000)
         libc.so.6 => /lib/tls/libc.so.6 (0xb7d58000)
         libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb7d46000)
         /lib/ld-linux.so.2 (0xb7fa4000)

# /bin/time ./testcase
CURRSPEC=13421.451913471
DEADLINE=13421.451913471
+++++
CURRSPEC=13421.467052707
DEADLINE=13421.453913471
+++++
CURRSPEC=13421.477043164
DEADLINE=13421.455913471
+++++
CURRSPEC=13421.487042227
DEADLINE=13421.457913471
+++++
CURRSPEC=13421.497042433
DEADLINE=13421.459913471
+++++
CURRSPEC=13421.507041752
DEADLINE=13421.461913471
+++++
CURRSPEC=13421.517041349
DEADLINE=13421.463913471
...
CURRSPEC=13431.426698445
DEADLINE=13423.445913471
+++++
CURRSPEC=13431.436697741
DEADLINE=13423.447913471
+++++
CURRSPEC=13431.446697624
DEADLINE=13423.449913471
+++++
0.00user 0.00system 0:10.00elapsed 0%CPU

In other words, clock_gettime() is right: clock_nanosleep() sleeps
10 ms instead of 2 ms.

I've provided my kernel configuration file.

It seems the CPU was not switched to high-resolution mode?

# dmesg | grep resolution
/* NOTHING */

Do I need to enable ACPI?

Regards.

View attachment "clock_nanosleep_bug.cxx" of type "text/plain" (1009 bytes)

View attachment "dot.config" of type "text/plain" (19551 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ