svn commit: r330746 - user/jeff/numa/sys/vm
Jeff Roberson
jeff at FreeBSD.org
Sat Mar 10 22:47:27 UTC 2018
Author: jeff
Date: Sat Mar 10 22:47:26 2018
New Revision: 330746
URL: https://svnweb.freebsd.org/changeset/base/330746
Log:
More complete fix for the FT iterator problem. When we switch from FT to
RR we may revisit the original domain and double count it against the
iteration count. We could track the original domain and skip it on the
RR pass but this would involve more state and checks. Just bump the
count an extra time instead.
Reported by: mjg
Modified:
user/jeff/numa/sys/vm/vm_domainset.c
Modified: user/jeff/numa/sys/vm/vm_domainset.c
==============================================================================
--- user/jeff/numa/sys/vm/vm_domainset.c Sat Mar 10 22:07:57 2018 (r330745)
+++ user/jeff/numa/sys/vm/vm_domainset.c Sat Mar 10 22:47:26 2018 (r330746)
@@ -94,7 +94,8 @@ static void
vm_domainset_iter_rr(struct vm_domainset_iter *di, int *domain)
{
- *domain = di->di_domain->ds_order[++(*di->di_iter) % di->di_domain->ds_cnt];
+ *domain = di->di_domain->ds_order[
+ ++(*di->di_iter) % di->di_domain->ds_cnt];
}
static void
@@ -155,7 +156,11 @@ vm_domainset_iter_first(struct vm_domainset_iter *di,
case DOMAINSET_POLICY_FIRSTTOUCH:
*domain = PCPU_GET(domain);
if (DOMAINSET_ISSET(*domain, &di->di_domain->ds_mask)) {
- di->di_n = di->di_domain->ds_cnt;
+ /*
+ * Add an extra iteration because we will visit the
+ * current domain a second time in the rr iterator.
+ */
+ di->di_n = di->di_domain->ds_cnt + 1;
break;
}
/*
More information about the svn-src-user
mailing list