Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Sep 2020 23:30:18 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r365371 - in head: . contrib/jemalloc contrib/jemalloc/doc lib/libc/stdlib/jemalloc share/man/man5 share/mk tools/build/options
Message-ID:  <202009052330.085NUIwH085545@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Sat Sep  5 23:30:17 2020
New Revision: 365371
URL: https://svnweb.freebsd.org/changeset/base/365371

Log:
  Turn MALLOC_PRODUCTION into a regular src.conf(5) option
  
  For historical reasons, defining MALLOC_PRODUCTION in /etc/make.conf has
  been used to turn off potentially expensive debug checks and statistics
  gathering in the implementation of malloc(3).
  
  It seems more consistent to turn this into a regular src.conf(5) option,
  e.g. WITH_MALLOC_PRODUCTION / WITHOUT_MALLOC_PRODUCTION. This can then
  be toggled similar to any other source build option, and turned on or
  off by default for e.g. stable branches.
  
  Reviewed by:	imp, #manpages
  MFC after:	1 week
  Differential Revision: https://reviews.freebsd.org/D26337

Added:
  head/tools/build/options/WITHOUT_MALLOC_PRODUCTION   (contents, props changed)
  head/tools/build/options/WITH_MALLOC_PRODUCTION   (contents, props changed)
Modified:
  head/UPDATING
  head/contrib/jemalloc/FREEBSD-diffs
  head/contrib/jemalloc/doc/jemalloc.3
  head/lib/libc/stdlib/jemalloc/Makefile.inc
  head/share/man/man5/make.conf.5
  head/share/man/man5/src.conf.5
  head/share/mk/src.opts.mk

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Sat Sep  5 22:48:27 2020	(r365370)
+++ head/UPDATING	Sat Sep  5 23:30:17 2020	(r365371)
@@ -22,9 +22,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
 	debugging flags in userland, and various verbose features in the
 	kernel.  Many developers choose to disable these features on build
 	machines to maximize performance.  (To completely disable malloc
-	debugging, define MALLOC_PRODUCTION in /etc/make.conf, or to merely
-	disable the most expensive debugging functionality run
-	"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
+	debugging, define WITH_MALLOC_PRODUCTION in /etc/src.conf and rebuild
+	world, or to merely disable the most expensive debugging functionality
+	at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
 20200824:
 	OpenZFS support has been integrated. Do not upgrade root pools until

Modified: head/contrib/jemalloc/FREEBSD-diffs
==============================================================================
--- head/contrib/jemalloc/FREEBSD-diffs	Sat Sep  5 22:48:27 2020	(r365370)
+++ head/contrib/jemalloc/FREEBSD-diffs	Sat Sep  5 23:30:17 2020	(r365371)
@@ -14,7 +14,7 @@ index 7fecda7c..d5ca5e86 100644
 +    <option>--with-malloc-conf=abort_conf:false</option>.
 +    Additionally, <option>--enable-debug</option> is enabled in development
 +    versions of FreeBSD (controlled by the
-+    <constant>MALLOC_PRODUCTION</constant> make variable).</para>
++    <constant>MK_MALLOC_PRODUCTION</constant> make variable).</para>
 +
    </refsect1>
    <refsynopsisdiv>

Modified: head/contrib/jemalloc/doc/jemalloc.3
==============================================================================
--- head/contrib/jemalloc/doc/jemalloc.3	Sat Sep  5 22:48:27 2020	(r365370)
+++ head/contrib/jemalloc/doc/jemalloc.3	Sat Sep  5 23:30:17 2020	(r365371)
@@ -43,7 +43,7 @@ The following configuration options are enabled in lib
 \fB\-\-with\-malloc\-conf=abort_conf:false\fR\&. Additionally,
 \fB\-\-enable\-debug\fR
 is enabled in development versions of FreeBSD (controlled by the
-\fBMALLOC_PRODUCTION\fR
+\fBMK_MALLOC_PRODUCTION\fR
 make variable)\&.
 .SH "SYNOPSIS"
 .sp

Modified: head/lib/libc/stdlib/jemalloc/Makefile.inc
==============================================================================
--- head/lib/libc/stdlib/jemalloc/Makefile.inc	Sat Sep  5 22:48:27 2020	(r365370)
+++ head/lib/libc/stdlib/jemalloc/Makefile.inc	Sat Sep  5 23:30:17 2020	(r365371)
@@ -45,6 +45,6 @@ MLINKS+= \
 	jemalloc.3 nallocx.3 \
 	jemalloc.3 malloc.conf.5
 
-.if defined(MALLOC_PRODUCTION)
+.if ${MK_MALLOC_PRODUCTION} != "no"
 CFLAGS+=	-DMALLOC_PRODUCTION
 .endif

Modified: head/share/man/man5/make.conf.5
==============================================================================
--- head/share/man/man5/make.conf.5	Sat Sep  5 22:48:27 2020	(r365370)
+++ head/share/man/man5/make.conf.5	Sat Sep  5 23:30:17 2020	(r365371)
@@ -401,12 +401,6 @@ console driver to
 and allow access over FireWire(IEEE1394) using
 .Xr dconschat 8 .
 Currently, only i386 and amd64 are supported.
-.It Va MALLOC_PRODUCTION
-.Pq Vt bool
-Set this to disable assertions and statistics gathering in
-.Xr malloc 3 .
-It also defaults the A and J runtime options to off.
-Disabled by default on -CURRENT.
 .It Va MAN_ARCH
 .Pq Vt str
 Space-delimited list of one or more MACHINE and/or MACHINE_ARCH values

Modified: head/share/man/man5/src.conf.5
==============================================================================
--- head/share/man/man5/src.conf.5	Sat Sep  5 22:48:27 2020	(r365370)
+++ head/share/man/man5/src.conf.5	Sat Sep  5 23:30:17 2020	(r365371)
@@ -1,6 +1,6 @@
 .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
 .\" $FreeBSD$
-.Dd July 6, 2020
+.Dd September 5, 2020
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -1104,6 +1104,11 @@ if executed as an unprivileged user.
 See
 .Xr tests 7
 for more details.
+.It Va WITH_MALLOC_PRODUCTION
+Set to disable assertions and statistics gathering in
+.Xr malloc 3 .
+It also defaults the A and J runtime options to off.
+Disabled by default on -CURRENT.
 .It Va WITHOUT_MAN
 Set to not build manual pages.
 When set, these options are also in effect:
@@ -1278,12 +1283,12 @@ Enable building openldap support for kerberos.
 Set to not build LLVM's OpenMP runtime.
 .Pp
 This is a default setting on
-arm/armv6, arm/armv7, arm64/aarch64, mips/mips, mips/mips64, powerpc/powerpc, riscv/riscv64 and riscv/riscv64sf.
+arm/armv6, arm/armv7, mips/mips, mips/mips64, powerpc/powerpc, riscv/riscv64 and riscv/riscv64sf.
 .It Va WITH_OPENMP
 Set to build LLVM's OpenMP runtime.
 .Pp
 This is a default setting on
-amd64/amd64, i386/i386 and powerpc/powerpc64.
+amd64/amd64, arm64/aarch64, i386/i386 and powerpc/powerpc64.
 .It Va WITHOUT_OPENSSH
 Set to not build OpenSSH.
 .It Va WITHOUT_OPENSSL

Modified: head/share/mk/src.opts.mk
==============================================================================
--- head/share/mk/src.opts.mk	Sat Sep  5 22:48:27 2020	(r365370)
+++ head/share/mk/src.opts.mk	Sat Sep  5 23:30:17 2020	(r365371)
@@ -213,6 +213,7 @@ __DEFAULT_NO_OPTIONS = \
     LOADER_FORCE_LE \
     LOADER_VERBOSE \
     LOADER_VERIEXEC_PASS_MANIFEST \
+    MALLOC_PRODUCTION \
     OFED_EXTRA \
     OPENLDAP \
     REPRODUCIBLE_BUILD \

Added: head/tools/build/options/WITHOUT_MALLOC_PRODUCTION
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/build/options/WITHOUT_MALLOC_PRODUCTION	Sat Sep  5 23:30:17 2020	(r365371)
@@ -0,0 +1,5 @@
+.\" $FreeBSD$
+Set to enable assertions and statistics gathering in
+.Xr malloc 3 .
+It also defaults the A and J runtime options to on.
+Enabled by default on -CURRENT.

Added: head/tools/build/options/WITH_MALLOC_PRODUCTION
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/build/options/WITH_MALLOC_PRODUCTION	Sat Sep  5 23:30:17 2020	(r365371)
@@ -0,0 +1,5 @@
+.\" $FreeBSD$
+Set to disable assertions and statistics gathering in
+.Xr malloc 3 .
+It also defaults the A and J runtime options to off.
+Disabled by default on -CURRENT.



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