Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Aug 2010 23:12:09 -0700
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        Attilio Rao <attilio@freebsd.org>
Cc:        src-committers@freebsd.org, John Baldwin <jhb@freebsd.org>, "Jayachandran C." <jchandra@freebsd.org>, svn-src-all@freebsd.org, Joe Landers <jlanders@vmware.com>, Randall Stewart <rrs@freebsd.org>, sbruno@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r208165 - in head/sys: kern mips/conf mips/include  mips/mips mips/rmi mips/rmi/dev/xlr
Message-ID:  <AANLkTim4u-b9ur_YEX7j2UT1zWFJowPCcLe588rSgQxu@mail.gmail.com>
In-Reply-To: <AANLkTikAarFgbxgGu-8XG7gh6VidPoVGwva54NN4rcRF@mail.gmail.com>
References:  <201005161943.o4GJhnTo096839@svn.freebsd.org> <AANLkTikAarFgbxgGu-8XG7gh6VidPoVGwva54NN4rcRF@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Aug 8, 2010 at 17:01, Attilio Rao <attilio@freebsd.org> wrote:
>> Modified: head/sys/kern/subr_smp.c
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
>> --- head/sys/kern/subr_smp.c =A0 =A0Sun May 16 19:25:56 2010 =A0 =A0 =A0=
 =A0(r208164)
>> +++ head/sys/kern/subr_smp.c =A0 =A0Sun May 16 19:43:48 2010 =A0 =A0 =A0=
 =A0(r208165)
>> @@ -503,7 +503,10 @@ smp_topo_none(void)
>> =A0 =A0 =A0 =A0top =3D &group[0];
>> =A0 =A0 =A0 =A0top->cg_parent =3D NULL;
>> =A0 =A0 =A0 =A0top->cg_child =3D NULL;
>> - =A0 =A0 =A0 top->cg_mask =3D (1 << mp_ncpus) - 1;
>> + =A0 =A0 =A0 if (mp_ncpus =3D=3D sizeof(top->cg_mask) * 8)
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 top->cg_mask =3D -1;
>> + =A0 =A0 =A0 else
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 top->cg_mask =3D (1 << mp_ncpus) - 1;
>> =A0 =A0 =A0 =A0top->cg_count =3D mp_ncpus;
>> =A0 =A0 =A0 =A0top->cg_children =3D 0;
>> =A0 =A0 =A0 =A0top->cg_level =3D CG_SHARE_NONE;
>>
>
> The fix is, however, improper (there is no clear relationship between
> the multiplication and why that happens) thus I would rather use what
> Joe has reported in the PR.

I don't understand how you can say there is no clear relationship
between the multiplication and the problem.  If you have the same
number of CPUs as there are bits in cg_mask, since 1 is an int the
result of the shift and the subtraction will be wrong unless int has
more bits than cg_mask.  Both fixes fail to handle the case of more
CPUs than there are bits in cg_mask, but that's expected.

I agree with you about the nature of the commit message and the
commit, but my complaints (and those of others) back in May went
unacknowledged and I don't expect comments about that this long after
the fact to make an impact.

Juli.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTim4u-b9ur_YEX7j2UT1zWFJowPCcLe588rSgQxu>