]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ufs: Avoid M_WAITOK allocations when building a dirhash
authorDon Morris <dgmorris@earthlink.net>
Thu, 20 May 2021 14:54:38 +0000 (10:54 -0400)
committerMark Johnston <markj@FreeBSD.org>
Thu, 27 May 2021 13:06:15 +0000 (09:06 -0400)
commit8340548bc84bf1cbfa678febb08e0aa0293fd935
treed5acbdfb93ca8c598fe0020251d1635e624b895d
parent83a8e97fd3c27e9a4a03823705074a0471d0b6cc
ufs: Avoid M_WAITOK allocations when building a dirhash

At this point the directory's vnode lock is held, so blocking while
waiting for free pages makes the system more susceptible to deadlock in
low memory conditions.  This is particularly problematic on NUMA systems
as UMA currently implements a strict first-touch policy.

ufsdirhash_build() already uses M_NOWAIT for other allocations and
already handled failures for the block array allocation, so just convert
to M_NOWAIT.

PR: 253992
Reviewed by: markj, mckusick, vangyzen

(cherry picked from commit f17a5900850b4d449a91cbe9c61dfb62373c3cd1)
sys/ufs/ufs/ufs_dirhash.c