From owner-svn-src-stable@FreeBSD.ORG Tue Jan 25 10:20:37 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 343AE106564A; Tue, 25 Jan 2011 10:20:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 232B58FC19; Tue, 25 Jan 2011 10:20:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PAKbvn025828; Tue, 25 Jan 2011 10:20:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PAKbdQ025826; Tue, 25 Jan 2011 10:20:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101251020.p0PAKbdQ025826@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 25 Jan 2011 10:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217818 - stable/8/sys/amd64/amd64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 10:20:37 -0000 Author: kib Date: Tue Jan 25 10:20:36 2011 New Revision: 217818 URL: http://svn.freebsd.org/changeset/base/217818 Log: MFC r217564: Make the length of the LDT a loader tunable, machdep.max_ldt_segment, and export it with read-only sysctl. Remove unused defines. MFC r217604: Use CTLFLAG_RDTUN for read-only sysctl that exports tunable. Modified: stable/8/sys/amd64/amd64/sys_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/sys_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/sys_machdep.c Tue Jan 25 10:17:37 2011 (r217817) +++ stable/8/sys/amd64/amd64/sys_machdep.c Tue Jan 25 10:20:36 2011 (r217818) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -58,9 +59,24 @@ __FBSDID("$FreeBSD$"); #include +#define MAX_LD 8192 + int max_ldt_segment = 1024; -#define LD_PER_PAGE 512 -#define NULL_LDT_BASE ((caddr_t)NULL) +SYSCTL_INT(_machdep, OID_AUTO, max_ldt_segment, CTLFLAG_RDTUN, + &max_ldt_segment, 0, + "Maximum number of allowed LDT segments in the single address space"); + +static void +max_ldt_segment_init(void *arg __unused) +{ + + TUNABLE_INT_FETCH("machdep.max_ldt_segment", &max_ldt_segment); + if (max_ldt_segment <= 0) + max_ldt_segment = 1; + if (max_ldt_segment > MAX_LD) + max_ldt_segment = MAX_LD; +} +SYSINIT(maxldt, SI_SUB_VM_CONF, SI_ORDER_ANY, max_ldt_segment_init, NULL); #ifdef notyet #ifdef SMP