Page MenuHomeFreeBSD

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

Authored by glebius on Feb 10 2025, 10:20 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jul 5, 8:27 AM
Unknown Object (File)
Fri, Jul 4, 7:39 PM
Unknown Object (File)
Wed, Jul 2, 2:22 PM
Unknown Object (File)
Tue, Jul 1, 7:01 PM
Unknown Object (File)
Tue, Jul 1, 5:39 AM
Unknown Object (File)
Mon, Jun 30, 6:05 PM
Unknown Object (File)
Mon, Jun 30, 3:15 PM
Unknown Object (File)
Mon, Jun 30, 2:44 AM
Subscribers

Details

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 Not Applicable
Unit
Tests Not Applicable

Event Timeline

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

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
118

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.

This revision was not accepted when it landed; it landed in state Needs Review.Apr 30 2025, 9:18 PM
This revision was automatically updated to reflect the committed changes.