Page MenuHomeFreeBSD

D32242.diff
No OneTemporary

D32242.diff

Index: sys/vm/uma_core.c
===================================================================
--- sys/vm/uma_core.c
+++ sys/vm/uma_core.c
@@ -297,7 +297,7 @@
static bool bucket_cache_reclaim_domain(uma_zone_t, bool, bool, int);
static int keg_ctor(void *, int, void *, int);
static void keg_dtor(void *, int, void *);
-static void keg_drain(uma_keg_t keg, int domain);
+static void keg_drain(uma_keg_t keg, int domain, bool dtor);
static int zone_ctor(void *, int, void *, int);
static void zone_dtor(void *, int, void *);
static inline void item_dtor(uma_zone_t zone, void *item, int size,
@@ -1224,7 +1224,7 @@
for (int i = 0; i < vm_ndomains; i++) {
if (bucket_cache_reclaim_domain(zone, false, false, i) &&
(zone->uz_flags & UMA_ZFLAG_CACHE) == 0)
- keg_drain(zone->uz_keg, i);
+ keg_drain(zone->uz_keg, i, false);
}
}
@@ -1690,11 +1690,11 @@
* Returns nothing.
*/
static void
-keg_drain(uma_keg_t keg, int domain)
+keg_drain(uma_keg_t keg, int domain, bool dtor)
{
int i;
- if ((keg->uk_flags & UMA_ZONE_NOFREE) != 0)
+ if (!dtor && (keg->uk_flags & UMA_ZONE_NOFREE) != 0)
return;
if (domain != UMA_ANYDOMAIN) {
keg_drain_domain(keg, domain);
@@ -1705,7 +1705,7 @@
}
static void
-zone_reclaim(uma_zone_t zone, int domain, int waitok, bool drain)
+zone_reclaim(uma_zone_t zone, int domain, int waitok, bool drain, bool dtor)
{
/*
* Count active reclaim operations in order to interlock with
@@ -1725,7 +1725,7 @@
bucket_cache_reclaim(zone, drain, domain);
if ((zone->uz_flags & UMA_ZFLAG_CACHE) == 0)
- keg_drain(zone->uz_keg, domain);
+ keg_drain(zone->uz_keg, domain, dtor);
ZONE_LOCK(zone);
zone->uz_reclaimers--;
if (zone->uz_reclaimers == 0)
@@ -1739,7 +1739,7 @@
int domain;
domain = (int)(uintptr_t)arg;
- zone_reclaim(zone, domain, M_NOWAIT, true);
+ zone_reclaim(zone, domain, M_NOWAIT, true, false);
}
static void
@@ -1748,7 +1748,7 @@
int domain;
domain = (int)(uintptr_t)arg;
- zone_reclaim(zone, domain, M_NOWAIT, false);
+ zone_reclaim(zone, domain, M_NOWAIT, false, false);
}
/*
@@ -3034,7 +3034,7 @@
keg = zone->uz_keg;
keg->uk_reserve = 0;
}
- zone_reclaim(zone, UMA_ANYDOMAIN, M_WAITOK, true);
+ zone_reclaim(zone, UMA_ANYDOMAIN, M_WAITOK, true, true);
/*
* We only destroy kegs from non secondary/non cache zones.

File Metadata

Mime Type
text/plain
Expires
Fri, Jan 17, 1:40 PM (20 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15839147
Default Alt Text
D32242.diff (2 KB)

Event Timeline