Re: [PATCH] pm-hibernate: flush block device cache when hibernating

Christoph Hellwig <[email protected]> Wed, 29 Oct 2025 07:38:13 -0700
Newsgroups dev.linux.lists.linux-lvm,dev.linux.lists.dm-devel,dev.linux.lists.lvm-devel,org.kernel.vger.linux-block,org.kernel.vger.linux-btrfs,org.kernel.vger.linux-crypto,org.kernel.vger.linux-pm,org.kernel.vger.linux-raid,org.kvack.linux-mm
Message-ID <[email protected]>
On Wed, Oct 29, 2025 at 02:31:05PM +0100, Rafael J. Wysocki wrote:
> > This commit fixes the suspend code so that it issues flushes before
> > writing the header and after writing the header.
> 
> Hmm, shouldn't it flush every time it does a sync write, and not just
> in these two cases?

It certainly should not use the PREFLUSH flag that flushes before
writing, as the cache will be dirty again after that.

I'd expect a single blkdev_issue_flush after all writing is done,
under the assumption that the swsusp swap writing doesn't have
transaction integrity for individual writes anyway.