]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
lib/find_bit_benchmark.c: avoid soft lockup in test_find_first_bit()
authorYury Norov <ynorov@caviumnetworks.com>
Fri, 11 May 2018 23:01:39 +0000 (16:01 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Jun 2018 19:01:41 +0000 (04:01 +0900)
commitb5e2b10d79679ce83d787d8aa609b8116a3bd8e9
tree280d402182a7f33b0c48183c32b39b644202d9cb
parentb4f970ec80a6cb135648189c48247060422dfedb
lib/find_bit_benchmark.c: avoid soft lockup in test_find_first_bit()

[ Upstream commit 4ba281d5bd9907355e6b79fb72049c9ed50cc670 ]

test_find_first_bit() is intentionally sub-optimal, and may cause soft
lockup due to long time of run on some systems.  So decrease length of
bitmap to traverse to avoid lockup.

With the change below, time of test execution doesn't exceed 0.2 seconds
on my testing system.

Link: http://lkml.kernel.org/r/20180420171949.15710-1-ynorov@caviumnetworks.com
Fixes: 4441fca0a27f5 ("lib: test module for find_*_bit() functions")
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
lib/find_bit_benchmark.c