From owner-svn-src-stable@FreeBSD.ORG Mon May 12 20:48:05 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A39AEA35; Mon, 12 May 2014 20:48:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75C5B2E63; Mon, 12 May 2014 20:48:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4CKm5vJ046619; Mon, 12 May 2014 20:48:05 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CKm592046618; Mon, 12 May 2014 20:48:05 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201405122048.s4CKm592046618@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 12 May 2014 20:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265932 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18 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: Mon, 12 May 2014 20:48:05 -0000 Author: des Date: Mon May 12 20:48:04 2014 New Revision: 265932 URL: http://svnweb.freebsd.org/changeset/base/265932 Log: MFH (r264966): add sysctl OIDs for actual swap zone size and capacity Modified: stable/10/sys/vm/swap_pager.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/swap_pager.c ============================================================================== --- stable/10/sys/vm/swap_pager.c Mon May 12 20:22:42 2014 (r265931) +++ stable/10/sys/vm/swap_pager.c Mon May 12 20:48:04 2014 (r265932) @@ -164,6 +164,12 @@ static int overcommit = 0; SYSCTL_INT(_vm, OID_AUTO, overcommit, CTLFLAG_RW, &overcommit, 0, "Configure virtual memory overcommit behavior. See tuning(7) " "for details."); +static unsigned long swzone; +SYSCTL_ULONG(_vm, OID_AUTO, swzone, CTLFLAG_RD, &swzone, 0, + "Actual size of swap metadata zone"); +static unsigned long swap_maxpages; +SYSCTL_ULONG(_vm, OID_AUTO, swap_maxpages, CTLFLAG_RD, &swap_maxpages, 0, + "Maximum amount of swap supported"); /* bits from overcommit */ #define SWAP_RESERVE_FORCE_ON (1 << 0) @@ -506,7 +512,7 @@ swap_pager_init(void) void swap_pager_swap_init(void) { - int n, n2; + unsigned long n, n2; /* * Number of in-transit swap bp operations. Don't @@ -542,7 +548,7 @@ swap_pager_swap_init(void) /* * Initialize our zone. Right now I'm just guessing on the number * we need based on the number of pages in the system. Each swblock - * can hold 16 pages, so this is probably overkill. This reservation + * can hold 32 pages, so this is probably overkill. This reservation * is typically limited to around 32MB by default. */ n = cnt.v_page_count / 2; @@ -563,7 +569,9 @@ swap_pager_swap_init(void) n -= ((n + 2) / 3); } while (n > 0); if (n2 != n) - printf("Swap zone entries reduced from %d to %d.\n", n2, n); + printf("Swap zone entries reduced from %lu to %lu.\n", n2, n); + swap_maxpages = n * SWAP_META_PAGES; + swzone = n * sizeof(struct swblock); n2 = n; /*