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 >> ============================================================================== >> --- head/sys/kern/subr_smp.c Sun May 16 19:25:56 2010 (r208164) >> +++ head/sys/kern/subr_smp.c Sun May 16 19:43:48 2010 (r208165) >> @@ -503,7 +503,10 @@ smp_topo_none(void) >> top = &group[0]; >> top->cg_parent = NULL; >> top->cg_child = NULL; >> - top->cg_mask = (1 << mp_ncpus) - 1; >> + if (mp_ncpus == sizeof(top->cg_mask) * 8) >> + top->cg_mask = -1; >> + else >> + top->cg_mask = (1 << mp_ncpus) - 1; >> top->cg_count = mp_ncpus; >> top->cg_children = 0; >> top->cg_level = 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>
