From: tuhaowen <tuhaowen@uniontech.com>
To: rafael@kernel.org
Cc: huangbibo@uniontech.com, kernel-team@android.com,
len.brown@intel.com, linux-kernel@vger.kernel.org,
linux-pm@vger.kernel.org, pavel@kernel.org, saravanak@google.com,
tuhaowen@uniontech.com, wusamuel@google.com
Subject: Re: [PATCH v2] PM: Add configurable sync timeout for suspend and hibernation
Date: Mon, 8 Sep 2025 10:22:38 +0800 [thread overview]
Message-ID: <20250908022238.6852-1-tuhaowen@uniontech.com> (raw)
In-Reply-To: <CAJZ5v0jBRy=CvZiWQQaorvc-zT+kkaB6+S2TErGmkaPAGmHLOQ@mail.gmail.com>
On Fri, Sep 5, 2025 at 9:27 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Fri, Sep 5, 2025 at 11:25 AM tuhaowen <tuhaowen@uniontech.com> wrote:
> >
> > When large file operations are in progress during system suspend or
> > hibernation, the ksys_sync() call can hang for extended periods,
> > leading to unresponsive system behavior. Users copying large files
> > to USB drives may experience black screen hangs when attempting to
> > suspend, requiring forced power cycles.
>
> You need to talk to the authors of the series mentioned above (now
> CCed) and come up with a common approach. I have no strong preference
> and I'm not going to choose one over the other unless I'm told by
> everybody interested that this is the way to go.
>
> I personally think that syncing filesystems during system suspend, in
> contrast with hibernation, is rather pointless and hibernation users
> can be expected to be sufficiently patient.
>
> There's already /sys/power/sync_on_suspend, so why not use it to
> disable the sync on suspend altogether?
Hi Rafael,
Thank you for your feedback on the sync timeout patch.
Regarding your suggestion to use /sys/power/sync_on_suspend to disable sync
altogether, I have concerns about this approach. When resuming from S3
suspend or hibernation, USB and other removable block devices often
disconnect and get rescanned by the kernel. If we disable sync completely
before suspend, any pending writes in the page cache will be lost when
these devices disconnect during the sleep cycle. This can lead to
filesystem metadata corruption, partition table corruption on USB drives,
and data loss for users who were writing files before suspend.
No major Linux distribution dares to enable the sync_on_suspend disable
option by default precisely because of these data corruption risks.
Regarding coordination with the patch series mentioned above, I understand
the need for alignment and I'm actively working on this. I have initiated
discussions with Samuel Wu and the Google team to explore how we can merge
our approaches into a unified solution.
I will coordinate with them to present a unified patch series that
incorporates the best aspects of both approaches.
Best regards,
Haowen Tu
next prev parent reply other threads:[~2025-09-08 2:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-05 2:47 [PATCH] PM: Add configurable sync timeout during suspend and hibernate to prevent hang tuhaowen
2025-09-05 9:24 ` [PATCH v2] PM: Add configurable sync timeout for suspend and hibernation tuhaowen
2025-09-05 19:27 ` Rafael J. Wysocki
2025-09-08 2:22 ` tuhaowen [this message]
2025-09-09 6:58 ` [PATCH v3] " tuhaowen
-- strict thread matches above, loose matches on Subject: below --
2025-09-09 2:00 Sync timeout mechanisms - Request for coordination Saravana Kannan
2025-09-09 2:45 ` [PATCH v2] PM: Add configurable sync timeout for suspend and hibernation tuhaowen
2025-09-09 6:18 ` Saravana Kannan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250908022238.6852-1-tuhaowen@uniontech.com \
--to=tuhaowen@uniontech.com \
--cc=huangbibo@uniontech.com \
--cc=kernel-team@android.com \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@kernel.org \
--cc=rafael@kernel.org \
--cc=saravanak@google.com \
--cc=wusamuel@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox