From owner-freebsd-current@FreeBSD.ORG Thu Apr 10 00:33:26 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 487D937B401 for ; Thu, 10 Apr 2003 00:33:26 -0700 (PDT) Received: from rwcrmhc52.attbi.com (rwcrmhc52.attbi.com [216.148.227.88]) by mx1.FreeBSD.org (Postfix) with ESMTP id D917243F3F for ; Thu, 10 Apr 2003 00:33:25 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org (12-232-168-4.client.attbi.com[12.232.168.4]) by rwcrmhc52.attbi.com (rwcrmhc52) with ESMTP id <2003041007332505200lhclce>; Thu, 10 Apr 2003 07:33:25 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id AAA85901 for ; Thu, 10 Apr 2003 00:33:24 -0700 (PDT) Date: Thu, 10 Apr 2003 00:33:23 -0700 (PDT) From: Julian Elischer To: FreeBSD current users In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: variable mp_ncpu X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2003 07:33:26 -0000 On Thu, 10 Apr 2003, Julian Elischer wrote: > > Would it be possible to have the sysclt hw.ncpu > always available, even in a UP kernel? I meant "to a kernel routine" > > it is currently only valid in an SMP kernel > whichmeans that userland code that needs to know this has to do: ok It's too late at night.. hw.ncpu does exist in UP what I really meant to say is: could there always be the kernel variable mp_ncpus? for example the following code is in the kernel: 605 /* Too bad, why hasn't kernel always a cpu counter !? */ 606 #ifdef SMP 607 ncpus = mp_ncpus; 608 #else 609 ncpus = 1; 610 #endif ok, so maybe it would need to be renamed, but at teh moment I need to have 2 kernel modules, one for SMP and one for UP to be able to cope with this if it needs to know how many cpus there are.. (or am I missing something still)