Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Oct 2017 10:35:30 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r324857 - in head: lib/libc/gen sys/vm
Message-ID:  <201710221035.v9MAZUki094587@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Sun Oct 22 10:35:29 2017
New Revision: 324857
URL: https://svnweb.freebsd.org/changeset/base/324857

Log:
  Add OID for the vm.overcommit sysctl. This makes it possible to remove
  one call to sysctl(2) from jemalloc startup code. (That also requires
  changes to jemalloc, but I plan to push those to upstream first.)
  
  Reviewed by:	kib
  MFC after:	2 weeks
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D12745

Modified:
  head/lib/libc/gen/sysctl.3
  head/sys/vm/swap_pager.c
  head/sys/vm/vm_param.h

Modified: head/lib/libc/gen/sysctl.3
==============================================================================
--- head/lib/libc/gen/sysctl.3	Sun Oct 22 10:32:40 2017	(r324856)
+++ head/lib/libc/gen/sysctl.3	Sun Oct 22 10:35:29 2017	(r324857)
@@ -28,7 +28,7 @@
 .\"	@(#)sysctl.3	8.4 (Berkeley) 5/9/95
 .\" $FreeBSD$
 .\"
-.Dd September 10, 2015
+.Dd October 22, 2017
 .Dt SYSCTL 3
 .Os
 .Sh NAME
@@ -741,6 +741,7 @@ privilege may change the value.
 .It Dv VM_V_FREE_TARGET Ta integer Ta yes
 .It Dv VM_V_INACTIVE_TARGET Ta integer Ta yes
 .It Dv VM_V_PAGEOUT_FREE_MIN Ta integer Ta yes
+.It Dv VM_OVERCOMMIT Ta integer Ta yes
 .El
 .Bl -tag -width 6n
 .It Li VM_LOADAVG
@@ -773,6 +774,9 @@ process address space when needed.
 .It Li VM_V_PAGEOUT_FREE_MIN
 If the amount of free and cache memory falls below this value, the
 pageout daemon will enter "memory conserving mode" to avoid deadlock.
+.It Li VM_OVERCOMMIT
+Overcommit behaviour, as described in
+.Xr tuning 7 .
 .El
 .Sh RETURN VALUES
 .Rv -std

Modified: head/sys/vm/swap_pager.c
==============================================================================
--- head/sys/vm/swap_pager.c	Sun Oct 22 10:32:40 2017	(r324856)
+++ head/sys/vm/swap_pager.c	Sun Oct 22 10:35:29 2017	(r324857)
@@ -157,7 +157,7 @@ static vm_ooffset_t swap_reserved;
 SYSCTL_QUAD(_vm, OID_AUTO, swap_reserved, CTLFLAG_RD, &swap_reserved, 0,
     "Amount of swap storage needed to back all allocated anonymous memory.");
 static int overcommit = 0;
-SYSCTL_INT(_vm, OID_AUTO, overcommit, CTLFLAG_RW, &overcommit, 0,
+SYSCTL_INT(_vm, VM_OVERCOMMIT, overcommit, CTLFLAG_RW, &overcommit, 0,
     "Configure virtual memory overcommit behavior. See tuning(7) "
     "for details.");
 static unsigned long swzone;

Modified: head/sys/vm/vm_param.h
==============================================================================
--- head/sys/vm/vm_param.h	Sun Oct 22 10:32:40 2017	(r324856)
+++ head/sys/vm/vm_param.h	Sun Oct 22 10:35:29 2017	(r324857)
@@ -84,7 +84,8 @@
 #define VM_V_PAGEOUT_FREE_MIN	9	/* vm_cnt.v_pageout_free_min */
 #define	VM_OBSOLETE_10		10	/* pageout algorithm */
 #define VM_SWAPPING_ENABLED	11	/* swapping enabled */
-#define	VM_MAXID		12	/* number of valid vm ids */
+#define VM_OVERCOMMIT		12	/* vm.overcommit */
+#define	VM_MAXID		13	/* number of valid vm ids */
 
 /*
  * Structure for swap device statistics



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201710221035.v9MAZUki094587>