Page MenuHomeFreeBSD

sendfile: factor out socket send buffer space sensing into a method
Needs ReviewPublic

Authored by glebius on Feb 10 2025, 10:20 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 6, 7:07 AM
Unknown Object (File)
Mar 9 2025, 1:23 PM
Unknown Object (File)
Mar 1 2025, 12:10 PM
Unknown Object (File)
Feb 18 2025, 9:51 PM
Unknown Object (File)
Feb 17 2025, 4:27 PM
Unknown Object (File)
Feb 14 2025, 11:54 PM
Unknown Object (File)
Feb 14 2025, 11:18 AM
Unknown Object (File)
Feb 14 2025, 7:33 AM
Subscribers

Details

Reviewers
markj
Group Reviewers
network
transport
Summary

Move a block of code that works with the socket send buffer from the main
sendfile loop into a separate function. Make it a protocol method, so
that protocols may provide a different one.

While here, provide a long comment explaining why we modify sb_lowat and
why we can't just remove that hack.

No functional change intended.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 62340
Build 59224: arc lint + arc unit

Event Timeline

markj added inline comments.
sys/sys/protosw.h
116

These annotations assume that the structure is cache line size-aligned (and I presume that that is why you moved the other function pointers around), but AFAICS there is nothing forcing them to be aligned, and in practice they are not aligned.

sys/sys/protosw.h
116

This is true. I plan later to rearrange them later. Probably after adding pr_lock(). And possibly use fileops structure pointer as part of protosw. Cause right now we have several file methods that are just translated into protocol methods, with the latter acting as superfluous shim and making list of protosw methods longer.