[Bug 248008] i386 system can hang with many processes sleeping on btalloc post base r358097

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Aug 12 17:14:40 UTC 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248008

Mark Johnston <markj at FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |markj at FreeBSD.org

--- Comment #5 from Mark Johnston <markj at FreeBSD.org> ---
I think the suggested patch is ok, but not for the reason stated.  On platforms
without a direct map the problem is: to allocate btags we need a slab, and to
allocate a slab we need to map a page, and to map a page we need to allocate
btags.

We handle this recursion using a custom slab allocator which specifies
M_USE_RESERVE, allowing it to dip into a reserve of free btags.  Because the
returned slab can be used to keep the reserve populated, this ensures that
there are always enough free btags available to handle the recursion.

UMA_ZONE_NOFREE ensures that we never reclaim free slabs from the zone. 
However, when it was removed, an apparent bug in UMA was exposed: keg_drain()
ignores the reservation set by uma_zone_reserve() in vmem_startup().  So under
memory pressure we reclaim the free btags that are needed to break the
recursion.  That's why adding _NOFREE back fixes the problem: it disables the
reclamation.

We could perhaps fix it more cleverly, by modifying keg_drain() to always leave
uk_reserve slabs available.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list