From owner-svn-src-all@FreeBSD.ORG Mon Aug 9 06:12:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF46B106564A; Mon, 9 Aug 2010 06:12:31 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 44CB68FC19; Mon, 9 Aug 2010 06:12:30 +0000 (UTC) Received: by wwc33 with SMTP id 33so269794wwc.31 for ; Sun, 08 Aug 2010 23:12:29 -0700 (PDT) Received: by 10.227.146.76 with SMTP id g12mr13527246wbv.82.1281334349235; Sun, 08 Aug 2010 23:12:29 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.216.5.5 with HTTP; Sun, 8 Aug 2010 23:12:09 -0700 (PDT) In-Reply-To: References: <201005161943.o4GJhnTo096839@svn.freebsd.org> From: Juli Mallett Date: Sun, 8 Aug 2010 23:12:09 -0700 X-Google-Sender-Auth: F6y2SILQQvLiuH_z4b_3rMeVS04 Message-ID: To: Attilio Rao Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, John Baldwin , "Jayachandran C." , svn-src-all@freebsd.org, Joe Landers , Randall Stewart , 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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 09 Aug 2010 06:12:31 -0000 On Sun, Aug 8, 2010 at 17:01, Attilio Rao 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.