]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - lib/test_find_bit.c
lib/find_bit_benchmark.c: avoid soft lockup in test_find_first_bit()
[mirror_ubuntu-bionic-kernel.git] / lib / test_find_bit.c
index f4394a36f9aa2b60a05624308a60ba59897f1606..44ceda470a2ac3afeaac42afea6ae3df48eb7f1d 100644 (file)
@@ -118,7 +118,12 @@ static int __init find_bit_test(void)
        test_find_next_bit(bitmap, BITMAP_LEN);
        test_find_next_zero_bit(bitmap, BITMAP_LEN);
        test_find_last_bit(bitmap, BITMAP_LEN);
-       test_find_first_bit(bitmap, BITMAP_LEN);
+
+       /*
+        * test_find_first_bit() may take some time, so
+        * traverse only part of bitmap to avoid soft lockup.
+        */
+       test_find_first_bit(bitmap, BITMAP_LEN / 10);
 
        pr_err("\nStart testing find_bit() with sparse bitmap\n");