From owner-svn-src-all@freebsd.org Wed Jul 6 16:58:04 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 B3425B753B3; Wed, 6 Jul 2016 16:58:04 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 755EF1DBE; Wed, 6 Jul 2016 16:58:04 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (global-5-141.nat-2.net.cam.ac.uk [131.111.5.141]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 5938DD78E6; Wed, 6 Jul 2016 16:57:33 +0000 (UTC) Date: Wed, 6 Jul 2016 17:57:32 +0100 From: Andrew Turner To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302372 - in head/sys: amd64/include cddl/compat/opensolaris/sys dev/cpuctl i386/include kern net netinet powerpc/include powerpc/powerpc vm Message-ID: <20160706175732.4a857719@zapp> In-Reply-To: <201607061409.u66E9nfV037939@repo.freebsd.org> References: <201607061409.u66E9nfV037939@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 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: Wed, 06 Jul 2016 16:58:04 -0000 On Wed, 6 Jul 2016 14:09:49 +0000 (UTC) Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Wed Jul 6 14:09:49 2016 > New Revision: 302372 > URL: https://svnweb.freebsd.org/changeset/base/302372 > > Log: > Replace a number of conflations of mp_ncpus and mp_maxid with either > mp_maxid or CPU_FOREACH() as appropriate. This fixes a number of > places in the kernel that assumed CPU IDs are dense in [0, mp_ncpus) > and would try, for example, to run tasks on CPUs that did not exist > or to allocate too few buffers on systems with sparse CPU IDs in > which there are holes in the range and mp_maxid > mp_ncpus. Such > circumstances generally occur on systems with SMT, but on which SMT > is disabled. This patch restores system operation at least on POWER8 > systems configured in this way. > There are a number of other places in the kernel with potential > problems in these situations, but where sparse CPU IDs are not > currently known to occur, mostly in the ARM machine-dependent code. > These will be fixed in a follow-up commit after the stable/11 branch. > ... > Modified: head/sys/net/flowtable.c > ============================================================================== > --- head/sys/net/flowtable.c Wed Jul 6 10:57:04 2016 > (r302371) +++ head/sys/net/flowtable.c Wed Jul 6 14:09:49 > 2016 (r302372) @@ -746,7 +746,7 @@ flowtable_alloc(struct > flowtable *ft) ft->ft_table[i] = uma_zalloc(pcpu_zone_ptr, M_WAITOK | > M_ZERO); > ft->ft_masks = uma_zalloc(pcpu_zone_ptr, M_WAITOK); > - for (int i = 0; i < mp_ncpus; i++) { > + CPU_FOREACH(i) { This is broken, it removed the declaration of i. Andrew