HomeFreeBSD

sendfile: retire M_BLOCKED

Description

sendfile: retire M_BLOCKED

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.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D50728

Details

Provenance
glebiusAuthored on Jul 25 2025, 8:06 PM
Reviewer
markj
Differential Revision
D50728: sendfile: retire M_BLOCKED
Parents
rGf2c2ed7df313: sendfile: don't hack sb_lowat for sockets that manage the watermark
Branches
Unknown
Tags
Unknown