From owner-svn-src-head@FreeBSD.ORG Tue Jul 19 16:50:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A75F1065670; Tue, 19 Jul 2011 16:50:56 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A6F38FC16; Tue, 19 Jul 2011 16:50:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6JGoulW080327; Tue, 19 Jul 2011 16:50:56 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6JGouiu080324; Tue, 19 Jul 2011 16:50:56 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201107191650.p6JGouiu080324@svn.freebsd.org> From: Attilio Rao Date: Tue, 19 Jul 2011 16:50:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224221 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2011 16:50:56 -0000 Author: attilio Date: Tue Jul 19 16:50:55 2011 New Revision: 224221 URL: http://svn.freebsd.org/changeset/base/224221 Log: Remove explicit MAXCPU usage from sys/pcpu.h avoiding a namespace pollution. That is a step further in the direction of building correct policies for userland and modules on how to deal with the number of maxcpus at runtime. Reported by: jhb Reviewed and tested by: pluknet Approved by: re (kib) Modified: head/sys/kern/sched_ule.c head/sys/sys/pcpu.h Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Tue Jul 19 15:24:44 2011 (r224220) +++ head/sys/kern/sched_ule.c Tue Jul 19 16:50:55 2011 (r224221) @@ -84,7 +84,7 @@ dtrace_vtime_switch_func_t dtrace_vtime_ #define TS_NAME_LEN (MAXCOMLEN + sizeof(" td ") + sizeof(__XSTRING(UINT_MAX))) #define TDQ_NAME_LEN (sizeof("sched lock ") + sizeof(__XSTRING(MAXCPU))) -#define TDQ_LOADNAME_LEN (PCPU_NAME_LEN + sizeof(" load")) +#define TDQ_LOADNAME_LEN (sizeof("CPU ") + sizeof(__XSTRING(MAXCPU)) - 1 + sizeof(" load")) /* * Thread scheduler specific section. All fields are protected Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Tue Jul 19 15:24:44 2011 (r224220) +++ head/sys/sys/pcpu.h Tue Jul 19 16:50:55 2011 (r224221) @@ -146,8 +146,6 @@ struct rm_queue { struct rm_queue* volatile rmq_prev; }; -#define PCPU_NAME_LEN (sizeof("CPU ") + sizeof(__XSTRING(MAXCPU)) - 1) - /* * This structure maps out the global data that needs to be kept on a * per-cpu basis. The members are accessed via the PCPU_GET/SET/PTR @@ -200,7 +198,7 @@ struct pcpu { STAILQ_HEAD(cpuhead, pcpu); extern struct cpuhead cpuhead; -extern struct pcpu *cpuid_to_pcpu[MAXCPU]; +extern struct pcpu *cpuid_to_pcpu[]; #define curcpu PCPU_GET(cpuid) #define curproc (curthread->td_proc)