Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107605520
D32242.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D32242.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D32242: Drain a keg of a UMA_ZONE_NOFREE zone when it is destroyed.
Attached
Detach File
Event Timeline
Log In to Comment