Summary: | Consider supporting linux' sync_file_range() | ||
---|---|---|---|
Product: | Base System | Reporter: | Andres Freund <andres> |
Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> |
Status: | New --- | ||
Severity: | Affects Some People | CC: | cem, crest, emaste, imp, kbowling, koobs, pstef, swills, trasz |
Priority: | --- | Keywords: | feature, needs-patch, performance |
Version: | CURRENT | ||
Hardware: | Any | ||
OS: | Any |
Description
Andres Freund
2015-10-20 10:41:34 UTC
Thank you for creating this issue report as requested Andres. This issue just got first use of the 'performance' keyword. \o/ Additionally, it appears Hadoop HDFS [1], Redis [2] and MongoDB [3] among others use this system call: [1] https://issues.apache.org/jira/browse/HDFS-6109 [2] https://github.com/antirez/redis/issues/667 [3] https://jira.mongodb.org/browse/SERVER-18649 While not exactly what you're asking for FreeBSD does offer aio_fsync(2) to implement asynchronous file syncing. In theory this offers the kernel the opportunity to flush data to stable storage at the optimal pace and notify the application about it. If we're talking about OS specific code paths its also possible to receive the notification via kqueue(2) + kevent(2) instead of polling or signals. Too bad that the kernel requires that much babysitting from userland. making sync_file_range should be straight forward. fsync is internally implemented as sync_file_range(0, 0, SYNC) in the kernel right now, so adding the right glue in the kernel would be easy. well, except for all the hedging of the wording for the flags... making sync_file_range should be straight forward. fsync is internally implemented as sync_file_range(0, 0, SYNC) in the kernel right now, so adding the right glue in the kernel would be easy. well, except for all the hedging of the wording for the flags... |