"Theodore Ts'o" <tytso@xxxxxxx> writes: > In an earlier message from you upthread, you had stated "Since the > disk is suspended however, there is nothing in the cache to flush, so > this is wasteful." So that sounded like the flush was happening at > the wrong time, after the disk has already been suspended? At some point the disk goes idle. After some time, runtime pm suspends the disk, which, if there was anything in its write cache, is flushed. Later, you shutdown or suspend the whole system, and the filesystem sync issues another flush, just in case, even though there is no need for one at this point. This causes runtime_pm to wake te disk for no reason. With an ATA disk that is in ATA standby mode, it happily remains in standby mode and ignores the flush request, since it knows it has nothing in its write cache. With runtime pm, the kernel MUST wake the drive for any request. Thus, in order to make runtime pm work at least as well as the legacy ATA disk standby, I'm trying to eliminate this flush command on sync, when there has in fact, been no writes to the disk either since the last transaction committed and flushed the disk's write cache, or since the disk was runtime suspended ( which flushed the write cache ). In other words, if nothing has been written since the last flush, don't flush again when tne fs is sycned.