diff options
| author | 2026-08-15 20:02:15 +0800 | |
|---|---|---|
| committer | 2026-09-13 23:33:05 -0600 | |
| commit | 0d492f40c4ad7af7b1625fd81dd58a7978ab97f6 (patch) | |
| tree | 77301890c9691da09c1ceaed5f1f5bc3c62fe0ff /scripts/Makefile.thinlto | |
| parent | block: skip redundant flush for O_DSYNC direct writes (diff) | |
block: only use REQ_FUA for direct writes if the device supports it
When a block device does not support FUA natively, the block layer
emulates it by adding a cache flush to every write bio. An O_DSYNC
direct write that spans N bios then costs N flushes, rather than the
single generic_write_sync() issued after the write completes.
Introduce blkdev_dio_fua() to decide when REQ_FUA is set. A synchronous
write can rely on generic_write_sync() when the device lacks FUA, so it
sets REQ_FUA only when bdev_fua() is true. An asynchronous write
completes in blkdev_bio_end_io() and cannot call the blocking
generic_write_sync(), so it keeps REQ_FUA (emulated when needed) to stay
durable.
Suggested-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Zhenxian Ma <mzx199711@gmail.com>
Signed-off-by: Zhenxian Ma <mazhenxian@xiaohongshu.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/tencent_A41247F29AC0971AE96B52964BE4491B440A@qq.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
