]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Check the UMA zone's full bucket cache before short-circuiting an alloc.
authorMark Johnston <markj@FreeBSD.org>
Mon, 10 Aug 2020 20:34:45 +0000 (20:34 +0000)
committerMark Johnston <markj@FreeBSD.org>
Mon, 10 Aug 2020 20:34:45 +0000 (20:34 +0000)
commitaf32cefd7ce83d5eb62d7f392146386518d07bc0
tree3ff55d3ca373cb1708dc4cfa5ed6df41776c10f2
parentcf8a49ab6e9d2b5b944245d008c89e5ed8300da6
Check the UMA zone's full bucket cache before short-circuiting an alloc.

The global "bucketdisable" flag indicates that we are in a low memory
situation and should avoid allocating buckets.  However, in the
allocation path we were checking it before the full bucket cache and
bailing even if the cache is non-empty.  Defer the check so that we have
a shot at allocating from the cache.

This came up because M_NOWAIT allocations from the buf trie node zone
must always succeed.  In one scenario, all of the preallocated trie
nodes were in the bucket list, and a new slab allocation could not
succeed due to a memory shortage.  The short-circuiting caused an
allocation failure which triggered a panic.

Reported by: pho
Reviewed by: cem
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25980
sys/vm/uma_core.c