Skip to content

nilfs2: add missing blkdev_issue_flush() to nilfs_sync_fs()

Andreas Rohner linux-nilfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 2 repliesIn review

v2->v3 (based on review of Ryusuke Konishi) from the cover letter

* Use separate atomic flag for ns_flushed_device instead of a bit flag in ns_flags
* Use smp_mb__after_atomic() after setting ns_flushed_device

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1nilfs2: add missing blkdev_issue_flush() to nilfs_sync_fs()fs/nilfs2/file.c fs/nilfs2/ioctl.c fs/nilfs2/segment.c +3 more+29 -22 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/1] nilfs2: add missing blkdev_issue_flush() to nilfs_sync_fs()

Hi,

I have looked a bit more into the semantics of the various flags concerning block device caching behaviour. According to "Documentation/block/writeback_cache_control.txt" a call to blkdev_issue_flush() is equivalent to an empty bio with the REQ_FLUSH flag set. So there is no need to call blkdev_issue_flush() after a call to nilfs_commit_super(). But if there is no need to write the super block an additional call to blkdev_issue_flush() is necessary.

To avoid an overhead I introduced the nilfs->ns_flushed_device flag, which is set to 0 whenever new logs are written and set to 1 whenever the block device is flushed. If the super block was written during segment construction or in nilfs_sync_fs(), then blkdev_issue_flush() is not called.

On most modern architectures loads and stores of single word integers are atomic. I still used atomic_t for ns_flushed_device for documentation purposes. I only use atomic_read() and atomic_set(). Both are inline functions, which compile down to simple loads and stores on modern architectures, so there is no performance benefit in using a simple int instead.

br,
Andreas Rohner

v2->v3 (based on review of Ryusuke Konishi)
* Use separate atomic flag for ns_flushed_device instead of a bit flag in ns_flags
* Use smp_mb__after_atomic() after setting ns_flushed_device

v1->v2
* Add new flag THE_NILFS_FLUSHED

Andreas Rohner (1):
nilfs2: add missing blkdev_issue_flush() to nilfs_sync_fs()

 fs/nilfs2/file.c      |  6 +++++-
 fs/nilfs2/ioctl.c     |  6 +++++-
 fs/nilfs2/segment.c   |  4 ++++
 fs/nilfs2/super.c     | 12 ++++++++++++
 fs/nilfs2/the_nilfs.c |  1 +
 fs/nilfs2/the_nilfs.h |  2 ++
 6 files changed, 29 insertions(+), 2 deletions(-)
Signature · 6 lines
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html