Date: Fri, 8 Jul 2011 11:22:37 -0700 From: Peter Wemm <peter@wemm.org> To: John Baldwin <jhb@freebsd.org> Cc: Kostik Belousov <kostikbel@gmail.com>, Attilio Rao <attilio@freebsd.org>, Sergey Kandaurov <pluknet@freebsd.org>, freebsd-arch@freebsd.org Subject: Re: [PATCH] Add MAXCPU as a kernel config option and quality discussion on this Message-ID: <CAGE5yCqW97%2BqoF=tXQo53sEx5v30k3Q6ng54LJdK_meP75Uk3Q@mail.gmail.com> In-Reply-To: <CAGE5yCq1B7LZgQOAV2FjNF6kBoGUf_ug7FdpEO3jb%2Berj73CvA@mail.gmail.com> References: <CAJ-FndDZu0cBrVbH3W%2B8Tj86T5h%2BwwWqUVnjJO1rtXopKodNOA@mail.gmail.com> <20110708164844.GZ48734@deviant.kiev.zoral.com.ua> <201107081314.44128.jhb@freebsd.org> <CAGE5yCocUvyyNzsMPO8vB4QrBdYEzM=%2BpkPCq8gBHEPu3ypjzA@mail.gmail.com> <CAGE5yCq1B7LZgQOAV2FjNF6kBoGUf_ug7FdpEO3jb%2Berj73CvA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jul 8, 2011 at 11:14 AM, Peter Wemm <peter@wemm.org> wrote: > On Fri, Jul 8, 2011 at 10:56 AM, Peter Wemm <peter@wemm.org> wrote: >> On Fri, Jul 8, 2011 at 10:14 AM, John Baldwin <jhb@freebsd.org> wrote: >>> On Friday, July 08, 2011 12:48:44 pm Kostik Belousov wrote: >>>> On Fri, Jul 08, 2011 at 05:37:17PM +0200, Attilio Rao wrote: >>>> > I've made this patch for making MAXCPU a kernel config option: >>>> > http://www.freebsd.org/~attilio/maxcpu_kernel_opt.diff >>>> > >>>> > Besides if this is a good idea or not (which I think it is) I want t= o >>>> > discuss this implementation and similar related problems. >>>> > In this case I've been forced to include opt_maxcpu.h in all the MD >>>> > param.h implementations. A similar case, KSTACK_PAGES, includes the >>>> > opt_kstack_pages.h only in the consumers. While this is possible for >>>> > KSTACK_PAGES, because there are very little consumers, it would be >>>> > impratical for MAXCPU. Besides, this is a very dangerous practice >>>> > IMHO: if a consumer fails to add opt_kstack_pages it may end up with= a >>>> > faulty value, introducing a breakage that would go unnoticed. >>>> > >>>> > In my case, I think that including opt_maxcpu is a viable panacea, b= ut >>>> > in general, after discussing with peter@, probabilly the better idea >>>> > would be having a centralized script that does pre-processing before >>>> > to start compiling and set with the right values all those constants >>>> > (something like genassym.c, but of course with a different purpose). >>>> > >>>> > What are your ideas on that? Do you think that including opt_maxcpu.= h >>>> > would be acceptable for the time being? >>>> >>>> I vote for putting MAXCPU in opt_global.h. >>>> Why did you choosed separate opt header ? >>> >>> I agree this should just go into opt_global.h. >> >> I disagree. That makes it even harder to track down KLD's that depend >> on the correct value of MAXCPU. > > Ahh crap. I forgot about this: > #ifdef _KERNEL > #define CPU_SETSIZE =A0 =A0 MAXCPU > #endif > > MAXCPU does have to be in opt_global.h and potentially affects kernel mod= ules. Yes, having a default value for sizing cpuset_t does look harmful if a kld module tries to use them. What is currently in the tree will silently fail by successfully compiling for kld modules that try to use anything affected by that. --=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGE5yCqW97%2BqoF=tXQo53sEx5v30k3Q6ng54LJdK_meP75Uk3Q>
