Page MenuHomeFreeBSD

Drain a keg of a UMA_ZONE_NOFREE zone when it is destroyed.
AbandonedPublic

Authored by glebius on Oct 1 2021, 1:37 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jun 15, 1:00 PM
Unknown Object (File)
Tue, Jun 9, 9:04 AM
Unknown Object (File)
May 13 2026, 2:00 AM
Unknown Object (File)
May 13 2026, 1:38 AM
Unknown Object (File)
May 6 2026, 11:50 AM
Unknown Object (File)
May 6 2026, 5:35 AM
Unknown Object (File)
May 3 2026, 9:00 PM
Unknown Object (File)
Mar 26 2026, 4:29 AM
Subscribers

Details

Reviewers
markj
jeff
Summary

Looks like my (Jonathan's) change to GELI created a precedent
when an UMA_ZONE_NOFREE is being destroyed. Without this change
we are leaking zero items, but leaking pages:

Freed UMA keg (GELI buffers) was not empty (0 items). Lost 528 pages of memory.

Fixes: 2dbc9a388ee
PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258787

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 41872
Build 38760: arc lint + arc unit

Event Timeline

From my reading, GELI sets _NOFREE to ensure that the reserve is not drained during a memory shortage. But UMA should not have done this in the first place, and it was fixed in commit f09cbea31a3ffc03361687cb39f264b6c8775212 . So does GELI still need to specify _NOFREE? If not, then my preferred solution is to drop the _NOFREE flag there. We should try hard to avoid adding new _NOFREE zones in general.

From my reading, GELI sets _NOFREE to ensure that the reserve is not drained during a memory shortage. But UMA should not have done this in the first place, and it was fixed in commit f09cbea31a3ffc03361687cb39f264b6c8775212 . So does GELI still need to specify _NOFREE? If not, then my preferred solution is to drop the _NOFREE flag there. We should try hard to avoid adding new _NOFREE zones in general.

I believe you are 100% right. This flag we were carrying in our tree from the times that predate your fix.

The problem will be addressed differently.