Re: svn commit: r365371 - in head: . contrib/jemalloc contrib/jemalloc/doc lib/libc/stdlib/jemalloc share/man/man5 share/mk tools/build/options

2020-09-05 Thread John Baldwin
On 9/5/20 4:30 PM, Dimitry Andric wrote:
> 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
>   
> 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_PRODUCTIONSat 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.

I think this last sentence doesn't quite read correctly.  That is,
I read it as saying that "assertions and statistics gathering" is
disabled by default on -CURRENT, which isn't correct.  It also
won't be very meaningful to someone reading src.conf.5 on a stable
branch if this is MFC'd (or when it ends up in stable/13).

I think it would be best to just leave the last sentence
off completely.  The result would be that on head src.conf(5) would
say:

WITH_MALLOC_PRODUCTION

   Set to disable assertions...

And on stable src.conf(5) would say:

WITHOUT_MALLOC_PRODUCTION

   Set to enable assertions...

Just as when other defaults change across branches, the current vs
stable different is handled by the contents of src.conf.5 on each
branch.

-- 
John Baldwin
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r365371 - in head: . contrib/jemalloc contrib/jemalloc/doc lib/libc/stdlib/jemalloc share/man/man5 share/mk tools/build/options

2020-09-05 Thread Dimitry Andric
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
 +--with-malloc-conf=abort_conf:false.
 +Additionally, --enable-debug is enabled in development
 +versions of FreeBSD (controlled by the
-+MALLOC_PRODUCTION make variable).
++MK_MALLOC_PRODUCTION make variable).
 +



Modified: head/contrib/jemalloc/doc/jemalloc.3
==
--- head/contrib/jemalloc/doc/jemalloc.3Sat Sep  5 22:48:27 2020
(r365370)
+++ head/contrib/jemalloc/doc/jemalloc.3Sat 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)