From owner-svn-src-all@freebsd.org Mon Sep 14 14:53:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5A153D8C02; Mon, 14 Sep 2020 14:53:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bqq9M5LSgz3XqP; Mon, 14 Sep 2020 14:53:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C25218B34; Mon, 14 Sep 2020 14:53:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08EErBPn098589; Mon, 14 Sep 2020 14:53:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08EEr9u4098580; Mon, 14 Sep 2020 14:53:09 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009141453.08EEr9u4098580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 14 Sep 2020 14:53:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r365722 - in releng/12.2: . contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc lib/libc/stdlib/jemalloc share/man/man5 share/mk tools/build/options X-SVN-Group: releng X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in releng/12.2: . contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc lib/libc/stdlib/jemalloc share/man/man5 share/mk tools/build/options X-SVN-Commit-Revision: 365722 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 14:53:11 -0000 Author: dim Date: Mon Sep 14 14:53:09 2020 New Revision: 365722 URL: https://svnweb.freebsd.org/changeset/base/365722 Log: MF12 r365662: MFC r365371: 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 Differential Revision: https://reviews.freebsd.org/D26337 MFC r365373: Follow-up r365371 by removing sentences which indicate the state of the MK_MALLOC_PRODUCTION option on -CURRENT. Also, for the sake of backwards compatibility, support the old way of enabling 'production malloc', e.g. by adding a define in make.conf(5). MF12 r365671: Follow-up r365662 (MFC of r365371 and r365373) by correctly setting WITH_MALLOC_PRODUCTION for stable branches. Also add a note to UPDATING, to inform users about the new setting. Direct commit to stable/{11,12} as this does not apply to head. Noticed by: imp, Ronald Klop MF12 r365672: Follow-up r365662 (MFC of r365371 and r365373) by also removing the header hack from jemalloc_FreeBSD.h, which rendered any make.conf MALLOC_PRODUCTION or src.conf WITH/WITHOUT_MALLOC_PRODUCTION irrelevant. Direct commit to stable/{11,12} as this does not apply to head. Noticed by: kevans Approved by: re (gjb) Added: releng/12.2/tools/build/options/WITHOUT_MALLOC_PRODUCTION - copied unchanged from r365662, stable/12/tools/build/options/WITHOUT_MALLOC_PRODUCTION releng/12.2/tools/build/options/WITH_MALLOC_PRODUCTION - copied unchanged from r365662, stable/12/tools/build/options/WITH_MALLOC_PRODUCTION Modified: releng/12.2/UPDATING releng/12.2/contrib/jemalloc/FREEBSD-diffs releng/12.2/contrib/jemalloc/doc/jemalloc.3 releng/12.2/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h releng/12.2/lib/libc/stdlib/jemalloc/Makefile.inc releng/12.2/share/man/man5/make.conf.5 releng/12.2/share/man/man5/src.conf.5 releng/12.2/share/mk/src.opts.mk Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/UPDATING ============================================================================== --- releng/12.2/UPDATING Mon Sep 14 14:52:22 2020 (r365721) +++ releng/12.2/UPDATING Mon Sep 14 14:53:09 2020 (r365722) @@ -16,6 +16,18 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20200912: + The make.conf(5) MALLOC_PRODUCTION variable, used for disabling and + enabling assertions and statistics gathering in malloc(3), has been + migrated to a src.conf(5) WITH/WITHOUT_MALLOC_PRODUCTION option. + + On stable branches, WITH_MALLOC_PRODUCTION is set by default, which + means that malloc(3) has assertions and statistics gathering disabled, + for improved performance. + + For backwards compatibility, the make.conf(5) MALLOC_PRODUCTION is still + honored, but it is now deprecated and undocumented. + 20200909: The resume code now notifies devd with the 'kernel' system rather than the old 'kern' subsystem to be consistent with Modified: releng/12.2/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- releng/12.2/contrib/jemalloc/FREEBSD-diffs Mon Sep 14 14:52:22 2020 (r365721) +++ releng/12.2/contrib/jemalloc/FREEBSD-diffs Mon Sep 14 14:53:09 2020 (r365722) @@ -14,7 +14,7 @@ index 1e12fd3a..c42a7e10 100644 + . + Additionally, is enabled in development + versions of FreeBSD (controlled by the -+ MALLOC_PRODUCTION make variable). ++ MK_MALLOC_PRODUCTION make variable). + Modified: releng/12.2/contrib/jemalloc/doc/jemalloc.3 ============================================================================== --- releng/12.2/contrib/jemalloc/doc/jemalloc.3 Mon Sep 14 14:52:22 2020 (r365721) +++ releng/12.2/contrib/jemalloc/doc/jemalloc.3 Mon Sep 14 14:53:09 2020 (r365722) @@ -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: releng/12.2/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h ============================================================================== --- releng/12.2/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Mon Sep 14 14:52:22 2020 (r365721) +++ releng/12.2/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Mon Sep 14 14:53:09 2020 (r365722) @@ -5,7 +5,7 @@ #undef JEMALLOC_OVERRIDE_VALLOC #ifndef MALLOC_PRODUCTION -#define MALLOC_PRODUCTION +#define JEMALLOC_DEBUG #endif #undef JEMALLOC_DSS Modified: releng/12.2/lib/libc/stdlib/jemalloc/Makefile.inc ============================================================================== --- releng/12.2/lib/libc/stdlib/jemalloc/Makefile.inc Mon Sep 14 14:52:22 2020 (r365721) +++ releng/12.2/lib/libc/stdlib/jemalloc/Makefile.inc Mon Sep 14 14:53:09 2020 (r365722) @@ -44,6 +44,6 @@ MLINKS+= \ jemalloc.3 nallocx.3 \ jemalloc.3 malloc.conf.5 -.if defined(MALLOC_PRODUCTION) +.if ${MK_MALLOC_PRODUCTION} != "no" || defined(MALLOC_PRODUCTION) CFLAGS+= -DMALLOC_PRODUCTION .endif Modified: releng/12.2/share/man/man5/make.conf.5 ============================================================================== --- releng/12.2/share/man/man5/make.conf.5 Mon Sep 14 14:52:22 2020 (r365721) +++ releng/12.2/share/man/man5/make.conf.5 Mon Sep 14 14:53:09 2020 (r365722) @@ -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: releng/12.2/share/man/man5/src.conf.5 ============================================================================== --- releng/12.2/share/man/man5/src.conf.5 Mon Sep 14 14:52:22 2020 (r365721) +++ releng/12.2/share/man/man5/src.conf.5 Mon Sep 14 14:53:09 2020 (r365722) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd April 9, 2020 +.Dd September 12, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1325,6 +1325,10 @@ if executed as an unprivileged user. See .Xr tests 7 for more details. +.It Va WITHOUT_MALLOC_PRODUCTION +Set to enable assertions and statistics gathering in +.Xr malloc 3 . +It also defaults the A and J runtime options to on. .It Va WITHOUT_MAN Set to not build manual pages. When set, these options are also in effect: Modified: releng/12.2/share/mk/src.opts.mk ============================================================================== --- releng/12.2/share/mk/src.opts.mk Mon Sep 14 14:52:22 2020 (r365721) +++ releng/12.2/share/mk/src.opts.mk Mon Sep 14 14:53:09 2020 (r365722) @@ -143,6 +143,7 @@ __DEFAULT_YES_OPTIONS = \ MAIL \ MAILWRAPPER \ MAKE \ + MALLOC_PRODUCTION \ NDIS \ NETCAT \ NETGRAPH \ Copied: releng/12.2/tools/build/options/WITHOUT_MALLOC_PRODUCTION (from r365662, stable/12/tools/build/options/WITHOUT_MALLOC_PRODUCTION) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/12.2/tools/build/options/WITHOUT_MALLOC_PRODUCTION Mon Sep 14 14:53:09 2020 (r365722, copy of r365662, stable/12/tools/build/options/WITHOUT_MALLOC_PRODUCTION) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to enable assertions and statistics gathering in +.Xr malloc 3 . +It also defaults the A and J runtime options to on. Copied: releng/12.2/tools/build/options/WITH_MALLOC_PRODUCTION (from r365662, stable/12/tools/build/options/WITH_MALLOC_PRODUCTION) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/12.2/tools/build/options/WITH_MALLOC_PRODUCTION Mon Sep 14 14:53:09 2020 (r365722, copy of r365662, stable/12/tools/build/options/WITH_MALLOC_PRODUCTION) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to disable assertions and statistics gathering in +.Xr malloc 3 . +It also defaults the A and J runtime options to off.