+ lib-avoid-soft-lockup-in-test_find_first_bit.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: lib/find_bit_benchmark.c: avoid soft lockup in test_find_first_bit()
has been added to the -mm tree.  Its filename is
     lib-avoid-soft-lockup-in-test_find_first_bit.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/lib-avoid-soft-lockup-in-test_find_first_bit.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/lib-avoid-soft-lockup-in-test_find_first_bit.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Yury Norov <ynorov@xxxxxxxxxxxxxxxxxx>
Subject: lib/find_bit_benchmark.c: avoid soft lockup in test_find_first_bit()

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@xxxxxxxxxxxxxxxxxx
Fixes: 4441fca0a27f5 ("lib: test module for find_*_bit() functions")
Signed-off-by: Yury Norov <ynorov@xxxxxxxxxxxxxxxxxx>
Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Reported-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 lib/find_bit_benchmark.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff -puN lib/find_bit_benchmark.c~lib-avoid-soft-lockup-in-test_find_first_bit lib/find_bit_benchmark.c
--- a/lib/find_bit_benchmark.c~lib-avoid-soft-lockup-in-test_find_first_bit
+++ a/lib/find_bit_benchmark.c
@@ -132,7 +132,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);
 	test_find_next_and_bit(bitmap, bitmap2, BITMAP_LEN);
 
 	pr_err("\nStart testing find_bit() with sparse bitmap\n");
_

Patches currently in -mm which might be from ynorov@xxxxxxxxxxxxxxxxxx are

lib-avoid-soft-lockup-in-test_find_first_bit.patch
lib-micro-optimization-for-__bitmap_complement.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux