From owner-svn-src-all@freebsd.org Mon Jan 11 18:12:50 2016 Return-Path: Delivered-To: svn-src-all@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 4F909A6B879; Mon, 11 Jan 2016 18:12:50 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yk0-f169.google.com (mail-yk0-f169.google.com [209.85.160.169]) (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 1B8AB1DA1; Mon, 11 Jan 2016 18:12:49 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-yk0-f169.google.com with SMTP id k129so417748175yke.0; Mon, 11 Jan 2016 10:12:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=b0rQwzjETlNI5VtrvBaOoqyVfWW7/cfF0nseX29zCtY=; b=ZTRIDn7OB/mlGsUC3+nMF4vhcKWuRy9Ax3Ha8EI4amkofTbmkAfeKmrxW3gFGqkKNV 1LDRh+/qDvN7rlKS8uAsvd1wvC+8SMsigFYWAbvq70i1mGm9X4IUkXilk7WgJkmV1EJE 5H85QpRXHMQzEJUUE3XdocZtVD9NfLxlW0/HPb/9cf/FQsUNOoif/68HghLWdtLtLOFi rLlWYYXc1DGp+/N+lmm3OZ52Kr7IG1W5i8OoOlwdm1DQHfWviYlHnRvm9mj6/8dxLuHl rIRchYRfxLV6qIFBopom3VLDPLLApYHq9Og5Cq1ZykQZ42pwAJvlOqTs5sDfmqB844vo RCMg== X-Received: by 10.129.92.132 with SMTP id q126mr105501089ywb.46.1452535963508; Mon, 11 Jan 2016 10:12:43 -0800 (PST) Received: from mail-yk0-f169.google.com (mail-yk0-f169.google.com. [209.85.160.169]) by smtp.gmail.com with ESMTPSA id w82sm45604277ywc.29.2016.01.11.10.12.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Jan 2016 10:12:43 -0800 (PST) Received: by mail-yk0-f169.google.com with SMTP id k129so417747832yke.0; Mon, 11 Jan 2016 10:12:42 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.129.40.77 with SMTP id o74mr106179363ywo.9.1452535962926; Mon, 11 Jan 2016 10:12:42 -0800 (PST) Reply-To: cem@FreeBSD.org Received: by 10.37.4.69 with HTTP; Mon, 11 Jan 2016 10:12:42 -0800 (PST) In-Reply-To: <201601101753.u0AHrhSJ099996@repo.freebsd.org> References: <201601101753.u0AHrhSJ099996@repo.freebsd.org> Date: Mon, 11 Jan 2016 10:12:42 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r293640 - head/sys/vm From: Conrad Meyer To: Adrian Chadd 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 18:12:50 -0000 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; > } >