From owner-svn-src-all@FreeBSD.ORG Thu Jun 28 02:21:47 2012 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 30BB3106566B; Thu, 28 Jun 2012 02:21:47 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7516A8FC16; Thu, 28 Jun 2012 02:21:46 +0000 (UTC) Received: by vbmv11 with SMTP id v11so1439372vbm.13 for ; Wed, 27 Jun 2012 19:21:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=FH3CysvK5j3+PgKdeGNPwpb67nRbGLfuGVUZ4D0yvlg=; b=ppmDC8wOZDPmDeOZzuemi0muKnqDubP9NqIPYa2zeSLmy+PE5tif5FlT/5CGubbQmH ek11ABE43pExTCiLoYp5DgooAdkIQm9OjqpuFzIbIZjhNchnEWArCtS3T8AsoHADuQau /5V0yhUpd1QCAhcIES1e5EFpw90MFziJX2Tomlqc6iLfVWhvhLuhHq9DvG1BDoHY5ygb GutAmu7KBZLkfMBCitw+Y5FvHO8RGXSqSTad4rUp4RLbWfK+f3DkvzIKVUaGQAKE9JdQ nCXPQuxbZ2IXccfXYhsnm4hud5Lv01JUNrNbSSv2WHSMJBUH5vQeVXrobIs7mjs7wQh1 aU/g== MIME-Version: 1.0 Received: by 10.52.97.230 with SMTP id ed6mr63724vdb.65.1340850105663; Wed, 27 Jun 2012 19:21:45 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.220.36.193 with HTTP; Wed, 27 Jun 2012 19:21:45 -0700 (PDT) In-Reply-To: <4FEBB8C9.8070006@gmail.com> References: <201206272032.q5RKWjvt031174@svn.freebsd.org> <4FEBB8C9.8070006@gmail.com> Date: Thu, 28 Jun 2012 03:21:45 +0100 X-Google-Sender-Auth: BES44ClnC_Vv_GOBUWTDEpcruK8 Message-ID: From: Attilio Rao To: davidxu@freebsd.org Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov Subject: Re: svn commit: r237660 - head/lib/libc/gen 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: Thu, 28 Jun 2012 02:21:47 -0000 2012/6/28, David Xu : > On 2012/6/28 4:32, Konstantin Belousov wrote: >> Author: kib >> Date: Wed Jun 27 20:32:45 2012 >> New Revision: 237660 >> URL: http://svn.freebsd.org/changeset/base/237660 >> >> Log: >> Optimize the handling of SC_NPROCESSORS_CONF, by using auxv AT_NCPU >> value if present. >> >> MFC after: 1 week >> >> Modified: >> head/lib/libc/gen/sysconf.c >> >> Modified: head/lib/libc/gen/sysconf.c >> ============================================================================== >> --- head/lib/libc/gen/sysconf.c Wed Jun 27 20:24:25 2012 (r237659) >> +++ head/lib/libc/gen/sysconf.c Wed Jun 27 20:32:45 2012 (r237660) >> @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> >> +#include >> #include >> #include >> #include >> @@ -51,6 +52,7 @@ __FBSDID("$FreeBSD$"); >> >> #include "../stdlib/atexit.h" >> #include "tzfile.h" /* from ../../../contrib/tzcode/stdtime */ >> +#include "libc_private.h" >> >> #define _PATH_ZONEINFO TZDIR /* from tzfile.h */ >> >> @@ -585,6 +587,8 @@ yesno: >> >> case _SC_NPROCESSORS_CONF: >> case _SC_NPROCESSORS_ONLN: >> + if (_elf_aux_info(AT_NCPUS,&value, sizeof(value)) == 0) >> + return ((long)value); >> mib[0] = CTL_HW; >> mib[1] = HW_NCPU; >> break; >> > Will this make controlling the number of CPU online or CPU hotplug > be impossible on FreeBSD ? If I think about hotplug CPUs I can think of other 1000 problems/races/bad situations to be fixed before this one, really. Attilio -- Peace can only be achieved by understanding - A. Einstein