Page MenuHomeFreeBSD

netlink: let a dump wait for its reader
Needs ReviewPublic

Authored by rcm on Fri, Oct 2, 2:53 PM.
Tags
None
Referenced Files
F174955959: D60250.diff
Wed, Oct 7, 4:41 AM
Unknown Object (File)
Wed, Oct 7, 12:12 AM
Unknown Object (File)
Tue, Oct 6, 6:50 PM
Unknown Object (File)
Tue, Oct 6, 6:25 PM
Unknown Object (File)
Tue, Oct 6, 11:48 AM
Unknown Object (File)
Tue, Oct 6, 8:06 AM
Unknown Object (File)
Tue, Oct 6, 6:37 AM
Unknown Object (File)
Tue, Oct 6, 2:55 AM
Subscribers

Details

Reviewers
glebius
melifaro
Summary

The reply to a request ignores the size of the socket buffer, so a dump
is queued as a whole no matter how slowly it is read. A large dump
takes that much kernel memory, in M_NOWAIT allocations, and is cut short
when one of them fails.

Add nlmsg_pause_dump(). The handler of a dump calls it between
messages. When the socket buffer is full it returns true and the
handler returns. The request goes back to the socket, as requests
already do when the buffer fills up, and the handler gets it again, with
the cursor it passed, once the reader has made room.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

rcm requested review of this revision.Fri, Oct 2, 2:53 PM
rcm created this revision.
rcm created this object with visibility "rcm (R. Christian McDonald)".
rcm created this object with edit policy "rcm (R. Christian McDonald)".
rcm edited the summary of this revision. (Show Details)
rcm added reviewers: glebius, melifaro.
rcm changed the visibility from "rcm (R. Christian McDonald)" to "Public (No Login Required)".
rcm changed the edit policy from "rcm (R. Christian McDonald)" to "All Users".