From owner-svn-src-user@freebsd.org Sat Mar 10 22:47:27 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 402E7F3B520 for ; Sat, 10 Mar 2018 22:47:27 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D03678776C; Sat, 10 Mar 2018 22:47:26 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB417140D6; Sat, 10 Mar 2018 22:47:26 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2AMlQYN013947; Sat, 10 Mar 2018 22:47:26 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2AMlQ5f013946; Sat, 10 Mar 2018 22:47:26 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201803102247.w2AMlQ5f013946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sat, 10 Mar 2018 22:47:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r330746 - user/jeff/numa/sys/vm X-SVN-Group: user X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: user/jeff/numa/sys/vm X-SVN-Commit-Revision: 330746 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2018 22:47:27 -0000 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; } /*