Date: Sat, 10 Mar 2018 22:47:26 +0000 (UTC) From: Jeff Roberson <jeff@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r330746 - user/jeff/numa/sys/vm Message-ID: <201803102247.w2AMlQ5f013946@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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; } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803102247.w2AMlQ5f013946>