Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F150019343
D22395.id64411.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D22395.id64411.diff
View Options
Index: sys/vm/vm_pageout.c
===================================================================
--- sys/vm/vm_pageout.c
+++ sys/vm/vm_pageout.c
@@ -1965,11 +1965,19 @@
}
}
+/*
+ * Signal a free page shortage to subsystems that have registered an event
+ * handler. Reclaim memory from UMA in the event of a severe shortage.
+ * Return true if the free page count should be re-evaluated.
+ */
static bool
vm_pageout_lowmem(void)
{
static int lowmem_ticks = 0;
int last;
+ bool ret;
+
+ ret = false;
last = atomic_load_int(&lowmem_ticks);
while ((u_int)(ticks - last) / hz >= lowmem_period) {
@@ -1984,15 +1992,27 @@
/*
* We do this explicitly after the caches have been
- * drained above. If we have a severe page shortage on
- * our hands, completely drain all UMA zones. Otherwise,
- * just prune the caches.
+ * drained above.
*/
- uma_reclaim(vm_page_count_min() ? UMA_RECLAIM_DRAIN_CPU :
- UMA_RECLAIM_TRIM);
- return (true);
+ uma_reclaim(UMA_RECLAIM_TRIM);
+ ret = true;
}
- return (false);
+
+ /*
+ * Kick off an asynchronous reclaim of cached memory if one of the
+ * page daemons is failing to keep up with demand. Use the "severe"
+ * threshold instead of "min" to ensure that we do not blow away the
+ * caches if a subset of the NUMA domains are depleted by kernel memory
+ * allocations; the domainset iterators automatically skip domains
+ * below the "min" threshold on the first pass.
+ *
+ * UMA reclaim worker has its own rate-limiting mechanism, so don't
+ * worry about kicking it too often.
+ */
+ if (vm_page_count_severe())
+ uma_reclaim_wakeup();
+
+ return (ret);
}
static void
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 29, 7:21 PM (1 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30549435
Default Alt Text
D22395.id64411.diff (1 KB)
Attached To
Mode
D22395: Reclaim memory from UMA if the page daemon is struggling.
Attached
Detach File
Event Timeline
Log In to Comment