On Sun, Aug 8, 2010 at 17:01, Attilio Rao <atti...@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. _______________________________________________ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"