Created attachment 261048 [details] SF_SYNC removal patch I'd like to see if there is any software in ports that uses this flag. Should be sufficient to just delete SF_SYNC from socket.h. However, a full patch removing the feature is attached.
New failure logs: https://pkg-status.freebsd.org/gohan06/data/mainamd64PR287348-default-foo/2025-06-17_05h57m36s/logs/errors/packetdrill-0.0.2025042400.log https://pkg-status.freebsd.org/gohan06/data/mainamd64PR287348-default-foo/2025-06-17_05h57m36s/logs/errors/rocr-1.9.1.log
Thanks, Antoine! The packetdrill is expected, it is our tool that test all things possible. A note on sysutils/rocr. The port was added by jmd@ with a note in commit log "Hence, in the current absence of a working amdkfd on FreeBSD, these ports do not function yet". The port was never improved after. The Github repo the port fetches from is an outdated jmd@'s fork of ROCm/ROCR-Runtime. The SF_SYNC flag was added when jmd@ ported the code from Linux: 5c092e87 (J M Dieterich 2017-02-14 10:49:25 -0500 228) #ifdef __FreeBSD__ 5c092e87 (J M Dieterich 2017-02-14 10:49:25 -0500 229) int err = sendfile(in, d, size, 0, NULL, &written, SF_SYNC); 5c092e87 (J M Dieterich 2017-02-14 10:49:25 -0500 230) #else ^e9aac90 (James Edwards 2016-01-26 19:43:17 -0600 231) written = sendfile(d, in, NULL, size); 5c092e87 (J M Dieterich 2017-02-14 10:49:25 -0500 232) #endif This doesn't make any sense. There is no analog of SF_SYNC in Linux and never was. My guess flag was added without understanding its meaning. Verdict: SF_SYNC has no use, as expected.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=d17cbe46983c08ba0567b0ffd71434abd35aa205 commit d17cbe46983c08ba0567b0ffd71434abd35aa205 Author: Gleb Smirnoff <glebius@FreeBSD.org> AuthorDate: 2025-06-24 21:26:10 +0000 Commit: Gleb Smirnoff <glebius@FreeBSD.org> CommitDate: 2025-06-24 22:24:04 +0000 sendfile: retire SF_SYNC The flag was added in b75a1171d8ba4 for the sake of Varnish. However, that idea didn't work. Quoting email from Poul-Henning: "We had to give up sendfile(), the overhead of keeping track of everything between the network stack and VM system made ate any gain we saw. ... I dont think we ever shipped a version where sendfile was enabled by default." PR: 287348 lib/libsys/sendfile.2 | 8 +------- sys/kern/kern_sendfile.c | 6 +++++- 2 files changed, 6 insertions(+), 8 deletions(-)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=575efcfff22f5d75fc3ac6201f11e5eae46ec9ce commit 575efcfff22f5d75fc3ac6201f11e5eae46ec9ce Author: Gleb Smirnoff <glebius@FreeBSD.org> AuthorDate: 2025-12-04 16:37:10 +0000 Commit: Gleb Smirnoff <glebius@FreeBSD.org> CommitDate: 2025-12-04 16:44:21 +0000 sendfile: remove SF_SYNC in FreeBSD 16.0 See d17cbe46983c for details. PR: 287348 sys/kern/kern_sendfile.c | 88 ------------------------------------------------ sys/sys/socket.h | 2 +- 2 files changed, 1 insertion(+), 89 deletions(-)