]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add an mbuf allocator for netdump.
authormarkj <markj@FreeBSD.org>
Sun, 6 May 2018 00:19:48 +0000 (00:19 +0000)
committermarkj <markj@FreeBSD.org>
Sun, 6 May 2018 00:19:48 +0000 (00:19 +0000)
commita923d057a29ae1e331af0d85998b77a801c070e0
treecf706f556f144be05d53a19dc4b0a14545f517fe
parent989cd5755af30b1408daea3ef9777503ec5bd7ee
Add an mbuf allocator for netdump.

The aim 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 preallocate a number of mbufs and clusters, storing them
in linked lists, and using the lists to back some UMA cache zones. At
panic time, the mbuf and cluster zone pointers are overwritten with
those of the cache zones so that the mbuf allocator returns
preallocated items.

Using this scheme, drivers which cache mbuf zone pointers from
m_getzone() require special handling when implementing netdump support.

Reviewed by: cem (earlier version), julian, sbruno
MFC after: 1 month
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D15251
sys/kern/kern_mbuf.c
sys/sys/mbuf.h