svn commit: r354029 - head/sys/vm
Andrew Gallatin
gallatin at FreeBSD.org
Thu Oct 24 18:39:06 UTC 2019
Author: gallatin
Date: Thu Oct 24 18:39:05 2019
New Revision: 354029
URL: https://svnweb.freebsd.org/changeset/base/354029
Log:
Add a tunable to set the pgcache zone's maxcache
When it is set to 0 (the default), a heavy Netflix-style web workload
suffers from heavy lock contention on the vm page free queue called from
vm_page_zone_{import,release}() as the buckets are frequently drained.
When setting the maxcache, this contention goes away.
We should eventually try to autotune this, as well as make this
zone eligable for uma_reclaim().
Reviewed by: alc, markj
Not Objected to by: jeff
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D22112
Modified:
head/sys/vm/vm_page.c
Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c Thu Oct 24 18:13:26 2019 (r354028)
+++ head/sys/vm/vm_page.c Thu Oct 24 18:39:05 2019 (r354029)
@@ -216,8 +216,10 @@ vm_page_init_cache_zones(void *dummy __unused)
{
struct vm_domain *vmd;
struct vm_pgcache *pgcache;
- int domain, pool;
+ int domain, maxcache, pool;
+ maxcache = 0;
+ TUNABLE_INT_FETCH("vm.pgcache_zone_max", &maxcache);
for (domain = 0; domain < vm_ndomains; domain++) {
vmd = VM_DOMAIN(domain);
@@ -237,7 +239,7 @@ vm_page_init_cache_zones(void *dummy __unused)
sizeof(struct vm_page), NULL, NULL, NULL, NULL,
vm_page_zone_import, vm_page_zone_release, pgcache,
UMA_ZONE_MAXBUCKET | UMA_ZONE_VM);
- (void)uma_zone_set_maxcache(pgcache->zone, 0);
+ (void)uma_zone_set_maxcache(pgcache->zone, maxcache);
}
}
}
More information about the svn-src-all
mailing list