summaryrefslogtreecommitdiffstats
path: root/fs/attr.c
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2015-08-19 10:35:04 +1000
committerDave Chinner <david@fromorbit.com>2015-08-19 10:35:04 +1000
commit3d751af2cbe9a73a869986a18e865f8a34265052 (patch)
tree6cf6ab82311a5dd4bfd6be22c47cda92ef4380a8 /fs/attr.c
parentffeecc5213024ae663377b442eedcfbacf6d0c5d (diff)
downloadop-kernel-dev-3d751af2cbe9a73a869986a18e865f8a34265052.zip
op-kernel-dev-3d751af2cbe9a73a869986a18e865f8a34265052.tar.gz
xfs: flush entire file on dio read/write to cached file
Filesystems are responsible to manage file coherency between the page cache and direct I/O. The generic dio code flushes dirty pages over the range of a dio to ensure that the dio read or a future buffered read returns the correct data. XFS has generally followed this pattern, though traditionally has flushed and invalidated the range from the start of the I/O all the way to the end of the file. This changed after the following commit: 7d4ea3ce xfs: use ranged writeback and invalidation for direct IO ... as the full file flush was no longer necessary to deal with the strange post-eof delalloc issues that were since fixed. Unfortunately, we have since received complaints about performance degradation due to the increased exclusive iolock cycles (which locks out parallel dio submission) that occur when a file has cached pages. This does not occur on filesystems that use the generic code as it also does not incorporate locking. The exclusive iolock is acquired any time the inode mapping has cached pages, regardless of whether they reside in the range of the I/O or not. If not, the flush/inval calls do no work and the lock was cycled for no reason. Under consideration of the cost of the exclusive iolock, update the dio read and write handlers to flush and invalidate the entire mapping when cached pages exist. In most cases, this increases the cost of the initial flush sequence but eliminates the need for further lock cycles and flushes so long as the workload does not actively mix direct and buffered I/O. This also more closely matches historical behavior and performance characteristics that users have come to expect. Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/attr.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud