[PATCH v3 0/3] PM: Support aborting suspend during filesystem sync

Samuel Wu posted 3 patches 1 month, 2 weeks ago
drivers/base/power/wakeup.c |  8 ++++
include/linux/suspend.h     |  3 ++
kernel/power/process.c      |  1 -
kernel/power/suspend.c      | 75 ++++++++++++++++++++++++++++++++++++-
4 files changed, 85 insertions(+), 2 deletions(-)
[PATCH v3 0/3] PM: Support aborting suspend during filesystem sync
Posted by Samuel Wu 1 month, 2 weeks ago
This series adds functionality to handle a wakeup event in the filesystem
sync phase of suspend. This topic was first discussed by Saravana Kannan at
LPC 2024 [1], where the general consensus was to allow filesystem sync on a
parallel thread.

1/3: Moves pm_wakeup_clear() to be with similar functions that do the
     prerequisite bookkeeping prior to suspend_prepare(), making the intent
     of the function clearer. Additionally, this sets up patch2 in the
     series, which requires pm_wakeup_clear() to be called before abort
     functionality during suspend can be enabled.
2/3: Add support for abort during filesystem sync phase of suspend. This
     requires detecting a wakeup event or a filesystem sync finishing,
     whichever comes first.
3/3: Adding onto abort during filesystem sync, handle cases of back-to-back
     suspends and their respective filesystem syncs. Extra care is needed
     to ensure filesystem syncs happen serially while still honoring
     wakeup events that lead to early aborts.

[1]: https://lpc.events/event/18/contributions/1845/

Changes in v3:
- Split v2 patch into 3 patches
- Moved pm_wakeup_clear() outside of if(sync_on_suspend_enabled) condition
- Updated documentation and comments within kernel/power/suspend.c
- v2 link: https://lore.kernel.org/all/20250812232126.1814253-1-wusamuel@google.com/

Changes in v2:
- Added documentation for suspend_abort_fs_sync()
- Made suspend_fs_sync_lock and suspend_fs_sync_complete declaration static
- v1 link: https://lore.kernel.org/all/20250815004635.3684650-1-wusamuel@google.com

Samuel Wu (3):
  PM: Make pm_wakeup_clear() call more clear
  PM: Support aborting suspend during filesystem sync
  PM: Support abort during fs_sync of back-to-back suspends

 drivers/base/power/wakeup.c |  8 ++++
 include/linux/suspend.h     |  3 ++
 kernel/power/process.c      |  1 -
 kernel/power/suspend.c      | 75 ++++++++++++++++++++++++++++++++++++-
 4 files changed, 85 insertions(+), 2 deletions(-)

-- 
2.51.0.261.g7ce5a0a67e-goog