If you're gonna do that, might as well use sync_file_range on Linux <a href="https://lkml.indiana.edu/hypermail/linux/kernel/0904.0/01076.html" rel="nofollow noreferrer">https://lkml.indiana.edu/hypermail/linux/kernel/0904.0/01076...</a>
Reminds me of Rethink the Sync (Ed Nightingale, Kaushik Veeraraghavan, Peter M. Chen, Jason Flinn) <a href="https://dl.acm.org/doi/10.1145/1394441.1394442" rel="nofollow noreferrer">https://dl.acm.org/doi/10.1145/1394441.1394442</a>