From owner-svn-src-head@freebsd.org Mon Jan 11 19:08:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3BA1A6C595; Mon, 11 Jan 2016 19:08:53 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22b.google.com (mail-ig0-x22b.google.com [IPv6:2607:f8b0:4001:c05::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A522D1C01; Mon, 11 Jan 2016 19:08:53 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x22b.google.com with SMTP id h5so77088126igh.0; Mon, 11 Jan 2016 11:08:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=oCB3A9oIM6QS8sii5MSA+A+e1kZj/6uBIy6RcY+WJ8A=; b=FG2VUgXBYAeZNTdQWrtHRLewXS3jgRTIsJ45kZxt7AK+TVnmkXj9lW0nZ5hXGZPx4z p2DMkjLM7bDDJfnTyDLR7XOpnrIIuh/rIC92Cs/1Da5EsL55AUiHBlgzVxBH17p89GM1 tAsxdOXkGOX4u5EOv+SOfTZrtS9VB2r+8AOasRMvqbBX/5Rt4o3X4vnoUKeB5I1OSVek voKQ6SapZLVN7AYcP6ydv9jyp33CZi+iwTC2Gkk7afPYgLPRbQpF1JGC3Qn3ytUMjQyb PTv0pnofY0llojtXgESsfRxvYaw8SqCjd9DjuSTwSyTSx2NLM7IQv2dIGz/utX3VBLDO goIQ== MIME-Version: 1.0 X-Received: by 10.50.136.226 with SMTP id qd2mr13810764igb.37.1452539333011; Mon, 11 Jan 2016 11:08:53 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.121.202 with HTTP; Mon, 11 Jan 2016 11:08:52 -0800 (PST) In-Reply-To: References: <201601101753.u0AHrhSJ099996@repo.freebsd.org> Date: Mon, 11 Jan 2016 11:08:52 -0800 X-Google-Sender-Auth: 7lExSHi4hO-5AQuVaj5YENZwFTs Message-ID: Subject: Re: svn commit: r293640 - head/sys/vm From: Adrian Chadd To: cem@freebsd.org Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 19:08:54 -0000 yes sorry, I forgot about the PR! -a On 11 January 2016 at 10:12, Conrad Meyer wrote: > Does this fix https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204121 ? > > Thanks, > Conrad > > On Sun, Jan 10, 2016 at 9:53 AM, Adrian Chadd wrote: >> Author: adrian >> Date: Sun Jan 10 17:53:43 2016 >> New Revision: 293640 >> URL: https://svnweb.freebsd.org/changeset/base/293640 >> >> Log: >> Fix the domain iterator to not try the first-touch / fixed domain >> more than once when doing round-robin. >> >> This lead to a panic because the iterator was trying the same domain >> twice and not trying one of the other domains. >> >> Reported by: pho >> Tested by: pho >> >> Modified: >> head/sys/vm/vm_domain.c >> >> Modified: head/sys/vm/vm_domain.c >> ============================================================================== >> --- head/sys/vm/vm_domain.c Sun Jan 10 17:47:57 2016 (r293639) >> +++ head/sys/vm/vm_domain.c Sun Jan 10 17:53:43 2016 (r293640) >> @@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$"); >> #include >> >> static __inline int >> -vm_domain_rr_selectdomain(void) >> +vm_domain_rr_selectdomain(int skip_domain) >> { >> #if MAXMEMDOM > 1 >> struct thread *td; >> @@ -71,6 +71,16 @@ vm_domain_rr_selectdomain(void) >> >> td->td_dom_rr_idx++; >> td->td_dom_rr_idx %= vm_ndomains; >> + >> + /* >> + * If skip_domain is provided then skip over that >> + * domain. This is intended for round robin variants >> + * which first try a fixed domain. >> + */ >> + if ((skip_domain > -1) && (td->td_dom_rr_idx == skip_domain)) { >> + td->td_dom_rr_idx++; >> + td->td_dom_rr_idx %= vm_ndomains; >> + } >> return (td->td_dom_rr_idx); >> #else >> return (0); >> @@ -339,12 +349,12 @@ vm_domain_iterator_run(struct vm_domain_ >> if (vi->n == vm_ndomains) >> *domain = vi->domain; >> else >> - *domain = vm_domain_rr_selectdomain(); >> + *domain = vm_domain_rr_selectdomain(vi->domain); >> vi->n--; >> break; >> case VM_POLICY_ROUND_ROBIN: >> default: >> - *domain = vm_domain_rr_selectdomain(); >> + *domain = vm_domain_rr_selectdomain(-1); >> vi->n--; >> break; >> } >>