Index: amd64/include/vmparam.h =================================================================== --- amd64/include/vmparam.h +++ amd64/include/vmparam.h @@ -97,9 +97,10 @@ * the pool from which physical pages for page tables and small UMA * objects are allocated. */ -#define VM_NFREEPOOL 2 +#define VM_NFREEPOOL 3 #define VM_FREEPOOL_DEFAULT 0 #define VM_FREEPOOL_DIRECT 1 +#define VM_FREEPOOL_NOFREE 2 /* * Create up to three free page lists: VM_FREELIST_DMA32 is for physical pages Index: sys/malloc.h =================================================================== --- sys/malloc.h +++ sys/malloc.h @@ -60,6 +60,7 @@ #define M_FIRSTFIT 0x1000 /* Only for vmem, fast fit. */ #define M_BESTFIT 0x2000 /* Only for vmem, low fragmentation. */ #define M_EXEC 0x4000 /* allocate executable space. */ +#define M_N0FREE 0x8000 #define M_MAGIC 877983977 /* time when first defined :-) */ Index: vm/uma_core.c =================================================================== --- vm/uma_core.c +++ vm/uma_core.c @@ -1039,6 +1039,9 @@ if (keg->uk_flags & UMA_ZONE_NODUMP) wait |= M_NODUMP; + if (keg->uk_flags & UMA_ZONE_NOFREE) + wait |= M_N0FREE; + /* zone is passed for legacy reasons. */ mem = allocf(zone, size, domain, &flags, wait); if (mem == NULL) { Index: vm/vm_page.h =================================================================== --- vm/vm_page.h +++ vm/vm_page.h @@ -464,6 +464,7 @@ #define VM_ALLOC_ZERO 0x0040 /* (acfgp) Allocate a prezeroed page */ #define VM_ALLOC_NOOBJ 0x0100 /* (acg) No associated object */ #define VM_ALLOC_NOBUSY 0x0200 /* (acgp) Do not excl busy the page */ +#define VM_ALLOC_NOFREE 0x0400 #define VM_ALLOC_IGN_SBUSY 0x1000 /* (gp) Ignore shared busy flag */ #define VM_ALLOC_NODUMP 0x2000 /* (ag) don't include in dump */ #define VM_ALLOC_SBUSY 0x4000 /* (acgp) Shared busy the page */ @@ -486,6 +487,8 @@ pflags |= VM_ALLOC_ZERO; if ((malloc_flags & M_NODUMP) != 0) pflags |= VM_ALLOC_NODUMP; + if ((malloc_flags & M_N0FREE) != 0) + pflags |= VM_ALLOC_NOFREE; if ((malloc_flags & M_NOWAIT)) pflags |= VM_ALLOC_NOWAIT; if ((malloc_flags & M_WAITOK)) Index: vm/vm_page.c =================================================================== --- vm/vm_page.c +++ vm/vm_page.c @@ -1850,7 +1850,7 @@ */ vm_domain_free_lock(vmd); m = vm_phys_alloc_pages(domain, object != NULL ? - VM_FREEPOOL_DEFAULT : VM_FREEPOOL_DIRECT, 0); + VM_FREEPOOL_DEFAULT : ((req & VM_ALLOC_NOFREE) ? VM_FREEPOOL_NOFREE : VM_FREEPOOL_DIRECT), 0); vm_domain_free_unlock(vmd); if (m == NULL) { vm_domain_freecnt_inc(vmd, 1);