Page MenuHomeFreeBSD

sendfile: retire M_BLOCKED
ClosedPublic

Authored by glebius on Jun 6 2025, 5:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 4, 3:52 AM
Unknown Object (File)
Sat, Sep 27, 2:44 AM
Unknown Object (File)
Mon, Sep 22, 3:53 PM
Unknown Object (File)
Sep 17 2025, 11:39 AM
Unknown Object (File)
Sep 15 2025, 9:24 AM
Unknown Object (File)
Sep 9 2025, 3:40 AM
Unknown Object (File)
Sep 3 2025, 7:26 PM
Unknown Object (File)
Sep 2 2025, 11:24 AM
Subscribers

Details

Summary

Follow unix(4) commit 51ac5ee0d57f and retire M_BLOCKED for TCP sockets as
well. The M_BLOCKED flag was introduced back 2016 together with non-
blocking sendfile(2). It marked mbufs in a sending socket buffer that
could be ready to sent, but are sitting behind an M_NOTREADY mbuf(s), that
blocks them.

You may consider this flag as an INVARIANT flag that helped to ensure
socket buffer consistency. Or maybe the socket code was so convoluted
back then, that it was unclear if sbfree() may be called on an mbuf that
is in the middle of the buffer, and I decided to introduce the flag to
protect against that. With today state of socket buffer code it became
clear that the latter cannot happen. And this commit adds an assertion
proving that.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable