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>] [day] [month] [year] [list]
Date:   Tue, 24 Oct 2023 11:07:17 -0700
From:   Kalesh Singh <kaleshsingh@...gle.com>
To:     rafael@...nel.org, harry.pan@...el.com
Cc:     kernel-team@...roid.com, Kalesh Singh <kaleshsingh@...gle.com>,
        Pavel Machek <pavel@....cz>, Len Brown <len.brown@...el.com>,
        linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] PM/sleep: Instrument start of filesystems sync

Systems, such as Android, that implement opportunistic sleep from
a userspace power manager service need to guard the acquisition of
new wakelocks (incrementing a counter in userspace) while attempting
a suspend (write to /sys/power/state).

While attempting to suspend, processes attempting to acquire a
userspace wakelock are also blocked. If the suspend is blocked for
too long it can cause a watchdog bite in android.

Some device vendors reported this issue in cases where the filesystem
sync is not fast enough (sometimes > 100s):

[ 2742.247785] [07-10 15:08:02.247] Filesystems sync: 107.127 seconds

Commit b5dee3130bb4 ("PM / sleep: Refactor filesystems sync to reduce
duplication") introduced ksys_sync_helper() which logged both the start
and end of the filesystems sync.

Commit c64546b17bc9 ("PM / sleep: Measure the time of filesystems syncing")
improved on this by adding the elapsed time, but also removed instrumentation
indicating the start of filesystems sync.

Re-add the log indicating the start of filesystem sync. This helps to
identify when the above scenario has occurred in production devices in
the field.

Cc: Rafael J. Wysocki <rafael@...nel.org>
Cc: Harry Pan <harry.pan@...el.com>
Signed-off-by: Kalesh Singh <kaleshsingh@...gle.com>
---
 kernel/power/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/power/main.c b/kernel/power/main.c
index f6425ae3e8b0..b6a88b43b6da 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -87,6 +87,7 @@ void ksys_sync_helper(void)
 	ktime_t start;
 	long elapsed_msecs;
 
+	pr_info("Syncing filesystems ... ");
 	start = ktime_get();
 	ksys_sync();
 	elapsed_msecs = ktime_to_ms(ktime_sub(ktime_get(), start));

base-commit: 05d3ef8bba77c1b5f98d941d8b2d4aeab8118ef1
-- 
2.42.0.758.gaed0368e0e-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ