From owner-svn-src-all@freebsd.org Wed Jul 6 17:00:12 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 9182BB75665; Wed, 6 Jul 2016 17:00:12 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6585E12F4; Wed, 6 Jul 2016 17:00:12 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (c-50-139-166-237.hsd1.ma.comcast.net [50.139.166.237]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u66H08mB012518 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 6 Jul 2016 10:00:09 -0700 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 To: Andrew Turner References: <201607061409.u66E9nfV037939@repo.freebsd.org> <20160706175732.4a857719@zapp> Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org From: Nathan Whitehorn Message-ID: Date: Wed, 6 Jul 2016 10:00:08 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160706175732.4a857719@zapp> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVZLfxDDxBNPFwJ7si41Ir434oTk1PFJHgFkHtKJl0wnPhAV/tNnw4JFLHWRNcNWI56PTlb7kvbF1udSLfVfBWlsBt6o8jNGMsw= X-Sonic-ID: C;2LdKGJtD5hGLgZNwxPCmMQ== M;pCq2GJtD5hGLgZNwxPCmMQ== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd 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 17:00:12 -0000 On 07/06/16 09:57, Andrew Turner wrote: > 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 > You are right. Somehow my build tests succeeded anyway. Will fix quickly. -Nathan