]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
rcutorture: Use monotonic timestamp for stall detection
authorArnd Bergmann <arnd@arndb.de>
Mon, 18 Jun 2018 14:47:34 +0000 (16:47 +0200)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:49:47 +0000 (19:49 -0600)
commitbf74ecdcdb36201517f105e11c9f3afcea198f0a
tree6383f75cddca3ffec5eb2b44a0da3860ae47eb14
parent949ed9ddfef3a75ecce7c04fdc50f75f6d1656d9
rcutorture: Use monotonic timestamp for stall detection

BugLink: https://bugs.launchpad.net/bugs/1836117
[ Upstream commit 622be33fcbc93e9b672b99ed338369eb5e843ac3 ]

The get_seconds() call is deprecated because it overflows on 32-bit
architectures. The algorithm in rcu_torture_stall() can deal with
the overflow, but another problem here is that using a CLOCK_REALTIME
stamp can lead to a false-positive stall warning when a settimeofday()
happens concurrently.

Using ktime_get_seconds() instead avoids those issues and will never
overflow. The added cast to 'unsigned long' however is necessary to
make ULONG_CMP_LT() work correctly.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
kernel/rcu/rcutorture.c