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: <20210923185106.501848-1-f.fainelli@gmail.com>
Date:   Thu, 23 Sep 2021 11:51:05 -0700
From:   Florian Fainelli <f.fainelli@...il.com>
To:     linux-kernel@...r.kernel.org
Cc:     Florian Fainelli <f.fainelli@...il.com>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Pavel Machek <pavel@....cz>, Len Brown <len.brown@...el.com>,
        linux-pm@...r.kernel.org (open list:HIBERNATION (aka Software Suspend,
        aka swsusp))
Subject: [PATCH] PM / Suspend: Avoid soft lockup warning with suspend_test

When testing with a large (>= 22 seconds) pm_test_delay we can see the
NMI soft lockup barfing at us because a task has been blocked for too
long. This can be reproduced with:

	echo devices > /sys/power/pm_test
	echo 30 > /sys/module/suspend/parameters/pm_test_delay

Unroll the loop and touch the NMI watchdog every 1s to avoid the lockup
warnings.

Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
---
 kernel/power/suspend.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index eb75f394a059..7441f0011ccd 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -30,6 +30,7 @@
 #include <trace/events/power.h>
 #include <linux/compiler.h>
 #include <linux/moduleparam.h>
+#include <linux/nmi.h>
 
 #include "power.h"
 
@@ -324,10 +325,15 @@ MODULE_PARM_DESC(pm_test_delay,
 static int suspend_test(int level)
 {
 #ifdef CONFIG_PM_DEBUG
+	unsigned int i;
+
 	if (pm_test_level == level) {
 		pr_info("suspend debug: Waiting for %d second(s).\n",
 				pm_test_delay);
-		mdelay(pm_test_delay * 1000);
+		for (i = 0; i < pm_test_delay; i++) {
+			mdelay(1000);
+			touch_nmi_watchdog();
+		}
 		return 1;
 	}
 #endif /* !CONFIG_PM_DEBUG */
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ