Page MenuHomeFreeBSD

Add the netdump mbuf allocator.
ClosedPublic

Authored by markj on May 1 2018, 5:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 11, 1:34 PM
Unknown Object (File)
Oct 23 2024, 10:51 AM
Unknown Object (File)
Oct 9 2024, 7:20 AM
Unknown Object (File)
Sep 24 2024, 9:05 AM
Unknown Object (File)
Sep 12 2024, 1:47 PM
Unknown Object (File)
Aug 31 2024, 4:02 AM
Unknown Object (File)
Aug 26 2024, 9:18 PM
Unknown Object (File)
Aug 25 2024, 10:24 PM

Details

Summary

The aim here is to permit mbuf allocations after a panic without
calling into the page allocator, without imposing any runtime overhead
during regular operation of the system, and without modifying driver
code. The approach taken is to pre-allocate a number of mbufs and
clusters, storing them in linked lists. The lists back a set of UMA
cache zones which replace the regular mbuf/cluster UMA zones. At panic
time, the zone pointers are overwritten with those of the cache zones,
so m_get() and so on return mbufs from the linked lists.

The main complication is that a few drivers (cxgb and iflib) cache mbuf
zone pointers from m_getzone(), so they need some special handling.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.May 1 2018, 8:52 PM
emaste added inline comments.
sys/kern/kern_mbuf.c
871 ↗(On Diff #42038)

just commit these independently first?

julian added inline comments.
sys/kern/kern_mbuf.c
383 ↗(On Diff #42038)

how about a big comment here separating this code from 'regular code' so that the casual reader can instantly know what is going on.

know it's ifdef'd but take the message in this review and make it a comment.

496 ↗(On Diff #42038)

in some cases it has been known to dump memory and then keep running.
do you have a way to 'un-overwrite' the zone pointers?

sys/kern/kern_mbuf.c
383 ↗(On Diff #42038)

netdump_mbuf_reinit() already has a similar comment; I'll move it.

496 ↗(On Diff #42038)

Not at the moment. I will look into the difficulty of getting that to work.

871 ↗(On Diff #42038)

Yeah, didn't mean to include these.

This revision now requires review to proceed.May 4 2018, 7:53 PM
markj marked an inline comment as done.May 4 2018, 7:56 PM
markj added inline comments.
sys/kern/kern_mbuf.c
496 ↗(On Diff #42038)

For the initial revision I plan to just return an error if one attempts to netdump while panicstr == NULL. From DDB one can execute "panic" to get a dump in that case. It may be possible for the system to resume operation after a netdump, but I don't think it's very straightforward, so I will punt on that for now.

This revision was not accepted when it landed; it landed in state Needs Review.May 6 2018, 12:20 AM
This revision was automatically updated to reflect the committed changes.