Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Jul 2016 10:00:08 -0700
From:      Nathan Whitehorn <nwhitehorn@freebsd.org>
To:        Andrew Turner <andrew@fubar.geek.nz>
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:  <a03f7a15-1b7c-cbaf-fddf-7bff4c1f0e06@freebsd.org>
In-Reply-To: <20160706175732.4a857719@zapp>
References:  <201607061409.u66E9nfV037939@repo.freebsd.org> <20160706175732.4a857719@zapp>

next in thread | previous in thread | raw e-mail | index | archive | help


On 07/06/16 09:57, Andrew Turner wrote:
> On Wed, 6 Jul 2016 14:09:49 +0000 (UTC)
> Nathan Whitehorn <nwhitehorn@FreeBSD.org> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a03f7a15-1b7c-cbaf-fddf-7bff4c1f0e06>