From owner-freebsd-arch@FreeBSD.ORG Fri Jul 8 18:14:37 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8041106574C; Fri, 8 Jul 2011 18:14:37 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 690108FC1D; Fri, 8 Jul 2011 18:14:37 +0000 (UTC) Received: by gwb15 with SMTP id 15so1106996gwb.13 for ; Fri, 08 Jul 2011 11:14:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ns6jgb9B6q+63uZRLDL6s0s/ffbYQFMpbW99wU8R8Vg=; b=PZNofiG006j8tt9nysB9xabZd7JrpmhZsOSpcWcCcSPJKVYQXQ04GmY7vnxqeflfVR nheNYAV3XyzHEbPEJOcCcqehQiGHeAikmkfDj/yC9cBYHXilJ/9KmcjIUoweK4kJIayX ONE+raCgCPWxjwLyfzW5xvxKY1aRQyklZxwdA= MIME-Version: 1.0 Received: by 10.91.172.19 with SMTP id z19mr1620934ago.139.1310148876512; Fri, 08 Jul 2011 11:14:36 -0700 (PDT) Received: by 10.91.183.18 with HTTP; Fri, 8 Jul 2011 11:14:36 -0700 (PDT) In-Reply-To: References: <20110708164844.GZ48734@deviant.kiev.zoral.com.ua> <201107081314.44128.jhb@freebsd.org> Date: Fri, 8 Jul 2011 11:14:36 -0700 Message-ID: From: Peter Wemm To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Cc: Kostik Belousov , Attilio Rao , Sergey Kandaurov , freebsd-arch@freebsd.org Subject: Re: [PATCH] Add MAXCPU as a kernel config option and quality discussion on this X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2011 18:14:38 -0000 On Fri, Jul 8, 2011 at 10:56 AM, Peter Wemm wrote: > On Fri, Jul 8, 2011 at 10:14 AM, John Baldwin 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 to >>> > 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, but >>> > 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 MAXCPU #endif MAXCPU does have to be in opt_global.h and potentially affects kernel modules. -- 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