git: b984d153e057 - main - Don't set GELI UMA zone as UMA_ZONE_NOFREE.

Gleb Smirnoff glebius at FreeBSD.org
Fri Oct 1 17:31:30 UTC 2021


The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/commit/?id=b984d153e057b7879632b8e6015a05ce3f177580

commit b984d153e057b7879632b8e6015a05ce3f177580
Author:     Gleb Smirnoff <glebius at FreeBSD.org>
AuthorDate: 2021-10-01 17:24:50 +0000
Commit:     Gleb Smirnoff <glebius at FreeBSD.org>
CommitDate: 2021-10-01 17:31:17 +0000

    Don't set GELI UMA zone as UMA_ZONE_NOFREE.
    
    That fixes memory leak on last GELI provider destroyed, introduced
    in 2dbc9a388ee. This patch was originally developed late 2019 and
    the flag was necessary to prevent zone drainage under memory pressure.
    Today, with f09cbea31a3f the UMA is fixed not to drain into reserves.
    
    Discussed with: jtl, markj
    Fixes:          2dbc9a388ee
    PR:             258787
---
 sys/geom/eli/g_eli.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c
index 773b9c829acc..c2fdb70980c0 100644
--- a/sys/geom/eli/g_eli.c
+++ b/sys/geom/eli/g_eli.c
@@ -892,13 +892,8 @@ g_eli_init_uma(void)
                     G_ELI_AUTH_SECKEYLEN) * nsw_cluster_max +
                     sizeof(uintptr_t), PAGE_SIZE);
 
-		/*
-		 * Create the zone, setting UMA_ZONE_NOFREE so we won't
-		 * drain the zone in a memory shortage.
-		 */
 		g_eli_uma = uma_zcreate("GELI buffers", g_eli_alloc_sz,
-		    NULL, NULL, NULL, NULL,
-		    UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
+		    NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
 
 		/* Reserve and pre-allocate pages, as appropriate. */
 		uma_zone_reserve(g_eli_uma, g_eli_minbufs);


More information about the dev-commits-src-all mailing list