svn commit: r354606 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src lib/libc/stdlib/jemalloc

2019-11-10 Thread Jason Evans
/jemalloc/internal/ticker.h
  head/contrib/jemalloc/include/jemalloc/internal/tsd.h
  head/contrib/jemalloc/include/jemalloc/internal/tsd_generic.h
  head/contrib/jemalloc/include/jemalloc/internal/tsd_malloc_thread_cleanup.h
  head/contrib/jemalloc/include/jemalloc/internal/tsd_tls.h
  head/contrib/jemalloc/include/jemalloc/internal/witness.h
  head/contrib/jemalloc/include/jemalloc/jemalloc.h
  head/contrib/jemalloc/src/arena.c
  head/contrib/jemalloc/src/background_thread.c
  head/contrib/jemalloc/src/base.c
  head/contrib/jemalloc/src/bin.c
  head/contrib/jemalloc/src/ckh.c
  head/contrib/jemalloc/src/ctl.c
  head/contrib/jemalloc/src/extent.c
  head/contrib/jemalloc/src/extent_dss.c
  head/contrib/jemalloc/src/extent_mmap.c
  head/contrib/jemalloc/src/jemalloc.c
  head/contrib/jemalloc/src/large.c
  head/contrib/jemalloc/src/malloc_io.c
  head/contrib/jemalloc/src/mutex.c
  head/contrib/jemalloc/src/pages.c
  head/contrib/jemalloc/src/prof.c
  head/contrib/jemalloc/src/rtree.c
  head/contrib/jemalloc/src/stats.c
  head/contrib/jemalloc/src/sz.c
  head/contrib/jemalloc/src/tcache.c
  head/contrib/jemalloc/src/tsd.c
  head/lib/libc/stdlib/jemalloc/Makefile.inc

Modified: head/contrib/jemalloc/COPYING
==
--- head/contrib/jemalloc/COPYING   Mon Nov 11 03:27:14 2019
(r354605)
+++ head/contrib/jemalloc/COPYING   Mon Nov 11 05:06:49 2019
(r354606)
@@ -1,10 +1,10 @@
 Unless otherwise specified, files in the jemalloc source distribution are
 subject to the following license:
 

-Copyright (C) 2002-present Jason Evans .
+Copyright (C) 2002-2018 Jason Evans .
 All rights reserved.
 Copyright (C) 2007-2012 Mozilla Foundation.  All rights reserved.
-Copyright (C) 2009-present Facebook, Inc.  All rights reserved.
+Copyright (C) 2009-2018 Facebook, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:

Modified: head/contrib/jemalloc/ChangeLog
==
--- head/contrib/jemalloc/ChangeLog Mon Nov 11 03:27:14 2019
(r354605)
+++ head/contrib/jemalloc/ChangeLog Mon Nov 11 05:06:49 2019
(r354606)
@@ -4,143 +4,7 @@ brevity.  Much more detail can be found in the git rev
 
 https://github.com/jemalloc/jemalloc
 
-* 5.2.1 (August 5, 2019)
-
-  This release is primarily about Windows.  A critical virtual memory leak is
-  resolved on all Windows platforms.  The regression was present in all 
releases
-  since 5.0.0.
-
-  Bug fixes:
-  - Fix a severe virtual memory leak on Windows.  This regression was first
-released in 5.0.0.  (@Ignition, @j0t, @frederik-h, @davidtgoldblatt,
-@interwq)
-  - Fix size 0 handling in posix_memalign().  This regression was first 
released
-in 5.2.0.  (@interwq)
-  - Fix the prof_log unit test which may observe unexpected backtraces from
-compiler optimizations.  The test was first added in 5.2.0.  (@marxin,
-@gnzlbg, @interwq)
-  - Fix the declaration of the extent_avail tree.  This regression was first
-released in 5.1.0.  (@zoulasc)
-  - Fix an incorrect reference in jeprof.  This functionality was first 
released
-in 3.0.0.  (@prehistoric-penguin)
-  - Fix an assertion on the deallocation fast-path.  This regression was first
-released in 5.2.0.  (@yinan1048576)
-  - Fix the TLS_MODEL attribute in headers.  This regression was first released
-in 5.0.0.  (@zoulasc, @interwq)
-
-  Optimizations and refactors:
-  - Implement opt.retain on Windows and enable by default on 64-bit.  
(@interwq,
-@davidtgoldblatt)
-  - Optimize away a branch on the operator delete[] path.  (@mgrice)
-  - Add format annotation to the format generator function.  (@zoulasc)
-  - Refactor and improve the size class header generation.  (@yinan1048576)
-  - Remove best fit.  (@djwatson)
-  - Avoid blocking on background thread locks for stats.  (@oranagra, @interwq)
-
-* 5.2.0 (April 2, 2019)
-
-  This release includes a few notable improvements, which are summarized below:
-  1) improved fast-path performance from the optimizations by @djwatson; 2)
-  reduced virtual memory fragmentation and metadata usage; and 3) bug fixes on
-  setting the number of background threads.  In addition, peak / spike memory
-  usage is improved with certain allocation patterns.  As usual, the release 
and
-  prior dev versions have gone through large-scale production testing.
-
-  New features:
-  - Implement oversize_threshold, which uses a dedicated arena for allocations
-crossing the specified threshold to reduce fragmentation.  (@interwq)
-  - Add extents usage information to stats.  (@tyleretzel)
-  - Log time information for sampled allocations.  (@tyleretzel)
-  - Support 0 size in sdallocx.  (@djwatson

svn commit: r354605 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src lib/libc/stdlib/jemalloc

2019-11-10 Thread Jason Evans
/include/jemalloc/internal/ticker.h
  head/contrib/jemalloc/include/jemalloc/internal/tsd.h
  head/contrib/jemalloc/include/jemalloc/internal/tsd_generic.h
  head/contrib/jemalloc/include/jemalloc/internal/tsd_malloc_thread_cleanup.h
  head/contrib/jemalloc/include/jemalloc/internal/tsd_tls.h
  head/contrib/jemalloc/include/jemalloc/internal/witness.h
  head/contrib/jemalloc/include/jemalloc/jemalloc.h
  head/contrib/jemalloc/src/arena.c
  head/contrib/jemalloc/src/background_thread.c
  head/contrib/jemalloc/src/base.c
  head/contrib/jemalloc/src/bin.c
  head/contrib/jemalloc/src/ckh.c
  head/contrib/jemalloc/src/ctl.c
  head/contrib/jemalloc/src/extent.c
  head/contrib/jemalloc/src/extent_dss.c
  head/contrib/jemalloc/src/extent_mmap.c
  head/contrib/jemalloc/src/jemalloc.c
  head/contrib/jemalloc/src/large.c
  head/contrib/jemalloc/src/malloc_io.c
  head/contrib/jemalloc/src/mutex.c
  head/contrib/jemalloc/src/pages.c
  head/contrib/jemalloc/src/prof.c
  head/contrib/jemalloc/src/rtree.c
  head/contrib/jemalloc/src/stats.c
  head/contrib/jemalloc/src/sz.c
  head/contrib/jemalloc/src/tcache.c
  head/contrib/jemalloc/src/tsd.c
  head/lib/libc/stdlib/jemalloc/Makefile.inc

Modified: head/contrib/jemalloc/COPYING
==
--- head/contrib/jemalloc/COPYING   Mon Nov 11 01:39:06 2019
(r354604)
+++ head/contrib/jemalloc/COPYING   Mon Nov 11 03:27:14 2019
(r354605)
@@ -1,10 +1,10 @@
 Unless otherwise specified, files in the jemalloc source distribution are
 subject to the following license:
 

-Copyright (C) 2002-2018 Jason Evans .
+Copyright (C) 2002-present Jason Evans .
 All rights reserved.
 Copyright (C) 2007-2012 Mozilla Foundation.  All rights reserved.
-Copyright (C) 2009-2018 Facebook, Inc.  All rights reserved.
+Copyright (C) 2009-present Facebook, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:

Modified: head/contrib/jemalloc/ChangeLog
==
--- head/contrib/jemalloc/ChangeLog Mon Nov 11 01:39:06 2019
(r354604)
+++ head/contrib/jemalloc/ChangeLog Mon Nov 11 03:27:14 2019
(r354605)
@@ -4,7 +4,143 @@ brevity.  Much more detail can be found in the git rev
 
 https://github.com/jemalloc/jemalloc
 
-* 5.1.0 (May 4th, 2018)
+* 5.2.1 (August 5, 2019)
+
+  This release is primarily about Windows.  A critical virtual memory leak is
+  resolved on all Windows platforms.  The regression was present in all 
releases
+  since 5.0.0.
+
+  Bug fixes:
+  - Fix a severe virtual memory leak on Windows.  This regression was first
+released in 5.0.0.  (@Ignition, @j0t, @frederik-h, @davidtgoldblatt,
+@interwq)
+  - Fix size 0 handling in posix_memalign().  This regression was first 
released
+in 5.2.0.  (@interwq)
+  - Fix the prof_log unit test which may observe unexpected backtraces from
+compiler optimizations.  The test was first added in 5.2.0.  (@marxin,
+@gnzlbg, @interwq)
+  - Fix the declaration of the extent_avail tree.  This regression was first
+released in 5.1.0.  (@zoulasc)
+  - Fix an incorrect reference in jeprof.  This functionality was first 
released
+in 3.0.0.  (@prehistoric-penguin)
+  - Fix an assertion on the deallocation fast-path.  This regression was first
+released in 5.2.0.  (@yinan1048576)
+  - Fix the TLS_MODEL attribute in headers.  This regression was first released
+in 5.0.0.  (@zoulasc, @interwq)
+
+  Optimizations and refactors:
+  - Implement opt.retain on Windows and enable by default on 64-bit.  
(@interwq,
+@davidtgoldblatt)
+  - Optimize away a branch on the operator delete[] path.  (@mgrice)
+  - Add format annotation to the format generator function.  (@zoulasc)
+  - Refactor and improve the size class header generation.  (@yinan1048576)
+  - Remove best fit.  (@djwatson)
+  - Avoid blocking on background thread locks for stats.  (@oranagra, @interwq)
+
+* 5.2.0 (April 2, 2019)
+
+  This release includes a few notable improvements, which are summarized below:
+  1) improved fast-path performance from the optimizations by @djwatson; 2)
+  reduced virtual memory fragmentation and metadata usage; and 3) bug fixes on
+  setting the number of background threads.  In addition, peak / spike memory
+  usage is improved with certain allocation patterns.  As usual, the release 
and
+  prior dev versions have gone through large-scale production testing.
+
+  New features:
+  - Implement oversize_threshold, which uses a dedicated arena for allocations
+crossing the specified threshold to reduce fragmentation.  (@interwq)
+  - Add extents usage information to stats.  (@tyleretzel)
+  - Log time information for sampled allocations.  (@tyleretzel)
+  - Support 0

svn commit: r333477 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src lib/libc/stdlib/jemalloc

2018-05-10 Thread Jason Evans
/COPYING   Fri May 11 00:32:31 2018
(r333477)
@@ -1,10 +1,10 @@
 Unless otherwise specified, files in the jemalloc source distribution are
 subject to the following license:
 

-Copyright (C) 2002-2017 Jason Evans <jas...@canonware.com>.
+Copyright (C) 2002-2018 Jason Evans <jas...@canonware.com>.
 All rights reserved.
 Copyright (C) 2007-2012 Mozilla Foundation.  All rights reserved.
-Copyright (C) 2009-2017 Facebook, Inc.  All rights reserved.
+Copyright (C) 2009-2018 Facebook, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:

Modified: head/contrib/jemalloc/ChangeLog
==
--- head/contrib/jemalloc/ChangeLog Fri May 11 00:19:49 2018
(r333476)
+++ head/contrib/jemalloc/ChangeLog Fri May 11 00:32:31 2018
(r333477)
@@ -4,6 +4,123 @@ brevity.  Much more detail can be found in the git rev
 
 https://github.com/jemalloc/jemalloc
 
+* 5.1.0 (May 4th, 2018)
+
+  This release is primarily about fine-tuning, ranging from several new 
features
+  to numerous notable performance and portability enhancements.  The release 
and
+  prior dev versions have been running in multiple large scale applications for
+  months, and the cumulative improvements are substantial in many cases.
+
+  Given the long and successful production runs, this release is likely a good
+  candidate for applications to upgrade, from both jemalloc 5.0 and before.  
For
+  performance-critical applications, the newly added TUNING.md provides
+  guidelines on jemalloc tuning.
+
+  New features:
+  - Implement transparent huge page support for internal metadata.  (@interwq)
+  - Add opt.thp to allow enabling / disabling transparent huge pages for all
+mappings.  (@interwq)
+  - Add maximum background thread count option.  (@djwatson)
+  - Allow prof_active to control opt.lg_prof_interval and prof.gdump.
+(@interwq)
+  - Allow arena index lookup based on allocation addresses via mallctl.
+(@lionkov)
+  - Allow disabling initial-exec TLS model.  (@davidtgoldblatt, @KenMacD)
+  - Add opt.lg_extent_max_active_fit to set the max ratio between the size of
+the active extent selected (to split off from) and the size of the 
requested
+allocation.  (@interwq, @davidtgoldblatt)
+  - Add retain_grow_limit to set the max size when growing virtual address
+space.  (@interwq)
+  - Add mallctl interfaces:
++ arena..retain_grow_limit  (@interwq)
++ arenas.lookup  (@lionkov)
++ max_background_threads  (@djwatson)
++ opt.lg_extent_max_active_fit  (@interwq)
++ opt.max_background_threads  (@djwatson)
++ opt.metadata_thp  (@interwq)
++ opt.thp  (@interwq)
++ stats.metadata_thp  (@interwq)
+
+  Portability improvements:
+  - Support GNU/kFreeBSD configuration.  (@paravoid)
+  - Support m68k, nios2 and SH3 architectures.  (@paravoid)
+  - Fall back to FD_CLOEXEC when O_CLOEXEC is unavailable.  (@zonyitoo)
+  - Fix symbol listing for cross-compiling.  (@tamird)
+  - Fix high bits computation on ARM.  (@davidtgoldblatt, @paravoid)
+  - Disable the CPU_SPINWAIT macro for Power.  (@davidtgoldblatt, @marxin)
+  - Fix MSVC 2015 & 2017 builds.  (@rustyx)
+  - Improve RISC-V support.  (@EdSchouten)
+  - Set name mangling script in strict mode.  (@nicolov)
+  - Avoid MADV_HUGEPAGE on ARM.  (@marxin)
+  - Modify configure to determine return value of strerror_r.
+(@davidtgoldblatt, @cferris1000)
+  - Make sure CXXFLAGS is tested with CPP compiler.  (@nehaljwani)
+  - Fix 32-bit build on MSVC.  (@rustyx)
+  - Fix external symbol on MSVC.  (@maksqwe)
+  - Avoid a printf format specifier warning.  (@jasone)
+  - Add configure option --disable-initial-exec-tls which can allow jemalloc to
+be dynamically loaded after program startup.  (@davidtgoldblatt, @KenMacD)
+  - AArch64: Add ILP32 support.  (@cmuellner)
+  - Add --with-lg-vaddr configure option to support cross compiling.
+(@cmuellner, @davidtgoldblatt)
+
+  Optimizations and refactors:
+  - Improve active extent fit with extent_max_active_fit.  This considerably
+reduces fragmentation over time and improves virtual memory and metadata
+usage.  (@davidtgoldblatt, @interwq)
+  - Eagerly coalesce large extents to reduce fragmentation.  (@interwq)
+  - sdallocx: only read size info when page aligned (i.e. possibly sampled),
+which speeds up the sized deallocation path significantly.  (@interwq)
+  - Avoid attempting new mappings for in place expansion with retain, since
+it rarely succeeds in practice and causes high overhead.  (@interwq)
+  - Refactor OOM handling in newImpl.  (@wqfish)
+  - Add internal fine-grained logging functionality for debugging use.
+(@davidtgoldblatt)
+  - Refactor arena / tcache interactions.  (

svn commit: r320623 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src

2017-07-03 Thread Jason Evans
Author: jasone
Date: Mon Jul  3 23:27:57 2017
New Revision: 320623
URL: https://svnweb.freebsd.org/changeset/base/320623

Log:
  Update jemalloc to 5.0.1.

Modified:
  head/contrib/jemalloc/ChangeLog
  head/contrib/jemalloc/VERSION
  head/contrib/jemalloc/doc/jemalloc.3
  head/contrib/jemalloc/include/jemalloc/internal/arena_externs.h
  head/contrib/jemalloc/include/jemalloc/internal/background_thread_inlines.h
  head/contrib/jemalloc/include/jemalloc/internal/base_externs.h
  head/contrib/jemalloc/include/jemalloc/internal/ctl.h
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_inlines_a.h
  head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h
  head/contrib/jemalloc/include/jemalloc/internal/tcache_externs.h
  head/contrib/jemalloc/include/jemalloc/internal/tsd.h
  head/contrib/jemalloc/include/jemalloc/jemalloc.h
  head/contrib/jemalloc/src/arena.c
  head/contrib/jemalloc/src/background_thread.c
  head/contrib/jemalloc/src/base.c
  head/contrib/jemalloc/src/ctl.c
  head/contrib/jemalloc/src/extent.c
  head/contrib/jemalloc/src/jemalloc.c
  head/contrib/jemalloc/src/prof.c
  head/contrib/jemalloc/src/tcache.c
  head/contrib/jemalloc/src/tsd.c

Modified: head/contrib/jemalloc/ChangeLog
==
--- head/contrib/jemalloc/ChangeLog Mon Jul  3 22:21:44 2017
(r320622)
+++ head/contrib/jemalloc/ChangeLog Mon Jul  3 23:27:57 2017
(r320623)
@@ -4,6 +4,41 @@ brevity.  Much more detail can be found in the git rev
 
 https://github.com/jemalloc/jemalloc
 
+* 5.0.1 (July 1, 2017)
+
+  This bugfix release fixes several issues, most of which are obscure enough
+  that typical applications are not impacted.
+
+  Bug fixes:
+  - Update decay->nunpurged before purging, in order to avoid potential update
+races and subsequent incorrect purging volume.  (@interwq)
+  - Only abort on dlsym(3) error if the failure impacts an enabled feature 
(lazy
+locking and/or background threads).  This mitigates an initialization
+failure bug for which we still do not have a clear reproduction test case.
+(@interwq)
+  - Modify tsd management so that it neither crashes nor leaks if a thread's
+only allocation activity is to call free() after TLS destructors have been
+executed.  This behavior was observed when operating with GNU libc, and is
+unlikely to be an issue with other libc implementations.  (@interwq)
+  - Mask signals during background thread creation.  This prevents signals from
+being inadvertently delivered to background threads.  (@jasone,
+@davidtgoldblatt, @interwq)
+  - Avoid inactivity checks within background threads, in order to prevent
+recursive mutex acquisition.  (@interwq)
+  - Fix extent_grow_retained() to use the specified hooks when the
+arena..extent_hooks mallctl is used to override the default hooks.
+(@interwq)
+  - Add missing reentrancy support for custom extent hooks which allocate.
+(@interwq)
+  - Post-fork(2), re-initialize the list of tcaches associated with each arena
+to contain no tcaches except the forking thread's.  (@interwq)
+  - Add missing post-fork(2) mutex reinitialization for extent_grow_mtx.  This
+fixes potential deadlocks after fork(2).  (@interwq)
+  - Enforce minimum autoconf version (currently 2.68), since 2.63 is known to
+generate corrupt configure scripts.  (@jasone)
+  - Ensure that the configured page size (--with-lg-page) is no larger than the
+configured huge page size (--with-lg-hugepage).  (@jasone)
+
 * 5.0.0 (June 13, 2017)
 
   Unlike all previous jemalloc releases, this release does not use naturally

Modified: head/contrib/jemalloc/VERSION
==
--- head/contrib/jemalloc/VERSION   Mon Jul  3 22:21:44 2017
(r320622)
+++ head/contrib/jemalloc/VERSION   Mon Jul  3 23:27:57 2017
(r320623)
@@ -1 +1 @@
-5.0.0-4-g84f6c2cae0fb1399377ef6aea9368444c4987cc6
+5.0.1-0-g896ed3a8b3f41998d4fb4d625d30ac63ef2d51fb

Modified: head/contrib/jemalloc/doc/jemalloc.3
==
--- head/contrib/jemalloc/doc/jemalloc.3Mon Jul  3 22:21:44 2017
(r320622)
+++ head/contrib/jemalloc/doc/jemalloc.3Mon Jul  3 23:27:57 2017
(r320623)
@@ -2,12 +2,12 @@
 .\" Title: JEMALLOC
 .\"Author: Jason Evans
 .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\"  Date: 06/29/2017
+.\"  Date: 07/01/2017
 .\"Manual: User Manual
-.\"Source: jemalloc 5.0.0-4-g84f6c2cae0fb1399377ef6aea9368444c4987cc6
+.\"Source: jemalloc 5.0.1-0-g896ed3a8b3f41998d4fb4d625d30ac63ef2d51fb
 .\"  

svn commit: r320504 - in head/contrib/jemalloc: . doc include/jemalloc/internal

2017-06-30 Thread Jason Evans
Author: jasone
Date: Fri Jun 30 17:45:51 2017
New Revision: 320504
URL: https://svnweb.freebsd.org/changeset/base/320504

Log:
  Default the abort_conf malloc option to false.
  
  This avoids troublesome backward compatibility issues.

Modified:
  head/contrib/jemalloc/FREEBSD-diffs
  head/contrib/jemalloc/FREEBSD-upgrade
  head/contrib/jemalloc/doc/jemalloc.3
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h

Modified: head/contrib/jemalloc/FREEBSD-diffs
==
--- head/contrib/jemalloc/FREEBSD-diffs Fri Jun 30 17:43:13 2017
(r320503)
+++ head/contrib/jemalloc/FREEBSD-diffs Fri Jun 30 17:45:51 2017
(r320504)
@@ -1,8 +1,8 @@
 diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in
-index 21e401ac..f977c5f5 100644
+index 21e401ac..c26f9f4a 100644
 --- a/doc/jemalloc.xml.in
 +++ b/doc/jemalloc.xml.in
-@@ -53,11 +53,21 @@
+@@ -53,11 +53,22 @@
  This manual describes jemalloc @jemalloc_version@.  More information
  can be found at the http://jemalloc.net/;>jemalloc website.
@@ -10,7 +10,8 @@ index 21e401ac..f977c5f5 100644
 +The following configuration options are enabled in libc's built-in
 +jemalloc: --enable-fill,
 +--enable-lazy-lock, --enable-stats,
-+--enable-utrace, and --enable-xmalloc.
++--enable-utrace, --enable-xmalloc, and
++--with-malloc-conf=abort_conf:false.
 +Additionally, --enable-debug is enabled in development
 +versions of FreeBSD (controlled by the
 +MALLOC_PRODUCTION make variable).
@@ -25,7 +26,7 @@ index 21e401ac..f977c5f5 100644

  Standard API
  
-@@ -3252,4 +3262,18 @@ malloc_conf = "narenas:1";]]>
+@@ -3252,4 +3263,18 @@ malloc_conf = "narenas:1";]]>
  The posix_memalign() function conforms
  to IEEE Std 1003.1-2001 (POSIX.1).


Modified: head/contrib/jemalloc/FREEBSD-upgrade
==
--- head/contrib/jemalloc/FREEBSD-upgrade   Fri Jun 30 17:43:13 2017
(r320503)
+++ head/contrib/jemalloc/FREEBSD-upgrade   Fri Jun 30 17:45:51 2017
(r320504)
@@ -96,6 +96,7 @@ do_extract_helper() {
 
 do_autogen() {
   ./autogen.sh --enable-xmalloc --enable-utrace \
+--with-malloc-conf=abort_conf:false \
 --with-xslroot=/usr/local/share/xsl/docbook --with-private-namespace=__ \
 --with-lg-page-sizes=12,13,14,16
 }

Modified: head/contrib/jemalloc/doc/jemalloc.3
==
--- head/contrib/jemalloc/doc/jemalloc.3Fri Jun 30 17:43:13 2017
(r320503)
+++ head/contrib/jemalloc/doc/jemalloc.3Fri Jun 30 17:45:51 2017
(r320504)
@@ -2,12 +2,12 @@
 .\"     Title: JEMALLOC
 .\"Author: Jason Evans
 .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\"  Date: 06/14/2017
+.\"  Date: 06/29/2017
 .\"Manual: User Manual
 .\"Source: jemalloc 5.0.0-4-g84f6c2cae0fb1399377ef6aea9368444c4987cc6
 .\"  Language: English
 .\"
-.TH "JEMALLOC" "3" "06/14/2017" "jemalloc 5.0.0-4-g84f6c2cae0fb" "User Manual"
+.TH "JEMALLOC" "3" "06/29/2017" "jemalloc 5.0.0-4-g84f6c2cae0fb" "User Manual"
 .\" -
 .\" * Define some portability stuff
 .\" -
@@ -38,8 +38,9 @@ The following configuration options are enabled in lib
 \fB\-\-enable\-fill\fR,
 \fB\-\-enable\-lazy\-lock\fR,
 \fB\-\-enable\-stats\fR,
-\fB\-\-enable\-utrace\fR, and
-\fB\-\-enable\-xmalloc\fR\&. Additionally,
+\fB\-\-enable\-utrace\fR,
+\fB\-\-enable\-xmalloc\fR, and
+\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

Modified: 
head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
==
--- head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
Fri Jun 30 17:43:13 2017(r320503)
+++ head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
Fri Jun 30 17:45:51 2017(r320504)
@@ -329,7 +329,7 @@
 /* #undef JEMALLOC_EXPORT */
 
 /* config.malloc_conf options string. */
-#define JEMALLOC_CONFIG_MALLOC_CONF ""
+#define JEMALLOC_CONFIG_MALLOC_CONF "abort_conf:false"
 
 /* If defined, jemalloc takes the malloc/free/etc. symbol names. */
 #define JEMALLOC_IS_MALLOC 1
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r319971 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/stdlib/jemal

2017-06-20 Thread Jason Evans
On Fri, 16 Jun 2017 17:15:44 -0700
Jason Evans <jas...@canonware.com> wrote:
> On Fri, 16 Jun 2017 18:45:17 -0400
> Shawn Webb <shawn.w...@hardenedbsd.org> wrote:
> > On Thu, Jun 15, 2017 at 07:15:06AM +, Jason Evans wrote:
> > > Author: jasone
> > > Date: Thu Jun 15 07:15:05 2017
> > > New Revision: 319971
> > > URL: https://svnweb.freebsd.org/changeset/base/319971
> > > 
> > > Log:
> > >   Update jemalloc to 5.0.0.
> > 
> > This breaks buildworld for arm64:
> > 
> > /usr/obj/arm64.aarch64/scratch/fbsd/tmp/usr/bin/ld: error: 
> > sigsetjmp.pico:(function sigsetjmp): relocation R_AARCH64_CONDBR19 out of 
> > range
> > /usr/obj/arm64.aarch64/scratch/fbsd/tmp/usr/bin/ld: error: 
> > sigsetjmp.pico:(function siglongjmp): relocation R_AARCH64_CONDBR19 out of 
> > range
> > cc: error: linker command failed with exit code 1 (use -v to see invocation)
> > --- libc.so.7.full ---
> > *** [libc.so.7.full] Error code 1
> > 
> > make[4]: stopped in /scratch/fbsd/lib/libc
> 
> Indeed, this happens for me too with TARGET=arm64 TARGET_ARCH=aarch64.  I 
> haven't found anything specifically about this error message, but it looks 
> vaguely like the amd64-specific messages that happen when trying to link 
> non-PIC object files into a shared library.  In 
> src/lib/libc/aarch64/gen/sigsetjmp.S, we have two conditional jumps
> 
>   b.eqC_LABEL(_setjmp)
>   [...]
>   b.eqC_LABEL(_longjmp)
> 
> Maybe there's a simple macro change that can make these relocatable jumps.  
> Alternatively, we could probably simplify the code by merging setjmp.S and 
> sigsetjmp.S, so that PC-relative jumps could be used.

Given how arm handles similar branches, it seems like the correct fix would be 
to change these (and probably other branches) from e.g.

b.eq_C_LABEL(_setjmp)

to

b.eqPIC_SYM(_C_LABEL(_setjmp), PLT)

However, doing so triggers a clang crash.  PIC_SYM is explicitly defined for 
aarch64, but is otherwise unused.  It appears that we don't actually generate 
relocations, at least during initial linking.  As a side effect, we have an 
implicit dependency on all of libc's dependent symbols serendipitously being 
within some limited range of each other.  When using conditional branches, that 
range is +-1 MiB; for unconditional branches it is +-128 MiB.

The jemalloc update changed libc's layout, and the conditional branches 
exceeded the +-1 MiB range.  This latent bug is worked around in r320136, 
though it seems likely we have broader problems with how we build PIC libraries 
for arm64.

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


svn commit: r320136 - head/lib/libc/aarch64/gen

2017-06-20 Thread Jason Evans
Author: jasone
Date: Tue Jun 20 07:25:38 2017
New Revision: 320136
URL: https://svnweb.freebsd.org/changeset/base/320136

Log:
  Decrease relative branch brittleness.
  
  Replace conditional branches with trampolines to unconditional branches when
  jumping to labels within other compilation units.  This increases the offset
  range from +-1 MiB to +-128 MiB.

Modified:
  head/lib/libc/aarch64/gen/sigsetjmp.S

Modified: head/lib/libc/aarch64/gen/sigsetjmp.S
==
--- head/lib/libc/aarch64/gen/sigsetjmp.S   Tue Jun 20 06:20:09 2017
(r320135)
+++ head/lib/libc/aarch64/gen/sigsetjmp.S   Tue Jun 20 07:25:38 2017
(r320136)
@@ -34,8 +34,10 @@ __FBSDID("$FreeBSD$");
 
 ENTRY(sigsetjmp)
cmp x1, #0
-   b.eq_C_LABEL(_setjmp)
+   b.eq1f
b   _C_LABEL(setjmp)
+1:
+   b   _C_LABEL(_setjmp)
 END(sigsetjmp)
 
 ENTRY(siglongjmp)
@@ -45,8 +47,10 @@ ENTRY(siglongjmp)
 
/* Check the magic */
cmp x2, x3
-   b.eq_C_LABEL(_longjmp)
+   b.eq1f
b   _C_LABEL(longjmp)
+1:
+   b   _C_LABEL(_longjmp)
.align  3
 .Lmagic:
.quad   _JB_MAGIC__SETJMP
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r319971 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/stdlib/jemal

2017-06-16 Thread Jason Evans
On Fri, 16 Jun 2017 18:45:17 -0400
Shawn Webb <shawn.w...@hardenedbsd.org> wrote:

> On Thu, Jun 15, 2017 at 07:15:06AM +0000, Jason Evans wrote:
> > Author: jasone
> > Date: Thu Jun 15 07:15:05 2017
> > New Revision: 319971
> > URL: https://svnweb.freebsd.org/changeset/base/319971
> > 
> > Log:
> >   Update jemalloc to 5.0.0.
> > 
> 
> This breaks buildworld for arm64:
> 
> /usr/obj/arm64.aarch64/scratch/fbsd/tmp/usr/bin/ld: error: 
> sigsetjmp.pico:(function sigsetjmp): relocation R_AARCH64_CONDBR19 out of 
> range
> /usr/obj/arm64.aarch64/scratch/fbsd/tmp/usr/bin/ld: error: 
> sigsetjmp.pico:(function siglongjmp): relocation R_AARCH64_CONDBR19 out of 
> range
> cc: error: linker command failed with exit code 1 (use -v to see invocation)
> --- libc.so.7.full ---
> *** [libc.so.7.full] Error code 1
> 
> make[4]: stopped in /scratch/fbsd/lib/libc

Indeed, this happens for me too with TARGET=arm64 TARGET_ARCH=aarch64.  I 
haven't found anything specifically about this error message, but it looks 
vaguely like the amd64-specific messages that happen when trying to link 
non-PIC object files into a shared library.  In 
src/lib/libc/aarch64/gen/sigsetjmp.S, we have two conditional jumps

b.eqC_LABEL(_setjmp)
[...]
b.eqC_LABEL(_longjmp)

Maybe there's a simple macro change that can make these relocatable jumps.  
Alternatively, we could probably simplify the code by merging setjmp.S and 
sigsetjmp.S, so that PC-relative jumps could be used.

I'm going to be AFK for the next couple days, and I do not have arm64 hardware, 
so I hope this is enough information for someone to work out a simple fix.

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


Re: svn commit: r319971 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/stdlib/jemal

2017-06-15 Thread Jason Evans
On Thu, 15 Jun 2017 08:04:57 -0700
Jason Evans <jas...@canonware.com> wrote:

> On Thu, 15 Jun 2017 10:31:57 +0200
> "O. Hartmann" <ohartm...@walstatt.org> wrote:
> 
> > On Thu, 15 Jun 2017 07:15:06 + (UTC)
> > Jason Evans <jas...@freebsd.org> wrote:
> > 
> > > Author: jasone
> > > Date: Thu Jun 15 07:15:05 2017
> > > New Revision: 319971
> > > URL: https://svnweb.freebsd.org/changeset/base/319971
> > > 
> > > Log:
> > >   Update jemalloc to 5.0.0.
> > 
> > On all hosts (running CURRENT:  FreeBSD 12.0-CURRENT #15 r319965: Thu Jun 15
> > 05:56:12 CEST 2017 amd64 AND FreeBSD 12.0-CURRENT #20 r319934: Wed Jun 14
> > 06:18:46 CEST 2017 amd64)
> > 
> > buildworld fails on
> > 
> > [...]
> > Building /usr/obj/usr/src/lib/libgcc_s/_libinstall
> > --- secure/lib/libcrypto__L ---
> > --- all_subdir_secure/lib/libcrypto/engines/libaep ---
> > /usr/obj/usr/src/tmp/usr/bin/ld: error: unable to find library -lgcc_s
> > /usr/obj/usr/src/tmp/usr/bin/ld: error: unable to find library -lgcc_s
> > cc: error: linker command failed with exit code 1 (use -v to see invocation)
> > *** [libaep.so] Error code 1
> > 
> > make[6]: stopped in /usr/src/secure/lib/libcrypto/engines/libaep
> > .ERROR_TARGET='libaep.so'
> 
> I tested this commit based on r319490.  I'm in the process of updating to 
> r319971, and will see if the issue reproduces.

I updated from r319490 (with jemalloc update integrated) to r319971, then 
rebuilt r319971 without issues.  Is it possible that the issue you hit isn't 
directly related to r319971?

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


Re: svn commit: r319971 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/stdlib/jemal

2017-06-15 Thread Jason Evans
On Thu, 15 Jun 2017 10:31:57 +0200
"O. Hartmann" <ohartm...@walstatt.org> wrote:

> On Thu, 15 Jun 2017 07:15:06 + (UTC)
> Jason Evans <jas...@freebsd.org> wrote:
> 
> > Author: jasone
> > Date: Thu Jun 15 07:15:05 2017
> > New Revision: 319971
> > URL: https://svnweb.freebsd.org/changeset/base/319971
> > 
> > Log:
> >   Update jemalloc to 5.0.0.
> 
> On all hosts (running CURRENT:  FreeBSD 12.0-CURRENT #15 r319965: Thu Jun 15
> 05:56:12 CEST 2017 amd64 AND FreeBSD 12.0-CURRENT #20 r319934: Wed Jun 14
> 06:18:46 CEST 2017 amd64)
> 
> buildworld fails on
> 
> [...]
> Building /usr/obj/usr/src/lib/libgcc_s/_libinstall
> --- secure/lib/libcrypto__L ---
> --- all_subdir_secure/lib/libcrypto/engines/libaep ---
> /usr/obj/usr/src/tmp/usr/bin/ld: error: unable to find library -lgcc_s
> /usr/obj/usr/src/tmp/usr/bin/ld: error: unable to find library -lgcc_s
> cc: error: linker command failed with exit code 1 (use -v to see invocation)
> *** [libaep.so] Error code 1
> 
> make[6]: stopped in /usr/src/secure/lib/libcrypto/engines/libaep
> .ERROR_TARGET='libaep.so'

I tested this commit based on r319490.  I'm in the process of updating to 
r319971, and will see if the issue reproduces.

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


svn commit: r319971 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/stdlib/jemalloc

2017-06-15 Thread Jason Evans
 distribution are
 subject to the following license:
 

-Copyright (C) 2002-2016 Jason Evans <jas...@canonware.com>.
+Copyright (C) 2002-2017 Jason Evans <jas...@canonware.com>.
 All rights reserved.
 Copyright (C) 2007-2012 Mozilla Foundation.  All rights reserved.
-Copyright (C) 2009-2016 Facebook, Inc.  All rights reserved.
+Copyright (C) 2009-2017 Facebook, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:

Modified: head/contrib/jemalloc/ChangeLog
==
--- head/contrib/jemalloc/ChangeLog Thu Jun 15 06:48:36 2017
(r319970)
+++ head/contrib/jemalloc/ChangeLog Thu Jun 15 07:15:05 2017
(r319971)
@@ -4,6 +4,193 @@ brevity.  Much more detail can be found in the git rev
 
 https://github.com/jemalloc/jemalloc
 
+* 5.0.0 (June 13, 2017)
+
+  Unlike all previous jemalloc releases, this release does not use naturally
+  aligned "chunks" for virtual memory management, and instead uses page-aligned
+  "extents".  This change has few externally visible effects, but the internal
+  impacts are... extensive.  Many other internal changes combine to make this
+  the most cohesively designed version of jemalloc so far, with ample
+  opportunity for further enhancements.
+
+  Continuous integration is now an integral aspect of development thanks to the
+  efforts of @davidtgoldblatt, and the dev branch tends to remain reasonably
+  stable on the tested platforms (Linux, FreeBSD, macOS, and Windows).  As a
+  side effect the official release frequency may decrease over time.
+
+  New features:
+  - Implement optional per-CPU arena support; threads choose which arena to use
+based on current CPU rather than on fixed thread-->arena associations.
+(@interwq)
+  - Implement two-phase decay of unused dirty pages.  Pages transition from
+dirty-->muzzy-->clean, where the first phase transition relies on
+madvise(... MADV_FREE) semantics, and the second phase transition discards
+pages such that they are replaced with demand-zeroed pages on next access.
+(@jasone)
+  - Increase decay time resolution from seconds to milliseconds.  (@jasone)
+  - Implement opt-in per CPU background threads, and use them for asynchronous
+decay-driven unused dirty page purging.  (@interwq)
+  - Add mutex profiling, which collects a variety of statistics useful for
+diagnosing overhead/contention issues.  (@interwq)
+  - Add C++ new/delete operator bindings.  (@djwatson)
+  - Support manually created arena destruction, such that all data and metadata
+are discarded.  Add MALLCTL_ARENAS_DESTROYED for accessing merged stats
+associated with destroyed arenas.  (@jasone)
+  - Add MALLCTL_ARENAS_ALL as a fixed index for use in accessing
+merged/destroyed arena statistics via mallctl.  (@jasone)
+  - Add opt.abort_conf to optionally abort if invalid configuration options are
+detected during initialization.  (@interwq)
+  - Add opt.stats_print_opts, so that e.g. JSON output can be selected for the
+stats dumped during exit if opt.stats_print is true.  (@jasone)
+  - Add --with-version=VERSION for use when embedding jemalloc into another
+project's git repository.  (@jasone)
+  - Add --disable-thp to support cross compiling.  (@jasone)
+  - Add --with-lg-hugepage to support cross compiling.  (@jasone)
+  - Add mallctl interfaces (various authors):
++ background_thread
++ opt.abort_conf
++ opt.retain
++ opt.percpu_arena
++ opt.background_thread
++ opt.{dirty,muzzy}_decay_ms
++ opt.stats_print_opts
++ arena..initialized
++ arena..destroy
++ arena..{dirty,muzzy}_decay_ms
++ arena..extent_hooks
++ arenas.{dirty,muzzy}_decay_ms
++ arenas.bin..slab_size
++ arenas.nlextents
++ arenas.lextent..size
++ arenas.create
++ stats.background_thread.{num_threads,num_runs,run_interval}
++ stats.mutexes.{ctl,background_thread,prof,reset}.
+  
{num_ops,num_spin_acq,num_wait,max_wait_time,total_wait_time,max_num_thds,
+  num_owner_switch}
++ stats.arenas..{dirty,muzzy}_decay_ms
++ stats.arenas..uptime
++ stats.arenas..{pmuzzy,base,internal,resident}
++ stats.arenas..{dirty,muzzy}_{npurge,nmadvise,purged}
++ stats.arenas..bins..{nslabs,reslabs,curslabs}
++ stats.arenas..bins..mutex.
+  
{num_ops,num_spin_acq,num_wait,max_wait_time,total_wait_time,max_num_thds,
+  num_owner_switch}
++ stats.arenas..lextents..{nmalloc,ndalloc,nrequests,curlextents}
++ stats.arenas.i.mutexes.{large,extent_avail,extents_dirty,extents_muzzy,
+  extents_retained,decay_dirty,decay_muzzy,base,tcache_list}.
+  
{num_ops,num_spin_acq,num_wait,max_wait_time,total_wait_time,max_num_thds,

svn commit: r318277 - stable/11/lib/libthr/thread

2017-05-14 Thread Jason Evans
Author: jasone
Date: Sun May 14 17:10:55 2017
New Revision: 318277
URL: https://svnweb.freebsd.org/changeset/base/318277

Log:
  MFC r318254:
  
  Fix __pthread_mutex_trylock() to call THR_CRITICAL_LEAVE() on failure rather
  than on success.  This regression was introduced by r300043 (Add 
implementation
  of robust mutexes...).

Modified:
  stable/11/lib/libthr/thread/thr_mutex.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libthr/thread/thr_mutex.c
==
--- stable/11/lib/libthr/thread/thr_mutex.c Sun May 14 14:27:59 2017
(r318276)
+++ stable/11/lib/libthr/thread/thr_mutex.c Sun May 14 17:10:55 2017
(r318277)
@@ -631,7 +631,7 @@ __pthread_mutex_trylock(pthread_mutex_t 
} /* else {} */
if (robust)
_mutex_leave_robust(curthread, m);
-   if ((ret == 0 || ret == EOWNERDEAD) &&
+   if (ret != 0 && ret != EOWNERDEAD &&
(m->m_flags & PMUTEX_FLAG_PRIVATE) != 0)
THR_CRITICAL_LEAVE(curthread);
return (ret);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r318254 - head/lib/libthr/thread

2017-05-13 Thread Jason Evans
Author: jasone
Date: Sat May 13 17:49:53 2017
New Revision: 318254
URL: https://svnweb.freebsd.org/changeset/base/318254

Log:
  Fix __pthread_mutex_trylock() to call THR_CRITICAL_LEAVE() on failure rather
  than on success.  This regression was introduced by r300043 (Add 
implementation
  of robust mutexes...).
  
  MFC after:1 day

Modified:
  head/lib/libthr/thread/thr_mutex.c

Modified: head/lib/libthr/thread/thr_mutex.c
==
--- head/lib/libthr/thread/thr_mutex.c  Sat May 13 13:03:20 2017
(r318253)
+++ head/lib/libthr/thread/thr_mutex.c  Sat May 13 17:49:53 2017
(r318254)
@@ -631,7 +631,7 @@ __pthread_mutex_trylock(pthread_mutex_t 
} /* else {} */
if (robust)
_mutex_leave_robust(curthread, m);
-   if ((ret == 0 || ret == EOWNERDEAD) &&
+   if (ret != 0 && ret != EOWNERDEAD &&
(m->m_flags & PMUTEX_FLAG_PRIVATE) != 0)
THR_CRITICAL_LEAVE(curthread);
return (ret);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r314529 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src

2017-03-01 Thread Jason Evans
   to IEEE Std 1003.1-2001 (POSIX.1).

@@ -47,10 +47,10 @@ index d9c8345..9898c3c 100644
 +  
  
 diff --git a/include/jemalloc/internal/arena.h 
b/include/jemalloc/internal/arena.h
-index ce4e602..35360b6 100644
+index 119e3a5..277989f 100644
 --- a/include/jemalloc/internal/arena.h
 +++ b/include/jemalloc/internal/arena.h
-@@ -730,8 +730,13 @@ arena_miscelm_get_mutable(arena_chunk_t *chunk, size_t 
pageind)
+@@ -731,8 +731,13 @@ arena_miscelm_get_mutable(arena_chunk_t *chunk, size_t 
pageind)
  JEMALLOC_ALWAYS_INLINE const arena_chunk_map_misc_t *
  arena_miscelm_get_const(const arena_chunk_t *chunk, size_t pageind)
  {
@@ -64,7 +64,7 @@ index ce4e602..35360b6 100644
  }
  
  JEMALLOC_ALWAYS_INLINE size_t
-@@ -790,8 +795,13 @@ arena_mapbitsp_get_mutable(arena_chunk_t *chunk, size_t 
pageind)
+@@ -791,8 +796,13 @@ arena_mapbitsp_get_mutable(arena_chunk_t *chunk, size_t 
pageind)
  JEMALLOC_ALWAYS_INLINE const size_t *
  arena_mapbitsp_get_const(const arena_chunk_t *chunk, size_t pageind)
  {
@@ -79,7 +79,7 @@ index ce4e602..35360b6 100644
  
  JEMALLOC_ALWAYS_INLINE size_t
 diff --git a/include/jemalloc/internal/jemalloc_internal.h.in 
b/include/jemalloc/internal/jemalloc_internal.h.in
-index e7ace7d..d86c61d 100644
+index e3b499a..827fdbf 100644
 --- a/include/jemalloc/internal/jemalloc_internal.h.in
 +++ b/include/jemalloc/internal/jemalloc_internal.h.in
 @@ -8,6 +8,9 @@
@@ -122,7 +122,7 @@ index c907d91..4626632 100644
  #ifdef _WIN32
  #  include 
 diff --git a/include/jemalloc/internal/mutex.h 
b/include/jemalloc/internal/mutex.h
-index b442d2d..76518db 100644
+index 2b4b1c3..e03a6d0 100644
 --- a/include/jemalloc/internal/mutex.h
 +++ b/include/jemalloc/internal/mutex.h
 @@ -57,9 +57,6 @@ struct malloc_mutex_s {
@@ -144,10 +144,10 @@ index b442d2d..76518db 100644
  
  #endif /* JEMALLOC_H_EXTERNS */
 diff --git a/include/jemalloc/internal/private_symbols.txt 
b/include/jemalloc/internal/private_symbols.txt
-index c1c6c40..c6395fd 100644
+index 60b57e5..056a8fe 100644
 --- a/include/jemalloc/internal/private_symbols.txt
 +++ b/include/jemalloc/internal/private_symbols.txt
-@@ -310,7 +310,6 @@ iralloct_realign
+@@ -312,7 +312,6 @@ iralloct_realign
  isalloc
  isdalloct
  isqalloc
@@ -335,7 +335,7 @@ index f943891..47d032c 100755
 +#include "jemalloc_FreeBSD.h"
  EOF
 diff --git a/src/jemalloc.c b/src/jemalloc.c
-index baead66..8a49f26 100644
+index f73a26c..fcfe204 100644
 --- a/src/jemalloc.c
 +++ b/src/jemalloc.c
 @@ -4,6 +4,10 @@
@@ -349,7 +349,7 @@ index baead66..8a49f26 100644
  /* Runtime configuration options. */
  const char*je_malloc_conf
  #ifndef _WIN32
-@@ -2775,6 +2779,107 @@ je_malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void 
*ptr)
+@@ -2781,6 +2785,107 @@ je_malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void 
*ptr)
   */
  
/**/
  /*
@@ -457,7 +457,7 @@ index baead66..8a49f26 100644
   * The following functions are used by threading libraries for protection of
   * malloc during fork().
   */
-@@ -2913,4 +3018,11 @@ jemalloc_postfork_child(void)
+@@ -2922,4 +3027,11 @@ jemalloc_postfork_child(void)
ctl_postfork_child(tsd_tsdn(tsd));
  }
  
@@ -516,7 +516,7 @@ index 6333e73..13f8d79 100644
 +#endif
 +}
 diff --git a/src/util.c b/src/util.c
-index dd8c236..a4ff287 100755
+index dd8c236..a4ff287 100644
 --- a/src/util.c
 +++ b/src/util.c
 @@ -67,6 +67,22 @@ wrtmessage(void *cbopaque, const char *s)

Modified: head/contrib/jemalloc/VERSION
==
--- head/contrib/jemalloc/VERSION   Thu Mar  2 00:27:21 2017
(r314528)
+++ head/contrib/jemalloc/VERSION   Thu Mar  2 01:14:48 2017
(r314529)
@@ -1 +1 @@
-4.4.0-0-gf1f76357313e7dcad7262f17a48ff0a2e005fcdc
+4.5.0-0-g04380e79f1e2428bd0ad000bbc6e3d2dfc6b66a5

Modified: head/contrib/jemalloc/doc/jemalloc.3
==
--- head/contrib/jemalloc/doc/jemalloc.3Thu Mar  2 00:27:21 2017
(r314528)
+++ head/contrib/jemalloc/doc/jemalloc.3Thu Mar  2 01:14:48 2017
(r314529)
@@ -2,12 +2,12 @@
 .\"     Title: JEMALLOC
 .\"Author: Jason Evans
 .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\"  Date: 12/04/2016
+.\"  Date: 02/28/2017
 .\"Manual: User Manual
-.\"Source: jemalloc 4.4.0-0-gf1f76357313e7dcad7262f17a48ff0a2e005fcdc
+.\"Source: jemalloc 4.5.0-0-g04380e79f1e2428bd0ad000bbc6e3d2dfc6b66a5
 .\"  Language: English
 .\"
-.TH "JEMALLOC" "3" "12/04/2016" "jemalloc 4.4.0-0-gf1f76357313e" "User Manual"
+.TH "JEMALLOC" "3" "02/28/2017" "jemalloc 4.5.0-0-g04380e79f1e2" "User Manual"
 .\" -
 .\&q

svn commit: r309540 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src

2016-12-04 Thread Jason Evans
 @@
@@ -144,10 +144,10 @@ index b442d2d..76518db 100644
  
  #endif /* JEMALLOC_H_EXTERNS */
 diff --git a/include/jemalloc/internal/private_symbols.txt 
b/include/jemalloc/internal/private_symbols.txt
-index 87c8c9b..df576f6 100644
+index c1c6c40..c6395fd 100644
 --- a/include/jemalloc/internal/private_symbols.txt
 +++ b/include/jemalloc/internal/private_symbols.txt
-@@ -307,7 +307,6 @@ iralloct_realign
+@@ -310,7 +310,6 @@ iralloct_realign
  isalloc
  isdalloct
  isqalloc
@@ -335,7 +335,7 @@ index f943891..47d032c 100755
 +#include "jemalloc_FreeBSD.h"
  EOF
 diff --git a/src/jemalloc.c b/src/jemalloc.c
-index 38650ff..f659b55 100644
+index baead66..8a49f26 100644
 --- a/src/jemalloc.c
 +++ b/src/jemalloc.c
 @@ -4,6 +4,10 @@
@@ -349,7 +349,7 @@ index 38650ff..f659b55 100644
  /* Runtime configuration options. */
  const char*je_malloc_conf
  #ifndef _WIN32
-@@ -2756,6 +2760,107 @@ je_malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void 
*ptr)
+@@ -2775,6 +2779,107 @@ je_malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void 
*ptr)
   */
  
/**/
  /*
@@ -457,7 +457,7 @@ index 38650ff..f659b55 100644
   * The following functions are used by threading libraries for protection of
   * malloc during fork().
   */
-@@ -2894,4 +2999,11 @@ jemalloc_postfork_child(void)
+@@ -2913,4 +3018,11 @@ jemalloc_postfork_child(void)
ctl_postfork_child(tsd_tsdn(tsd));
  }
  
@@ -516,7 +516,7 @@ index 6333e73..13f8d79 100644
 +#endif
 +}
 diff --git a/src/util.c b/src/util.c
-index 7905267..bee1c77 100644
+index dd8c236..a4ff287 100755
 --- a/src/util.c
 +++ b/src/util.c
 @@ -67,6 +67,22 @@ wrtmessage(void *cbopaque, const char *s)

Modified: head/contrib/jemalloc/VERSION
==
--- head/contrib/jemalloc/VERSION   Sun Dec  4 20:44:58 2016
(r309539)
+++ head/contrib/jemalloc/VERSION   Sun Dec  4 21:13:26 2016
(r309540)
@@ -1 +1 @@
-4.3.1-0-g0110fa8451af905affd77c3bea0d545fee2251b2
+4.4.0-0-gf1f76357313e7dcad7262f17a48ff0a2e005fcdc

Modified: head/contrib/jemalloc/doc/jemalloc.3
==
--- head/contrib/jemalloc/doc/jemalloc.3Sun Dec  4 20:44:58 2016
(r309539)
+++ head/contrib/jemalloc/doc/jemalloc.3Sun Dec  4 21:13:26 2016
(r309540)
@@ -2,12 +2,12 @@
 .\" Title: JEMALLOC
 .\"    Author: Jason Evans
 .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\"  Date: 11/08/2016
+.\"  Date: 12/04/2016
 .\"Manual: User Manual
-.\"Source: jemalloc 4.3.1-0-g0110fa8451af905affd77c3bea0d545fee2251b2
+.\"Source: jemalloc 4.4.0-0-gf1f76357313e7dcad7262f17a48ff0a2e005fcdc
 .\"  Language: English
 .\"
-.TH "JEMALLOC" "3" "11/08/2016" "jemalloc 4.3.1-0-g0110fa8451af" "User Manual"
+.TH "JEMALLOC" "3" "12/04/2016" "jemalloc 4.4.0-0-gf1f76357313e" "User Manual"
 .\" -
 .\" * Define some portability stuff
 .\" -
@@ -31,7 +31,7 @@
 jemalloc \- general purpose memory allocation functions
 .SH "LIBRARY"
 .PP
-This manual describes jemalloc 
4\&.3\&.1\-0\-g0110fa8451af905affd77c3bea0d545fee2251b2\&. More information can 
be found at the
+This manual describes jemalloc 
4\&.4\&.0\-0\-gf1f76357313e7dcad7262f17a48ff0a2e005fcdc\&. More information can 
be found at the
 \m[blue]\fBjemalloc website\fR\m[]\&\s-2\u[1]\d\s+2\&.
 .PP
 The following configuration options are enabled in libc\*(Aqs built\-in 
jemalloc:
@@ -365,7 +365,7 @@ for (i = 0; i < nbins; i++) {
 
mib[2] = i;
len = sizeof(bin_size);
-   mallctlbymib(mib, miblen, _size, , NULL, 0);
+   mallctlbymib(mib, miblen, (void *)_size, , NULL, 0);
/* Do something with bin_size\&.\&.\&. */
 }
 .fi

Modified: head/contrib/jemalloc/include/jemalloc/internal/arena.h
==
--- head/contrib/jemalloc/include/jemalloc/internal/arena.h Sun Dec  4 
20:44:58 2016(r309539)
+++ head/contrib/jemalloc/include/jemalloc/internal/arena.h Sun Dec  4 
21:13:26 2016(r309540)
@@ -191,6 +191,14 @@ struct arena_chunk_s {
extent_node_t   node;
 
/*
+* True if memory could be backed by transparent huge pages.  This is
+* only directly relevant to Linux, since it is the only supported
+* platform on which jemalloc interacts with explicit transparent huge
+* page controls.
+*/
+   boolhugepage;
+
+   /*
 * Map of pages within chu

svn commit: r308473 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src lib/libc/stdlib/jemalloc

2016-11-09 Thread Jason Evans
tex, const char 
*name,
+@@ -67,6 +64,7 @@ bool malloc_mutex_init(malloc_mutex_t *mutex, const char 
*name,
  void  malloc_mutex_prefork(tsdn_t *tsdn, malloc_mutex_t *mutex);
  void  malloc_mutex_postfork_parent(tsdn_t *tsdn, malloc_mutex_t *mutex);
  void  malloc_mutex_postfork_child(tsdn_t *tsdn, malloc_mutex_t *mutex);
@@ -144,10 +144,10 @@ index 5221799..60ab041 100644
  
  #endif /* JEMALLOC_H_EXTERNS */
 diff --git a/include/jemalloc/internal/private_symbols.txt 
b/include/jemalloc/internal/private_symbols.txt
-index f2b6a55..69369c9 100644
+index 87c8c9b..df576f6 100644
 --- a/include/jemalloc/internal/private_symbols.txt
 +++ b/include/jemalloc/internal/private_symbols.txt
-@@ -311,7 +311,6 @@ iralloct_realign
+@@ -307,7 +307,6 @@ iralloct_realign
  isalloc
  isdalloct
  isqalloc
@@ -335,7 +335,7 @@ index f943891..47d032c 100755
 +#include "jemalloc_FreeBSD.h"
  EOF
 diff --git a/src/jemalloc.c b/src/jemalloc.c
-index 5d1f493..46dd1d1 100644
+index 38650ff..f659b55 100644
 --- a/src/jemalloc.c
 +++ b/src/jemalloc.c
 @@ -4,6 +4,10 @@
@@ -347,9 +347,9 @@ index 5d1f493..46dd1d1 100644
 +__sym_compat(_malloc_options, __malloc_options_1_0, FBSD_1.0);
 +
  /* Runtime configuration options. */
- const char*je_malloc_conf JEMALLOC_ATTR(weak);
- bool  opt_abort =
-@@ -2673,6 +2677,107 @@ je_malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void 
*ptr)
+ const char*je_malloc_conf
+ #ifndef _WIN32
+@@ -2756,6 +2760,107 @@ je_malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void 
*ptr)
   */
  
/**/
  /*
@@ -457,7 +457,7 @@ index 5d1f493..46dd1d1 100644
   * The following functions are used by threading libraries for protection of
   * malloc during fork().
   */
-@@ -2814,4 +2919,11 @@ jemalloc_postfork_child(void)
+@@ -2894,4 +2999,11 @@ jemalloc_postfork_child(void)
ctl_postfork_child(tsd_tsdn(tsd));
  }
  
@@ -470,7 +470,7 @@ index 5d1f493..46dd1d1 100644
 +
  
/**/
 diff --git a/src/mutex.c b/src/mutex.c
-index a1fac34..a24e420 100644
+index 6333e73..13f8d79 100644
 --- a/src/mutex.c
 +++ b/src/mutex.c
 @@ -66,6 +66,17 @@ pthread_create(pthread_t *__restrict thread,
@@ -491,7 +491,7 @@ index a1fac34..a24e420 100644
  #endif
  
  bool
-@@ -140,7 +151,7 @@ malloc_mutex_postfork_child(tsdn_t *tsdn, malloc_mutex_t 
*mutex)
+@@ -142,7 +153,7 @@ malloc_mutex_postfork_child(tsdn_t *tsdn, malloc_mutex_t 
*mutex)
  }
  
  bool
@@ -500,7 +500,7 @@ index a1fac34..a24e420 100644
  {
  
  #ifdef JEMALLOC_MUTEX_INIT_CB
-@@ -154,3 +165,14 @@ malloc_mutex_boot(void)
+@@ -156,3 +167,14 @@ malloc_mutex_boot(void)
  #endif
return (false);
  }
@@ -516,7 +516,7 @@ index a1fac34..a24e420 100644
 +#endif
 +}
 diff --git a/src/util.c b/src/util.c
-index a1c4a2a..04f9153 100644
+index 7905267..bee1c77 100644
 --- a/src/util.c
 +++ b/src/util.c
 @@ -67,6 +67,22 @@ wrtmessage(void *cbopaque, const char *s)

Modified: head/contrib/jemalloc/VERSION
==
--- head/contrib/jemalloc/VERSION   Wed Nov  9 18:00:50 2016
(r308472)
+++ head/contrib/jemalloc/VERSION   Wed Nov  9 18:42:30 2016
(r308473)
@@ -1 +1 @@
-4.2.1-0-g3de035335255d553bdb344c32ffdb603816195d8
+4.3.1-0-g0110fa8451af905affd77c3bea0d545fee2251b2

Modified: head/contrib/jemalloc/doc/jemalloc.3
==
--- head/contrib/jemalloc/doc/jemalloc.3Wed Nov  9 18:00:50 2016
(r308472)
+++ head/contrib/jemalloc/doc/jemalloc.3Wed Nov  9 18:42:30 2016
(r308473)
@@ -2,12 +2,12 @@
 .\" Title: JEMALLOC
 .\"Author: Jason Evans
 .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\"  Date: 06/08/2016
+.\"  Date: 11/08/2016
 .\"Manual: User Manual
-.\"Source: jemalloc 4.2.1-0-g3de035335255d553bdb344c32ffdb603816195d8
+.\"Source: jemalloc 4.3.1-0-g0110fa8451af905affd77c3bea0d545fee2251b2
 .\"  Language: English
 .\"
-.TH "JEMALLOC" "3" "06/08/2016" "jemalloc 4.2.1-0-g3de035335255" "User Manual"
+.TH "JEMALLOC" "3" "11/08/2016" "jemalloc 4.3.1-0-g0110fa8451af" "User Manual"
 .\" -
 .\" * Define some portability stuff
 .\" -
@@ -31,7 +31,7 @@
 jemalloc \- general purpose memory allocation functions
 .SH "LIBRARY"
 .PP
-This manual describes jemalloc 
4\&.2\&.1\-0\-g3de035335255d553bdb344c32ffdb603816195d8\&. More information can 
be found at the
+This manual describes jemalloc 
4\&.3\&.1\-0\-g0110fa8451af905affd77c3bea0d545fee2251b2\&. More information 

svn commit: r301718 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src

2016-06-09 Thread Jason Evans
Author: jasone
Date: Thu Jun  9 06:10:20 2016
New Revision: 301718
URL: https://svnweb.freebsd.org/changeset/base/301718

Log:
  Update jemalloc to 4.2.1.

Modified:
  head/contrib/jemalloc/ChangeLog
  head/contrib/jemalloc/FREEBSD-diffs
  head/contrib/jemalloc/VERSION
  head/contrib/jemalloc/doc/jemalloc.3
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h
  head/contrib/jemalloc/include/jemalloc/internal/prof.h
  head/contrib/jemalloc/include/jemalloc/jemalloc.h
  head/contrib/jemalloc/src/arena.c
  head/contrib/jemalloc/src/chunk.c
  head/contrib/jemalloc/src/chunk_mmap.c
  head/contrib/jemalloc/src/huge.c
  head/contrib/jemalloc/src/jemalloc.c
  head/contrib/jemalloc/src/nstime.c

Modified: head/contrib/jemalloc/ChangeLog
==
--- head/contrib/jemalloc/ChangeLog Thu Jun  9 05:48:34 2016
(r301717)
+++ head/contrib/jemalloc/ChangeLog Thu Jun  9 06:10:20 2016
(r301718)
@@ -4,6 +4,17 @@ brevity.  Much more detail can be found 
 
 https://github.com/jemalloc/jemalloc
 
+* 4.2.1 (June 8, 2016)
+
+  Bug fixes:
+  - Fix bootstrapping issues for configurations that require allocation during
+tsd initialization (e.g. --disable-tls).  (@cferris1000, @jasone)
+  - Fix gettimeofday() version of nstime_update().  (@ronawho)
+  - Fix Valgrind regressions in calloc() and chunk_alloc_wrapper().  (@ronawho)
+  - Fix potential VM map fragmentation regression.  (@jasone)
+  - Fix opt_zero-triggered in-place huge reallocation zeroing.  (@jasone)
+  - Fix heap profiling context leaks in reallocation edge cases.  (@jasone)
+
 * 4.2.0 (May 12, 2016)
 
   New features:

Modified: head/contrib/jemalloc/FREEBSD-diffs
==
--- head/contrib/jemalloc/FREEBSD-diffs Thu Jun  9 05:48:34 2016
(r301717)
+++ head/contrib/jemalloc/FREEBSD-diffs Thu Jun  9 06:10:20 2016
(r301718)
@@ -79,7 +79,7 @@ index b1de2b6..da6b6d2 100644
  
  JEMALLOC_ALWAYS_INLINE size_t
 diff --git a/include/jemalloc/internal/jemalloc_internal.h.in 
b/include/jemalloc/internal/jemalloc_internal.h.in
-index 51bf897..7de22ea 100644
+index 8f82edd..78e2df2 100644
 --- a/include/jemalloc/internal/jemalloc_internal.h.in
 +++ b/include/jemalloc/internal/jemalloc_internal.h.in
 @@ -8,6 +8,9 @@
@@ -335,7 +335,7 @@ index f943891..47d032c 100755
 +#include "jemalloc_FreeBSD.h"
  EOF
 diff --git a/src/jemalloc.c b/src/jemalloc.c
-index 40eb2ea..666c49d 100644
+index 5d1f493..46dd1d1 100644
 --- a/src/jemalloc.c
 +++ b/src/jemalloc.c
 @@ -4,6 +4,10 @@

Modified: head/contrib/jemalloc/VERSION
==
--- head/contrib/jemalloc/VERSION   Thu Jun  9 05:48:34 2016
(r301717)
+++ head/contrib/jemalloc/VERSION   Thu Jun  9 06:10:20 2016
(r301718)
@@ -1 +1 @@
-4.2.0-1-gdc7ff6306d7a15b53479e2fb8e5546404b82e6fc
+4.2.1-0-g3de035335255d553bdb344c32ffdb603816195d8

Modified: head/contrib/jemalloc/doc/jemalloc.3
==
--- head/contrib/jemalloc/doc/jemalloc.3Thu Jun  9 05:48:34 2016
(r301717)
+++ head/contrib/jemalloc/doc/jemalloc.3Thu Jun  9 06:10:20 2016
(r301718)
@@ -2,12 +2,12 @@
 .\" Title: JEMALLOC
 .\"    Author: Jason Evans
 .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\"  Date: 05/12/2016
+.\"  Date: 06/08/2016
 .\"Manual: User Manual
-.\"Source: jemalloc 4.2.0-1-gdc7ff6306d7a15b53479e2fb8e5546404b82e6fc
+.\"Source: jemalloc 4.2.1-0-g3de035335255d553bdb344c32ffdb603816195d8
 .\"  Language: English
 .\"
-.TH "JEMALLOC" "3" "05/12/2016" "jemalloc 4.2.0-1-gdc7ff6306d7a" "User Manual"
+.TH "JEMALLOC" "3" "06/08/2016" "jemalloc 4.2.1-0-g3de035335255" "User Manual"
 .\" -
 .\" * Define some portability stuff
 .\" -
@@ -31,7 +31,7 @@
 jemalloc \- general purpose memory allocation functions
 .SH "LIBRARY"
 .PP
-This manual describes jemalloc 
4\&.2\&.0\-1\-gdc7ff6306d7a15b53479e2fb8e5546404b82e6fc\&. More information can 
be found at the
+This manual describes jemalloc 
4\&.2\&.1\-0\-g3de035335255d553bdb344c32ffdb603816195d8\&. More information can 
be found at the
 \m[blue]\fBjemalloc website\fR\m[]\&\s-2\u[1]\d\s+2\&.
 .PP
 The following configuration options are enabled in libc\*(Aqs built\-in 
jemalloc:

Modified: head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h
==
--- head/contrib/jemall

svn commit: r299700 - in head/contrib/jemalloc: . include/jemalloc/internal

2016-05-13 Thread Jason Evans
Author: jasone
Date: Fri May 13 21:18:10 2016
New Revision: 299700
URL: https://svnweb.freebsd.org/changeset/base/299700

Log:
  Work around invalid gcc warning (explicit cast apparently lost).

Modified:
  head/contrib/jemalloc/FREEBSD-diffs
  head/contrib/jemalloc/include/jemalloc/internal/arena.h

Modified: head/contrib/jemalloc/FREEBSD-diffs
==
--- head/contrib/jemalloc/FREEBSD-diffs Fri May 13 21:17:49 2016
(r299699)
+++ head/contrib/jemalloc/FREEBSD-diffs Fri May 13 21:18:10 2016
(r299700)
@@ -46,6 +46,38 @@ index c4a44e3..4626e9b 100644
 +in FreeBSD 11.0.
 +  
  
+diff --git a/include/jemalloc/internal/arena.h 
b/include/jemalloc/internal/arena.h
+index b1de2b6..da6b6d2 100644
+--- a/include/jemalloc/internal/arena.h
 b/include/jemalloc/internal/arena.h
+@@ -718,8 +718,13 @@ arena_miscelm_get_mutable(arena_chunk_t *chunk, size_t 
pageind)
+ JEMALLOC_ALWAYS_INLINE const arena_chunk_map_misc_t *
+ arena_miscelm_get_const(const arena_chunk_t *chunk, size_t pageind)
+ {
++#if 1 /* Work around gcc bug. */
++  arena_chunk_t *mchunk = (arena_chunk_t *)chunk;
+ 
++  return (arena_miscelm_get_mutable(mchunk, pageind));
++#else
+   return (arena_miscelm_get_mutable((arena_chunk_t *)chunk, pageind));
++#endif
+ }
+ 
+ JEMALLOC_ALWAYS_INLINE size_t
+@@ -778,8 +783,13 @@ arena_mapbitsp_get_mutable(arena_chunk_t *chunk, size_t 
pageind)
+ JEMALLOC_ALWAYS_INLINE const size_t *
+ arena_mapbitsp_get_const(const arena_chunk_t *chunk, size_t pageind)
+ {
++#if 1 /* Work around gcc bug. */
++  arena_chunk_t *mchunk = (arena_chunk_t *)chunk;
+ 
++  return (arena_mapbitsp_get_mutable(mchunk, pageind));
++#else
+   return (arena_mapbitsp_get_mutable((arena_chunk_t *)chunk, pageind));
++#endif
+ }
+ 
+ JEMALLOC_ALWAYS_INLINE size_t
 diff --git a/include/jemalloc/internal/jemalloc_internal.h.in 
b/include/jemalloc/internal/jemalloc_internal.h.in
 index 51bf897..7de22ea 100644
 --- a/include/jemalloc/internal/jemalloc_internal.h.in

Modified: head/contrib/jemalloc/include/jemalloc/internal/arena.h
==
--- head/contrib/jemalloc/include/jemalloc/internal/arena.h Fri May 13 
21:17:49 2016(r299699)
+++ head/contrib/jemalloc/include/jemalloc/internal/arena.h Fri May 13 
21:18:10 2016(r299700)
@@ -718,8 +718,13 @@ arena_miscelm_get_mutable(arena_chunk_t 
 JEMALLOC_ALWAYS_INLINE const arena_chunk_map_misc_t *
 arena_miscelm_get_const(const arena_chunk_t *chunk, size_t pageind)
 {
+#if 1 /* Work around gcc bug. */
+   arena_chunk_t *mchunk = (arena_chunk_t *)chunk;
 
+   return (arena_miscelm_get_mutable(mchunk, pageind));
+#else
return (arena_miscelm_get_mutable((arena_chunk_t *)chunk, pageind));
+#endif
 }
 
 JEMALLOC_ALWAYS_INLINE size_t
@@ -778,8 +783,13 @@ arena_mapbitsp_get_mutable(arena_chunk_t
 JEMALLOC_ALWAYS_INLINE const size_t *
 arena_mapbitsp_get_const(const arena_chunk_t *chunk, size_t pageind)
 {
+#if 1 /* Work around gcc bug. */
+   arena_chunk_t *mchunk = (arena_chunk_t *)chunk;
 
+   return (arena_mapbitsp_get_mutable(mchunk, pageind));
+#else
return (arena_mapbitsp_get_mutable((arena_chunk_t *)chunk, pageind));
+#endif
 }
 
 JEMALLOC_ALWAYS_INLINE size_t
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r299587 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src lib/libc/stdlib/jemalloc

2016-05-13 Thread Jason Evans
On May 12, 2016, at 9:03 PM, Jason Evans <jas...@freebsd.org> wrote:
> 
> Author: jasone
> Date: Fri May 13 04:03:20 2016
> New Revision: 299587
> URL: https://svnweb.freebsd.org/changeset/base/299587
> 
> Log:
>  Update jemalloc to 4.2.0.
> 
> [...]

This trips on an invalid gcc warning for at least mips64 and ppc64.  I'm 
compile-testing a probable workaround right now.

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


svn commit: r299587 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src lib/libc/stdlib/jemalloc

2016-05-12 Thread Jason Evans
FreeBSD.h"
  EOF
 diff --git a/src/jemalloc.c b/src/jemalloc.c
-index 0735376..a34b85c 100644
+index 40eb2ea..666c49d 100644
 --- a/src/jemalloc.c
 +++ b/src/jemalloc.c
 @@ -4,6 +4,10 @@
@@ -314,7 +317,7 @@ index 0735376..a34b85c 100644
  /* Runtime configuration options. */
  const char*je_malloc_conf JEMALLOC_ATTR(weak);
  bool  opt_abort =
-@@ -2611,6 +2615,107 @@ je_malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void 
*ptr)
+@@ -2673,6 +2677,107 @@ je_malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void 
*ptr)
   */
  
/**/
  /*
@@ -341,7 +344,7 @@ index 0735376..a34b85c 100644
 +  if (p == NULL)
 +  return (ALLOCM_ERR_OOM);
 +  if (rsize != NULL)
-+  *rsize = isalloc(p, config_prof);
++  *rsize = isalloc(tsdn_fetch(), p, config_prof);
 +  *ptr = p;
 +  return (ALLOCM_SUCCESS);
 +}
@@ -370,7 +373,7 @@ index 0735376..a34b85c 100644
 +  } else
 +  ret = ALLOCM_ERR_OOM;
 +  if (rsize != NULL)
-+  *rsize = isalloc(*ptr, config_prof);
++  *rsize = isalloc(tsdn_fetch(), *ptr, config_prof);
 +  }
 +  return (ret);
 +}
@@ -422,8 +425,8 @@ index 0735376..a34b85c 100644
   * The following functions are used by threading libraries for protection of
   * malloc during fork().
   */
-@@ -2717,4 +2822,11 @@ jemalloc_postfork_child(void)
-   ctl_postfork_child();
+@@ -2814,4 +2919,11 @@ jemalloc_postfork_child(void)
+   ctl_postfork_child(tsd_tsdn(tsd));
  }
  
 +void
@@ -435,7 +438,7 @@ index 0735376..a34b85c 100644
 +
  
/**/
 diff --git a/src/mutex.c b/src/mutex.c
-index 2d47af9..934d5aa 100644
+index a1fac34..a24e420 100644
 --- a/src/mutex.c
 +++ b/src/mutex.c
 @@ -66,6 +66,17 @@ pthread_create(pthread_t *__restrict thread,
@@ -456,22 +459,22 @@ index 2d47af9..934d5aa 100644
  #endif
  
  bool
-@@ -137,7 +148,7 @@ malloc_mutex_postfork_child(malloc_mutex_t *mutex)
+@@ -140,7 +151,7 @@ malloc_mutex_postfork_child(tsdn_t *tsdn, malloc_mutex_t 
*mutex)
  }
  
  bool
--mutex_boot(void)
+-malloc_mutex_boot(void)
 +malloc_mutex_first_thread(void)
  {
  
  #ifdef JEMALLOC_MUTEX_INIT_CB
-@@ -151,3 +162,14 @@ mutex_boot(void)
+@@ -154,3 +165,14 @@ malloc_mutex_boot(void)
  #endif
return (false);
  }
 +
 +bool
-+mutex_boot(void)
++malloc_mutex_boot(void)
 +{
 +
 +#ifndef JEMALLOC_MUTEX_INIT_CB
@@ -481,10 +484,10 @@ index 2d47af9..934d5aa 100644
 +#endif
 +}
 diff --git a/src/util.c b/src/util.c
-index 02673c7..116e981 100644
+index a1c4a2a..04f9153 100644
 --- a/src/util.c
 +++ b/src/util.c
-@@ -66,6 +66,22 @@ wrtmessage(void *cbopaque, const char *s)
+@@ -67,6 +67,22 @@ wrtmessage(void *cbopaque, const char *s)
  
  JEMALLOC_EXPORT void  (*je_malloc_message)(void *, const char *s);
  

Modified: head/contrib/jemalloc/VERSION
==
--- head/contrib/jemalloc/VERSION   Fri May 13 02:58:11 2016
(r299586)
+++ head/contrib/jemalloc/VERSION   Fri May 13 04:03:20 2016
(r299587)
@@ -1 +1 @@
-4.1.0-1-g994da4232621dd1210fcf39bdf0d6454cefda473
+4.2.0-1-gdc7ff6306d7a15b53479e2fb8e5546404b82e6fc

Modified: head/contrib/jemalloc/doc/jemalloc.3
==
--- head/contrib/jemalloc/doc/jemalloc.3Fri May 13 02:58:11 2016
(r299586)
+++ head/contrib/jemalloc/doc/jemalloc.3Fri May 13 04:03:20 2016
(r299587)
@@ -2,12 +2,12 @@
 .\" Title: JEMALLOC
 .\"Author: Jason Evans
 .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\"  Date: 02/28/2016
+.\"  Date: 05/12/2016
 .\"Manual: User Manual
-.\"Source: jemalloc 4.1.0-1-g994da4232621dd1210fcf39bdf0d6454cefda473
+.\"Source: jemalloc 4.2.0-1-gdc7ff6306d7a15b53479e2fb8e5546404b82e6fc
 .\"  Language: English
 .\"
-.TH "JEMALLOC" "3" "02/28/2016" "jemalloc 4.1.0-1-g994da4232621" "User Manual"
+.TH "JEMALLOC" "3" "05/12/2016" "jemalloc 4.2.0-1-gdc7ff6306d7a" "User Manual"
 .\" -
 .\" * Define some portability stuff
 .\" -
@@ -31,7 +31,7 @@
 jemalloc \- general purpose memory allocation functions
 .SH "LIBRARY"
 .PP
-This manual describes jemalloc 
4\&.1\&.0\-1\-g994da4232621dd1210fcf39bdf0d6454cefda473\&. More information can 
be found at the
+This manual describes jemalloc 
4\&.2\&.0\-1\-gdc7ff6306d7a15b53479e2fb8e5546404b82e6fc\&. More information can 
be found at the
 \m[blue]\fBjemalloc website\fR\m[]\&\s-2\u[1]\d\s+2\&

svn commit: r296334 - head/contrib/jemalloc/src

2016-03-02 Thread Jason Evans
Author: jasone
Date: Thu Mar  3 01:43:36 2016
New Revision: 296334
URL: https://svnweb.freebsd.org/changeset/base/296334

Log:
  Restore support for decay time of -1 (no decay).

Modified:
  head/contrib/jemalloc/src/arena.c

Modified: head/contrib/jemalloc/src/arena.c
==
--- head/contrib/jemalloc/src/arena.c   Thu Mar  3 01:41:53 2016
(r296333)
+++ head/contrib/jemalloc/src/arena.c   Thu Mar  3 01:43:36 2016
(r296334)
@@ -1352,7 +1352,11 @@ static bool
 arena_decay_time_valid(ssize_t decay_time)
 {
 
-   return (decay_time >= -1 && (uint64_t)decay_time <= NSTIME_SEC_MAX);
+   if (decay_time < -1)
+   return (false);
+   if (decay_time == -1 || (uint64_t)decay_time <= NSTIME_SEC_MAX)
+   return (true);
+   return (false);
 }
 
 ssize_t
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r296332 - in head/contrib/jemalloc: include/jemalloc/internal src

2016-03-02 Thread Jason Evans
Author: jasone
Date: Thu Mar  3 01:30:28 2016
New Revision: 296332
URL: https://svnweb.freebsd.org/changeset/base/296332

Log:
  Add a cast to prevent a compiler warning.

Modified:
  head/contrib/jemalloc/include/jemalloc/internal/nstime.h
  head/contrib/jemalloc/src/arena.c

Modified: head/contrib/jemalloc/include/jemalloc/internal/nstime.h
==
--- head/contrib/jemalloc/include/jemalloc/internal/nstime.hThu Mar  3 
01:12:13 2016(r296331)
+++ head/contrib/jemalloc/include/jemalloc/internal/nstime.hThu Mar  3 
01:30:28 2016(r296332)
@@ -7,7 +7,7 @@
 typedef struct nstime_s nstime_t;
 
 /* Maximum supported number of seconds (~584 years). */
-#defineNSTIME_SEC_MAX  18446744072
+#defineNSTIME_SEC_MAX  KQU(18446744072)
 
 #endif /* JEMALLOC_H_TYPES */
 
/**/

Modified: head/contrib/jemalloc/src/arena.c
==
--- head/contrib/jemalloc/src/arena.c   Thu Mar  3 01:12:13 2016
(r296331)
+++ head/contrib/jemalloc/src/arena.c   Thu Mar  3 01:30:28 2016
(r296332)
@@ -1352,7 +1352,7 @@ static bool
 arena_decay_time_valid(ssize_t decay_time)
 {
 
-   return (decay_time >= -1 && decay_time <= NSTIME_SEC_MAX);
+   return (decay_time >= -1 && (uint64_t)decay_time <= NSTIME_SEC_MAX);
 }
 
 ssize_t
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r296221 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/stdlib/jemalloc

2016-02-29 Thread Jason Evans
Author: jasone
Date: Mon Feb 29 19:10:32 2016
New Revision: 296221
URL: https://svnweb.freebsd.org/changeset/base/296221

Log:
  Update jemalloc to 4.1.0.
  
  Add missing Symbol.map entry for __aligned_alloc.
  
  Add weak-->strong symbol binding for
  {malloc_stats_print,mallctl,mallctlnametomib,mallctlbymib} -->
  {__malloc_stats_print,__mallctl,__mallctlnametomib,__mallctlbymib}.  These
  bindings complete the set necessary to allow applications to replace all
  malloc-related symbols.

Added:
  head/contrib/jemalloc/include/jemalloc/internal/assert.h   (contents, props 
changed)
  head/contrib/jemalloc/include/jemalloc/internal/nstime.h   (contents, props 
changed)
  head/contrib/jemalloc/include/jemalloc/internal/smoothstep.h   (contents, 
props changed)
  head/contrib/jemalloc/include/jemalloc/internal/ticker.h   (contents, props 
changed)
  head/contrib/jemalloc/src/nstime.c   (contents, props changed)
  head/contrib/jemalloc/src/prng.c   (contents, props changed)
  head/contrib/jemalloc/src/ticker.c   (contents, props changed)
Modified:
  head/contrib/jemalloc/COPYING
  head/contrib/jemalloc/ChangeLog
  head/contrib/jemalloc/FREEBSD-Xlist
  head/contrib/jemalloc/FREEBSD-diffs
  head/contrib/jemalloc/VERSION
  head/contrib/jemalloc/doc/jemalloc.3
  head/contrib/jemalloc/include/jemalloc/internal/arena.h
  head/contrib/jemalloc/include/jemalloc/internal/atomic.h
  head/contrib/jemalloc/include/jemalloc/internal/bitmap.h
  head/contrib/jemalloc/include/jemalloc/internal/chunk_mmap.h
  head/contrib/jemalloc/include/jemalloc/internal/ckh.h
  head/contrib/jemalloc/include/jemalloc/internal/ctl.h
  head/contrib/jemalloc/include/jemalloc/internal/hash.h
  head/contrib/jemalloc/include/jemalloc/internal/huge.h
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
  head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h
  head/contrib/jemalloc/include/jemalloc/internal/prng.h
  head/contrib/jemalloc/include/jemalloc/internal/prof.h
  head/contrib/jemalloc/include/jemalloc/internal/rb.h
  head/contrib/jemalloc/include/jemalloc/internal/size_classes.h
  head/contrib/jemalloc/include/jemalloc/internal/stats.h
  head/contrib/jemalloc/include/jemalloc/internal/tcache.h
  head/contrib/jemalloc/include/jemalloc/internal/tsd.h
  head/contrib/jemalloc/include/jemalloc/internal/util.h
  head/contrib/jemalloc/include/jemalloc/jemalloc.h
  head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h
  head/contrib/jemalloc/src/arena.c
  head/contrib/jemalloc/src/bitmap.c
  head/contrib/jemalloc/src/chunk.c
  head/contrib/jemalloc/src/chunk_mmap.c
  head/contrib/jemalloc/src/ckh.c
  head/contrib/jemalloc/src/ctl.c
  head/contrib/jemalloc/src/extent.c
  head/contrib/jemalloc/src/huge.c
  head/contrib/jemalloc/src/jemalloc.c
  head/contrib/jemalloc/src/prof.c
  head/contrib/jemalloc/src/quarantine.c
  head/contrib/jemalloc/src/stats.c
  head/contrib/jemalloc/src/tcache.c
  head/contrib/jemalloc/src/tsd.c
  head/contrib/jemalloc/src/util.c
  head/include/malloc_np.h
  head/lib/libc/stdlib/jemalloc/Makefile.inc
  head/lib/libc/stdlib/jemalloc/Symbol.map

Modified: head/contrib/jemalloc/COPYING
==
--- head/contrib/jemalloc/COPYING   Mon Feb 29 18:58:26 2016
(r296220)
+++ head/contrib/jemalloc/COPYING   Mon Feb 29 19:10:32 2016
(r296221)
@@ -1,10 +1,10 @@
 Unless otherwise specified, files in the jemalloc source distribution are
 subject to the following license:
 

-Copyright (C) 2002-2015 Jason Evans <jas...@canonware.com>.
+Copyright (C) 2002-2016 Jason Evans <jas...@canonware.com>.
 All rights reserved.
 Copyright (C) 2007-2012 Mozilla Foundation.  All rights reserved.
-Copyright (C) 2009-2015 Facebook, Inc.  All rights reserved.
+Copyright (C) 2009-2016 Facebook, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:

Modified: head/contrib/jemalloc/ChangeLog
==
--- head/contrib/jemalloc/ChangeLog Mon Feb 29 18:58:26 2016
(r296220)
+++ head/contrib/jemalloc/ChangeLog Mon Feb 29 19:10:32 2016
(r296221)
@@ -4,6 +4,79 @@ brevity.  Much more detail can be found 
 
 https://github.com/jemalloc/jemalloc
 
+* 4.1.0 (February 28, 2016)
+
+  This release is primarily about optimizations, but it also incorporates a lot
+  of portability-motivated refactoring and enhancements.  Many people worked on
+  this release, to an extent that even with the omission here of minor changes
+  (see git revision history), and of the people who reported and d

svn commit: r289900 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src

2015-10-24 Thread Jason Evans
Author: jasone
Date: Sat Oct 24 23:18:05 2015
New Revision: 289900
URL: https://svnweb.freebsd.org/changeset/base/289900

Log:
  Update jemalloc to version 4.0.4.

Modified:
  head/contrib/jemalloc/ChangeLog
  head/contrib/jemalloc/FREEBSD-diffs
  head/contrib/jemalloc/VERSION
  head/contrib/jemalloc/doc/jemalloc.3
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h
  head/contrib/jemalloc/include/jemalloc/jemalloc.h
  head/contrib/jemalloc/src/arena.c
  head/contrib/jemalloc/src/huge.c
  head/contrib/jemalloc/src/prof.c
  head/contrib/jemalloc/src/tsd.c

Modified: head/contrib/jemalloc/ChangeLog
==
--- head/contrib/jemalloc/ChangeLog Sat Oct 24 23:16:13 2015
(r289899)
+++ head/contrib/jemalloc/ChangeLog Sat Oct 24 23:18:05 2015
(r289900)
@@ -4,6 +4,32 @@ brevity.  Much more detail can be found 
 
 https://github.com/jemalloc/jemalloc
 
+* 4.0.4 (October 24, 2015)
+
+  This bugfix release fixes another xallocx() regression.  No other regressions
+  have come to light in over a month, so this is likely a good starting point
+  for people who prefer to wait for "dot one" releases with all the major 
issues
+  shaken out.
+
+  Bug fixes:
+  - Fix xallocx(..., MALLOCX_ZERO to zero the last full trailing page of large
+allocations that have been randomly assigned an offset of 0 when
+--enable-cache-oblivious configure option is enabled.
+
+* 4.0.3 (September 24, 2015)
+
+  This bugfix release continues the trend of xallocx() and heap profiling 
fixes.
+
+  Bug fixes:
+  - Fix xallocx(..., MALLOCX_ZERO) to zero all trailing bytes of large
+allocations when --enable-cache-oblivious configure option is enabled.
+  - Fix xallocx(..., MALLOCX_ZERO) to zero trailing bytes of huge allocations
+when resizing from/to a size class that is not a multiple of the chunk 
size.
+  - Fix prof_tctx_dump_iter() to filter out nodes that were created after heap
+profile dumping started.
+  - Work around a potentially bad thread-specific data initialization
+interaction with NPTL (glibc's pthreads implementation).
+
 * 4.0.2 (September 21, 2015)
 
   This bugfix release addresses a few bugs specific to heap profiling.

Modified: head/contrib/jemalloc/FREEBSD-diffs
==
--- head/contrib/jemalloc/FREEBSD-diffs Sat Oct 24 23:16:13 2015
(r289899)
+++ head/contrib/jemalloc/FREEBSD-diffs Sat Oct 24 23:18:05 2015
(r289900)
@@ -1,5 +1,5 @@
 diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in
-index 8fc774b..fdbef95 100644
+index 26a5e14..2a801b7 100644
 --- a/doc/jemalloc.xml.in
 +++ b/doc/jemalloc.xml.in
 @@ -53,11 +53,23 @@
@@ -47,7 +47,7 @@ index 8fc774b..fdbef95 100644
 +  
  
 diff --git a/include/jemalloc/internal/jemalloc_internal.h.in 
b/include/jemalloc/internal/jemalloc_internal.h.in
-index 8536a3e..0c2a81f 100644
+index 654cd08..ad5382d 100644
 --- a/include/jemalloc/internal/jemalloc_internal.h.in
 +++ b/include/jemalloc/internal/jemalloc_internal.h.in
 @@ -8,6 +8,9 @@

Modified: head/contrib/jemalloc/VERSION
==
--- head/contrib/jemalloc/VERSION   Sat Oct 24 23:16:13 2015
(r289899)
+++ head/contrib/jemalloc/VERSION   Sat Oct 24 23:18:05 2015
(r289900)
@@ -1 +1 @@
-4.0.2-0-g486d249fb4715fd3de679b6c2a04f7e657883111
+4.0.4-0-g91010a9e2ebfc84b1ac1ed7fdde3bfed4f65f180

Modified: head/contrib/jemalloc/doc/jemalloc.3
==
--- head/contrib/jemalloc/doc/jemalloc.3Sat Oct 24 23:16:13 2015
(r289899)
+++ head/contrib/jemalloc/doc/jemalloc.3Sat Oct 24 23:18:05 2015
(r289900)
@@ -2,12 +2,12 @@
 .\" Title: JEMALLOC
 .\"    Author: Jason Evans
 .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\"  Date: 09/21/2015
+.\"  Date: 10/24/2015
 .\"Manual: User Manual
-.\"Source: jemalloc 4.0.2-0-g486d249fb4715fd3de679b6c2a04f7e657883111
+.\"Source: jemalloc 4.0.4-0-g91010a9e2ebfc84b1ac1ed7fdde3bfed4f65f180
 .\"  Language: English
 .\"
-.TH "JEMALLOC" "3" "09/21/2015" "jemalloc 4.0.2-0-g486d249fb471" "User Manual"
+.TH "JEMALLOC" "3" "10/24/2015" "jemalloc 4.0.4-0-g91010a9e2ebf" "User Manual"
 .\" -
 .\" * Define some portability stuff
 .\" -
@@ -31,7 +31,7 @@
 jemalloc \- general purpose memory allocation functions
 .SH "LIBRARY"
 .PP
-This manual describes jemalloc 
4\&.0\&.2\-0\-g486d249fb4715fd3de679b6c2a04f7e657883111\&. More informatio

svn commit: r288090 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src

2015-09-21 Thread Jason Evans
ting type on Solaris.
++ Add JEMALLOC_CXX_THROW to the memalign() function prototype, in order to
+  match glibc and avoid compilation errors when including both
+  jemalloc/jemalloc.h and malloc.h in C++ code.
++ Don't assume that /bin/sh is appropriate when running size_classes.sh
+  during configuration.
++ Consider __sparcv9 a synonym for __sparc64__ when defining LG_QUANTUM.
++ Link tests to librt if it contains clock_gettime(2).
+
 * 4.0.0 (August 17, 2015)
 
   This version contains many speed and space optimizations, both minor and

Modified: head/contrib/jemalloc/FREEBSD-diffs
==
--- head/contrib/jemalloc/FREEBSD-diffs Tue Sep 22 02:57:18 2015
(r288089)
+++ head/contrib/jemalloc/FREEBSD-diffs Tue Sep 22 03:02:18 2015
(r288090)
@@ -47,7 +47,7 @@ index 8fc774b..fdbef95 100644
 +  
  
 diff --git a/include/jemalloc/internal/jemalloc_internal.h.in 
b/include/jemalloc/internal/jemalloc_internal.h.in
-index 7a137b6..b0001e9 100644
+index 8536a3e..0c2a81f 100644
 --- a/include/jemalloc/internal/jemalloc_internal.h.in
 +++ b/include/jemalloc/internal/jemalloc_internal.h.in
 @@ -8,6 +8,9 @@
@@ -111,10 +111,10 @@ index f051f29..561378f 100644
  
  #endif /* JEMALLOC_H_EXTERNS */
 diff --git a/include/jemalloc/internal/private_symbols.txt 
b/include/jemalloc/internal/private_symbols.txt
-index dbf6aa7..f87dba8 100644
+index a90021a..34904bf 100644
 --- a/include/jemalloc/internal/private_symbols.txt
 +++ b/include/jemalloc/internal/private_symbols.txt
-@@ -277,7 +277,6 @@ iralloct_realign
+@@ -280,7 +280,6 @@ iralloct_realign
  isalloc
  isdalloct
  isqalloc
@@ -282,7 +282,7 @@ index f943891..47d032c 100755
 +#include "jemalloc_FreeBSD.h"
  EOF
 diff --git a/src/jemalloc.c b/src/jemalloc.c
-index ed7863b..d078a1f 100644
+index 5a2d324..b6cbb79 100644
 --- a/src/jemalloc.c
 +++ b/src/jemalloc.c
 @@ -4,6 +4,10 @@
@@ -296,7 +296,7 @@ index ed7863b..d078a1f 100644
  /* Runtime configuration options. */
  const char*je_malloc_conf JEMALLOC_ATTR(weak);
  bool  opt_abort =
-@@ -2475,6 +2479,107 @@ je_malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void 
*ptr)
+@@ -2490,6 +2494,107 @@ je_malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void 
*ptr)
   */
  
/**/
  /*
@@ -404,7 +404,7 @@ index ed7863b..d078a1f 100644
   * The following functions are used by threading libraries for protection of
   * malloc during fork().
   */
-@@ -2575,4 +2680,11 @@ jemalloc_postfork_child(void)
+@@ -2590,4 +2695,11 @@ jemalloc_postfork_child(void)
ctl_postfork_child();
  }
  

Modified: head/contrib/jemalloc/VERSION
==
--- head/contrib/jemalloc/VERSION   Tue Sep 22 02:57:18 2015
(r288089)
+++ head/contrib/jemalloc/VERSION   Tue Sep 22 03:02:18 2015
(r288090)
@@ -1 +1 @@
-4.0.0-0-g6e98caf8f064482b9ab292ef3638dea67420bbc2
+4.0.2-0-g486d249fb4715fd3de679b6c2a04f7e657883111

Modified: head/contrib/jemalloc/doc/jemalloc.3
==
--- head/contrib/jemalloc/doc/jemalloc.3Tue Sep 22 02:57:18 2015
(r288089)
+++ head/contrib/jemalloc/doc/jemalloc.3Tue Sep 22 03:02:18 2015
(r288090)
@@ -2,12 +2,12 @@
 .\"     Title: JEMALLOC
 .\"Author: Jason Evans
 .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\"  Date: 08/18/2015
+.\"  Date: 09/21/2015
 .\"Manual: User Manual
-.\"Source: jemalloc 4.0.0-0-g6e98caf8f064482b9ab292ef3638dea67420bbc2
+.\"Source: jemalloc 4.0.2-0-g486d249fb4715fd3de679b6c2a04f7e657883111
 .\"  Language: English
 .\"
-.TH "JEMALLOC" "3" "08/18/2015" "jemalloc 4.0.0-0-g6e98caf8f064" "User Manual"
+.TH "JEMALLOC" "3" "09/21/2015" "jemalloc 4.0.2-0-g486d249fb471" "User Manual"
 .\" -
 .\" * Define some portability stuff
 .\" -
@@ -31,7 +31,7 @@
 jemalloc \- general purpose memory allocation functions
 .SH "LIBRARY"
 .PP
-This manual describes jemalloc 
4\&.0\&.0\-0\-g6e98caf8f064482b9ab292ef3638dea67420bbc2\&. More information can 
be found at the
+This manual describes jemalloc 
4\&.0\&.2\-0\-g486d249fb4715fd3de679b6c2a04f7e657883111\&. More information can 
be found at the
 \m[blue]\fBjemalloc website\fR\m[]\&\s-2\u[1]\d\s+2\&.
 .PP
 The following configuration options are enabled in libc\*(Aqs built\-in 
jemalloc:

Modified: head/contrib/jemalloc/include/jemalloc/internal/arena.h

svn commit: r286934 - head/include

2015-08-19 Thread Jason Evans
Author: jasone
Date: Wed Aug 19 18:32:12 2015
New Revision: 286934
URL: https://svnweb.freebsd.org/changeset/base/286934

Log:
  Use bool rather than _Bool for C++ compatibility.
  
  Submitted by: Nikolai Lifanov

Modified:
  head/include/malloc_np.h

Modified: head/include/malloc_np.h
==
--- head/include/malloc_np.hWed Aug 19 18:24:39 2015(r286933)
+++ head/include/malloc_np.hWed Aug 19 18:32:12 2015(r286934)
@@ -33,17 +33,17 @@
 #define_MALLOC_NP_H_
 #include sys/cdefs.h
 #include sys/types.h
+#include stdbool.h
 #include strings.h
 
 __BEGIN_DECLS
-typedef void *(chunk_alloc_t)(void *, size_t, size_t, _Bool *, _Bool *,
-unsigned);
-typedef _Bool (chunk_dalloc_t)(void *, size_t, _Bool, unsigned);
-typedef _Bool (chunk_commit_t)(void *, size_t, size_t, size_t, unsigned);
-typedef _Bool (chunk_decommit_t)(void *, size_t, size_t, size_t, unsigned);
-typedef _Bool (chunk_purge_t)(void *, size_t, size_t, size_t, unsigned);
-typedef _Bool (chunk_split_t)(void *, size_t, size_t, size_t, _Bool, unsigned);
-typedef _Bool (chunk_merge_t)(void *, size_t, void *, size_t, _Bool, unsigned);
+typedef void *(chunk_alloc_t)(void *, size_t, size_t, bool *, bool *, 
unsigned);
+typedef bool (chunk_dalloc_t)(void *, size_t, bool, unsigned);
+typedef bool (chunk_commit_t)(void *, size_t, size_t, size_t, unsigned);
+typedef bool (chunk_decommit_t)(void *, size_t, size_t, size_t, unsigned);
+typedef bool (chunk_purge_t)(void *, size_t, size_t, size_t, unsigned);
+typedef bool (chunk_split_t)(void *, size_t, size_t, size_t, bool, unsigned);
+typedef bool (chunk_merge_t)(void *, size_t, void *, size_t, bool, unsigned);
 typedef struct {
chunk_alloc_t   *alloc;
chunk_dalloc_t  *dalloc;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r286871 - head/contrib/jemalloc/include/jemalloc

2015-08-18 Thread Jason Evans
Author: jasone
Date: Tue Aug 18 08:10:46 2015
New Revision: 286871
URL: https://svnweb.freebsd.org/changeset/base/286871

Log:
  Fix build failure due to missing CPU_SPINWAIT definition.

Modified:
  head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h

Modified: head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h
==
--- head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h   Tue Aug 18 
06:28:37 2015(r286870)
+++ head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h   Tue Aug 18 
08:10:46 2015(r286871)
@@ -57,6 +57,10 @@
 #  define JEMALLOC_TLS_MODEL   /* Default. */
 #endif
 
+#ifndef CPU_SPINWAIT
+#  define CPU_SPINWAIT do {} while (0)
+#endif
+
 #defineSTATIC_PAGE_SHIFT   PAGE_SHIFT
 #defineLG_SIZEOF_INT   2
 #defineLG_SIZEOF_LONG  LG_SIZEOF_PTR
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r286877 - in head/contrib/jemalloc: . include/jemalloc

2015-08-18 Thread Jason Evans
Author: jasone
Date: Tue Aug 18 09:09:27 2015
New Revision: 286877
URL: https://svnweb.freebsd.org/changeset/base/286877

Log:
  Re-add LG_SIZEOF_PTR definition for __aarch64__.
  
  This definition was erroneously removed during the 4.0.0 import.

Modified:
  head/contrib/jemalloc/FREEBSD-diffs
  head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h

Modified: head/contrib/jemalloc/FREEBSD-diffs
==
--- head/contrib/jemalloc/FREEBSD-diffs Tue Aug 18 09:05:59 2015
(r286876)
+++ head/contrib/jemalloc/FREEBSD-diffs Tue Aug 18 09:09:27 2015
(r286877)
@@ -117,10 +117,10 @@ index dbf6aa7..f87dba8 100644
  jemalloc_postfork_child
 diff --git a/include/jemalloc/jemalloc_FreeBSD.h 
b/include/jemalloc/jemalloc_FreeBSD.h
 new file mode 100644
-index 000..66d6da5
+index 000..c5113b9
 --- /dev/null
 +++ b/include/jemalloc/jemalloc_FreeBSD.h
-@@ -0,0 +1,137 @@
+@@ -0,0 +1,144 @@
 +/*
 + * Override settings that were generated in jemalloc_defs.h as necessary.
 + */
@@ -163,6 +163,9 @@ index 000..66d6da5
 +#ifdef __arm__
 +#  define LG_SIZEOF_PTR   2
 +#endif
++#ifdef __aarch64__
++#  define LG_SIZEOF_PTR   3
++#endif
 +#ifdef __mips__
 +#ifdef __mips_n64
 +#  define LG_SIZEOF_PTR   3
@@ -180,6 +183,10 @@ index 000..66d6da5
 +#  define JEMALLOC_TLS_MODEL  /* Default. */
 +#endif
 +
++#ifndef CPU_SPINWAIT
++#  define CPU_SPINWAIT do {} while (0)
++#endif
++
 +#define   STATIC_PAGE_SHIFT   PAGE_SHIFT
 +#define   LG_SIZEOF_INT   2
 +#define   LG_SIZEOF_LONG  LG_SIZEOF_PTR

Modified: head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h
==
--- head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h   Tue Aug 18 
09:05:59 2015(r286876)
+++ head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h   Tue Aug 18 
09:09:27 2015(r286877)
@@ -40,6 +40,9 @@
 #ifdef __arm__
 #  define LG_SIZEOF_PTR2
 #endif
+#ifdef __aarch64__
+#  define LG_SIZEOF_PTR3
+#endif
 #ifdef __mips__
 #ifdef __mips_n64
 #  define LG_SIZEOF_PTR3
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r286866 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/gen lib/libc

2015-08-18 Thread Jason Evans
On Aug 17, 2015, at 9:35 PM, Jan Beich jbe...@freebsd.org wrote:
 Jason Evans jas...@freebsd.org writes:
 
 Author: jasone
 Date: Tue Aug 18 00:21:25 2015
 New Revision: 286866
 URL: https://svnweb.freebsd.org/changeset/base/286866
 
 Log:
  Update jemalloc to version 4.0.0.
 
 Can you bump __FreeBSD_version for non-standard API changes? Some ports
 like www/firefox may want to take advantage of it without complicating
 configure scripts.

Done.

 +  - Add sdallocx(), which implements sized deallocation.  The primary
 +optimization over dallocx() is the removal of a metadata read, which 
 often
 +suffers an L1 cache miss.
 [...]
 +  - Remove the *allocm() API, which is superseded by the *allocx() API.
 
 Symbol.map and manpages haven't been updated.
 [...]

Committed; thanks!

Jason

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


Re: svn commit: r286866 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/gen lib/libc

2015-08-18 Thread Jason Evans
On Aug 17, 2015, at 6:16 PM, NGie Cooper yaneurab...@gmail.com wrote:
 On Mon, Aug 17, 2015 at 5:21 PM, Jason Evans jas...@freebsd.org wrote:
 Author: jasone
 Date: Tue Aug 18 00:21:25 2015
 New Revision: 286866
 URL: https://svnweb.freebsd.org/changeset/base/286866
 
 Log:
  Update jemalloc to version 4.0.0.
 
 Relnotes: yes!
 
 Also, is there a summary of the changes that can be provided here, or
 should the reader get this information from the ChangeLog?

The ChangeLog is rather long, and part of the commit itself.  See 
src/contrib/jemalloc/ChangeLog or 
https://github.com/jemalloc/jemalloc/releases/tag/4.0.0 .

Thanks,
Jason
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r286872 - head/lib/libc/stdlib/jemalloc

2015-08-18 Thread Jason Evans
Author: jasone
Date: Tue Aug 18 08:18:28 2015
New Revision: 286872
URL: https://svnweb.freebsd.org/changeset/base/286872

Log:
  Add missing sdallocx updates and remove *allocm manpage links.
  
  Submitted by: jbeich

Modified:
  head/lib/libc/stdlib/jemalloc/Makefile.inc
  head/lib/libc/stdlib/jemalloc/Symbol.map

Modified: head/lib/libc/stdlib/jemalloc/Makefile.inc
==
--- head/lib/libc/stdlib/jemalloc/Makefile.inc  Tue Aug 18 08:10:46 2015
(r286871)
+++ head/lib/libc/stdlib/jemalloc/Makefile.inc  Tue Aug 18 08:18:28 2015
(r286872)
@@ -40,12 +40,8 @@ MLINKS+= \
jemalloc.3 xallocx.3 \
jemalloc.3 sallocx.3 \
jemalloc.3 dallocx.3 \
+   jemalloc.3 sdallocx.3 \
jemalloc.3 nallocx.3 \
-   jemalloc.3 allocm.3 \
-   jemalloc.3 rallocm.3 \
-   jemalloc.3 sallocm.3 \
-   jemalloc.3 dallocm.3 \
-   jemalloc.3 nallocm.3 \
jemalloc.3 malloc.conf.5
 
 .if defined(MALLOC_PRODUCTION)

Modified: head/lib/libc/stdlib/jemalloc/Symbol.map
==
--- head/lib/libc/stdlib/jemalloc/Symbol.mapTue Aug 18 08:10:46 2015
(r286871)
+++ head/lib/libc/stdlib/jemalloc/Symbol.mapTue Aug 18 08:18:28 2015
(r286872)
@@ -51,6 +51,11 @@ FBSD_1.3 {
__nallocm;
 };
 
+FBSD_1.4 {
+   sdallocx;
+   __sdallocx;
+};
+
 FBSDprivate_1.0 {
_malloc_thread_cleanup;
_malloc_prefork;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r286874 - head/sys/sys

2015-08-18 Thread Jason Evans
Author: jasone
Date: Tue Aug 18 08:29:13 2015
New Revision: 286874
URL: https://svnweb.freebsd.org/changeset/base/286874

Log:
  Bump __FreeBSD_version for the jemalloc 4.0.0 import.

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hTue Aug 18 08:27:26 2015(r286873)
+++ head/sys/sys/param.hTue Aug 18 08:29:13 2015(r286874)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1100078  /* Master, propagated to newvers */
+#define __FreeBSD_version 1100079  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r286870 - in head/contrib/jemalloc: . include/jemalloc/internal

2015-08-18 Thread Jason Evans
Author: jasone
Date: Tue Aug 18 06:28:37 2015
New Revision: 286870
URL: https://svnweb.freebsd.org/changeset/base/286870

Log:
  Add jemalloc support for 8 KiB, 16 KiB, and 64 KiB pages.

Modified:
  head/contrib/jemalloc/FREEBSD-upgrade
  head/contrib/jemalloc/include/jemalloc/internal/size_classes.h

Modified: head/contrib/jemalloc/FREEBSD-upgrade
==
--- head/contrib/jemalloc/FREEBSD-upgrade   Tue Aug 18 06:16:19 2015
(r286869)
+++ head/contrib/jemalloc/FREEBSD-upgrade   Tue Aug 18 06:28:37 2015
(r286870)
@@ -74,7 +74,7 @@ do_extract() {
 # Generate various files.
 ./autogen.sh --enable-cc-silence --enable-dss --enable-xmalloc \
   --enable-utrace --with-xslroot=/usr/local/share/xsl/docbook \
-  --with-private-namespace=__
+  --with-private-namespace=__ --with-lg-page-sizes=12,13,14,16
 gmake dist
   )
 }

Modified: head/contrib/jemalloc/include/jemalloc/internal/size_classes.h
==
--- head/contrib/jemalloc/include/jemalloc/internal/size_classes.h  Tue Aug 
18 06:16:19 2015(r286869)
+++ head/contrib/jemalloc/include/jemalloc/internal/size_classes.h  Tue Aug 
18 06:28:37 2015(r286870)
@@ -182,305 +182,313 @@
 #defineLG_LARGE_MINCLASS   14
 #endif
 
-#if (LG_SIZEOF_PTR == 2  LG_TINY_MIN == 3  LG_QUANTUM == 4  LG_PAGE == 
12)
+#if (LG_SIZEOF_PTR == 2  LG_TINY_MIN == 3  LG_QUANTUM == 3  LG_PAGE == 
13)
 #defineSIZE_CLASSES \
   /* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \
 SC(  0,  3,3,  0, yes,  3) \
-   \
 SC(  1,  3,3,  1, yes,  3) \
-SC(  2,  4,4,  1, yes,  4) \
-SC(  3,  4,4,  2, yes,  4) \
-SC(  4,  4,4,  3, yes,  4) \
+SC(  2,  3,3,  2, yes,  3) \
+SC(  3,  3,3,  3, yes,  3) \
\
-SC(  5,  6,4,  1, yes,  4) \
-SC(  6,  6,4,  2, yes,  4) \
-SC(  7,  6,4,  3, yes,  4) \
-SC(  8,  6,4,  4, yes,  4) \
+SC(  4,  5,3,  1, yes,  3) \
+SC(  5,  5,3,  2, yes,  3) \
+SC(  6,  5,3,  3, yes,  3) \
+SC(  7,  5,3,  4, yes,  3) \
\
-SC(  9,  7,5,  1, yes,  5) \
-SC( 10,  7,5,  2, yes,  5) \
-SC( 11,  7,5,  3, yes,  5) \
-SC( 12,  7,5,  4, yes,  5) \
+SC(  8,  6,4,  1, yes,  4) \
+SC(  9,  6,4,  2, yes,  4) \
+SC( 10,  6,4,  3, yes,  4) \
+SC( 11,  6,4,  4, yes,  4) \
\
-SC( 13,  8,6,  1, yes,  6) \
-SC( 14,  8,6,  2, yes,  6) \
-SC( 15,  8,6,  3, yes,  6) \
-SC( 16,  8,6,  4, yes,  6) \
+SC( 12,  7,5,  1, yes,  5) \
+SC( 13,  7,5,  2, yes,  5) \
+SC( 14,  7,5,  3, yes,  5) \
+SC( 15,  7,5,  4, yes,  5) \
\
-SC( 17,  9,7,  1, yes,  7) \
-SC( 18,  9,7,  2, yes,  7) \
-SC( 19,  9,7,  3, yes,  7) \
-SC( 20,  9,7,  4, yes,  7) \
+SC( 16,  8,6,  1, yes,  6) \
+SC( 17,  8,6,  2, yes,  6) \
+SC( 18,  8,6,  3, yes,  6) \
+SC( 19,  8,6,  4, yes,  6) \
\
-SC( 21, 10,8,  1, yes,  8) \
-SC( 22, 10,8,  2, yes,  8) \
-SC( 23, 10,8,  3, yes,  8) \
-SC( 24, 10,8,  4, yes,  8) \
+SC( 20,  9,7,  1, yes,  7) \
+SC( 21,  9,7,  2, yes,  7) \
+SC( 22,  9,7,  3, yes,  7) \
+SC( 23,  9,7,  4, yes,  7) \
\
-SC( 25, 11,9,  1, yes,  9) \
-SC( 26, 11,9,  2, yes,  9) \
-SC( 27, 11,9,  3, yes,  9) \
-SC( 28, 11,9,  4, yes,  9) \
+SC( 24, 10,8,  1, yes,  8) \
+SC( 25, 10,8,  2, yes,  8) \
+SC( 26, 10,8,  3, yes,  8) \
+SC( 27, 10,8,  4, yes,  8) \
\
-SC( 29, 12,   10,  1, yes, no) \
-SC( 30, 12,   10,  2, yes, no) \
-SC( 31, 12,   10,  3, yes, no) \
-SC( 32, 12,   10,  4, yes, 

Re: svn commit: r286866 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/gen lib/libc

2015-08-18 Thread Jason Evans
On Aug 18, 2015, at 2:17 PM, Jilles Tjoelker jil...@stack.nl wrote:
 On Tue, Aug 18, 2015 at 09:49:44PM +0200, Jan Beich wrote:
 Jason Evans jas...@freebsd.org writes:
 Index: include/malloc_np.h
 [...]
 +typedef void *(chunk_alloc_t)(void *, size_t, size_t, bool *, bool *, 
 unsigned);
 +typedef bool (chunk_dalloc_t)(void *, size_t, bool, unsigned);
 
 malloc_np.h changes regressing consumers isn't surprising given the lack
 of tests for jemalloc shipped with FreeBSD.
 
  $ cc -include malloc_np.h -c -xc -/dev/null
  In file included from built-in:311:
  In file included from command line:1:
  /usr/include/malloc_np.h:39:55: error: unknown type name 'bool'
  typedef void *(chunk_alloc_t)(void *, size_t, size_t, bool *, bool *, 
 unsigned);
^
  /usr/include/malloc_np.h:39:63: error: unknown type name 'bool'
  typedef void *(chunk_alloc_t)(void *, size_t, size_t, bool *, bool *, 
 unsigned);
 
 A #include stdbool.h will of course fix this, but by using 1, 0 and
 _Bool instead of true, false and bool you can make it work without
 adding namespace pollution. This might be useful if someone has bool
 defined or typedeffed to something else. Note that only the header files
 need to be uglified this way.

Cool, I'll make that change to the patch I'm currently testing.

 +  - Remove the *allocm() API, which is superseded by the *allocx() API.
 Symbol.map and manpages haven't been updated.
 
 You can't really remove anything from Symbol.map files, since that
 breaks binary compatibility for applications that used the removed
 symbols. Such breakage usually crashes the application if and when it
 attempts to use a removed symbol. To avoid the breakage, wrappers
 invoking the new APIs should be provided; using some special symver
 directives, it is possible to prevent linking new applications against
 the obsolete symbols.

*allocm() compatibility functions are in place, so I think this is correctly 
sorted out.  Jan also pointed out missing entries for sdallocx() in a previous 
email, which I've already committed the fix for (r286872).

 A corollary is that experimental APIs should not be added to Symbol.map.
 It may be better for developers that want to use experimental APIs to
 build jemalloc themselves, or to use jemalloc from ports (although such
 a port doesn't seem to exist, currently).

Yes, exposing *allocm() was a big mistake. :(

Thanks,
Jason
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r286907 - in head/contrib/jemalloc: . include/jemalloc

2015-08-18 Thread Jason Evans
Author: jasone
Date: Tue Aug 18 20:42:08 2015
New Revision: 286907
URL: https://svnweb.freebsd.org/changeset/base/286907

Log:
  Define CPU_SPINWAIT as cpu_spinwait().
  
  Submitted by: cem

Modified:
  head/contrib/jemalloc/FREEBSD-diffs
  head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h

Modified: head/contrib/jemalloc/FREEBSD-diffs
==
--- head/contrib/jemalloc/FREEBSD-diffs Tue Aug 18 20:27:03 2015
(r286906)
+++ head/contrib/jemalloc/FREEBSD-diffs Tue Aug 18 20:42:08 2015
(r286907)
@@ -117,10 +117,10 @@ index dbf6aa7..f87dba8 100644
  jemalloc_postfork_child
 diff --git a/include/jemalloc/jemalloc_FreeBSD.h 
b/include/jemalloc/jemalloc_FreeBSD.h
 new file mode 100644
-index 000..c5113b9
+index 000..737542e
 --- /dev/null
 +++ b/include/jemalloc/jemalloc_FreeBSD.h
-@@ -0,0 +1,144 @@
+@@ -0,0 +1,142 @@
 +/*
 + * Override settings that were generated in jemalloc_defs.h as necessary.
 + */
@@ -135,7 +135,6 @@ index 000..c5113b9
 + * The following are architecture-dependent, so conditionally define them for
 + * each supported architecture.
 + */
-+#undef CPU_SPINWAIT
 +#undef JEMALLOC_TLS_MODEL
 +#undef STATIC_PAGE_SHIFT
 +#undef LG_SIZEOF_PTR
@@ -145,7 +144,6 @@ index 000..c5113b9
 +
 +#ifdef __i386__
 +#  define LG_SIZEOF_PTR   2
-+#  define CPU_SPINWAIT__asm__ volatile(pause)
 +#  define JEMALLOC_TLS_MODEL  __attribute__((tls_model(initial-exec)))
 +#endif
 +#ifdef __ia64__
@@ -157,7 +155,6 @@ index 000..c5113b9
 +#endif
 +#ifdef __amd64__
 +#  define LG_SIZEOF_PTR   3
-+#  define CPU_SPINWAIT__asm__ volatile(pause)
 +#  define JEMALLOC_TLS_MODEL  __attribute__((tls_model(initial-exec)))
 +#endif
 +#ifdef __arm__
@@ -183,15 +180,16 @@ index 000..c5113b9
 +#  define JEMALLOC_TLS_MODEL  /* Default. */
 +#endif
 +
-+#ifndef CPU_SPINWAIT
-+#  define CPU_SPINWAIT do {} while (0)
-+#endif
-+
 +#define   STATIC_PAGE_SHIFT   PAGE_SHIFT
 +#define   LG_SIZEOF_INT   2
 +#define   LG_SIZEOF_LONG  LG_SIZEOF_PTR
 +#define   LG_SIZEOF_INTMAX_T  3
 +
++#undef CPU_SPINWAIT
++#include machine/cpu.h
++#include machine/cpufunc.h
++#define   CPU_SPINWAITcpu_spinwait()
++
 +/* Disable lazy-lock machinery, mangle isthreaded, and adjust its type. */
 +#undef JEMALLOC_LAZY_LOCK
 +extern int __isthreaded;

Modified: head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h
==
--- head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h   Tue Aug 18 
20:27:03 2015(r286906)
+++ head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h   Tue Aug 18 
20:42:08 2015(r286907)
@@ -12,7 +12,6 @@
  * The following are architecture-dependent, so conditionally define them for
  * each supported architecture.
  */
-#undef CPU_SPINWAIT
 #undef JEMALLOC_TLS_MODEL
 #undef STATIC_PAGE_SHIFT
 #undef LG_SIZEOF_PTR
@@ -22,7 +21,6 @@
 
 #ifdef __i386__
 #  define LG_SIZEOF_PTR2
-#  define CPU_SPINWAIT __asm__ volatile(pause)
 #  define JEMALLOC_TLS_MODEL   __attribute__((tls_model(initial-exec)))
 #endif
 #ifdef __ia64__
@@ -34,7 +32,6 @@
 #endif
 #ifdef __amd64__
 #  define LG_SIZEOF_PTR3
-#  define CPU_SPINWAIT __asm__ volatile(pause)
 #  define JEMALLOC_TLS_MODEL   __attribute__((tls_model(initial-exec)))
 #endif
 #ifdef __arm__
@@ -60,15 +57,16 @@
 #  define JEMALLOC_TLS_MODEL   /* Default. */
 #endif
 
-#ifndef CPU_SPINWAIT
-#  define CPU_SPINWAIT do {} while (0)
-#endif
-
 #defineSTATIC_PAGE_SHIFT   PAGE_SHIFT
 #defineLG_SIZEOF_INT   2
 #defineLG_SIZEOF_LONG  LG_SIZEOF_PTR
 #defineLG_SIZEOF_INTMAX_T  3
 
+#undef CPU_SPINWAIT
+#include machine/cpu.h
+#include machine/cpufunc.h
+#defineCPU_SPINWAITcpu_spinwait()
+
 /* Disable lazy-lock machinery, mangle isthreaded, and adjust its type. */
 #undef JEMALLOC_LAZY_LOCK
 extern int __isthreaded;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r286911 - in head: . contrib/jemalloc contrib/jemalloc/doc include

2015-08-18 Thread Jason Evans
Author: jasone
Date: Wed Aug 19 00:06:46 2015
New Revision: 286911
URL: https://svnweb.freebsd.org/changeset/base/286911

Log:
  Fix minor malloc regressions.
  
  - Use _Bool rather than bool to resolve missing type errors in malloc_np.h.
  - Fix malloc manual page #include documentation.
  - Add *allocm manual pages to obsolete files.
  
  Submitted by: jbeich

Modified:
  head/ObsoleteFiles.inc
  head/contrib/jemalloc/FREEBSD-diffs
  head/contrib/jemalloc/FREEBSD-upgrade
  head/contrib/jemalloc/doc/jemalloc.3
  head/include/malloc_np.h

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Tue Aug 18 22:37:25 2015(r286910)
+++ head/ObsoleteFiles.inc  Wed Aug 19 00:06:46 2015(r286911)
@@ -38,6 +38,12 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20150818: *allocm() are gone in jemalloc 4.0.0
+OLD_FILES+=usr/share/man/man3/allocm.3.gz
+OLD_FILES+=usr/share/man/man3/dallocm.3.gz
+OLD_FILES+=usr/share/man/man3/nallocm.3.gz
+OLD_FILES+=usr/share/man/man3/rallocm.3.gz
+OLD_FILES+=usr/share/man/man3/sallocm.3.gz
 # 20150802: Remove netbsd's test on pw(8)
 OLD_FILES+=usr/tests/usr.sbin/pw/pw_test
 # 20150719: Remove libarchive.pc

Modified: head/contrib/jemalloc/FREEBSD-diffs
==
--- head/contrib/jemalloc/FREEBSD-diffs Tue Aug 18 22:37:25 2015
(r286910)
+++ head/contrib/jemalloc/FREEBSD-diffs Wed Aug 19 00:06:46 2015
(r286911)
@@ -1,8 +1,8 @@
 diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in
-index 8fc774b..47b453c 100644
+index 8fc774b..fdbef95 100644
 --- a/doc/jemalloc.xml.in
 +++ b/doc/jemalloc.xml.in
-@@ -53,6 +53,17 @@
+@@ -53,11 +53,23 @@
  paraThis manual describes jemalloc @jemalloc_version@.  More information
  can be found at the ulink
  url=http://www.canonware.com/jemalloc/;jemalloc website/ulink./para
@@ -20,7 +20,14 @@ index 8fc774b..47b453c 100644
/refsect1
refsynopsisdiv
  titleSYNOPSIS/title
-@@ -2759,4 +2770,18 @@ malloc_conf = lg_chunk:24;]]/programlisting/para
+ funcsynopsis
+-  funcsynopsisinfo#include lt;filename 
class=headerfilejemalloc/jemalloc.h/filenamegt;/funcsynopsisinfo
++  funcsynopsisinfo#include lt;filename 
class=headerfilestdlib.h/filenamegt;
++#include lt;filename 
class=headerfilemalloc_np.h/filenamegt;/funcsynopsisinfo
+   refsect2
+ titleStandard API/title
+ funcprototype
+@@ -2759,4 +2771,18 @@ malloc_conf = lg_chunk:24;]]/programlisting/para
  paraThe functionposix_memalignparameter//function function 
conforms
  to IEEE Std 1003.1-2001 (ldquo;POSIX.1rdquo;)./para
/refsect1

Modified: head/contrib/jemalloc/FREEBSD-upgrade
==
--- head/contrib/jemalloc/FREEBSD-upgrade   Tue Aug 18 22:37:25 2015
(r286910)
+++ head/contrib/jemalloc/FREEBSD-upgrade   Wed Aug 19 00:06:46 2015
(r286911)
@@ -72,9 +72,9 @@ do_extract() {
 patch -p1  ${src}/FREEBSD-diffs
 find . -name '*.orig' -delete
 # Generate various files.
-./autogen.sh --enable-cc-silence --enable-dss --enable-xmalloc \
-  --enable-utrace --with-xslroot=/usr/local/share/xsl/docbook \
-  --with-private-namespace=__ --with-lg-page-sizes=12,13,14,16
+./autogen.sh --enable-cc-silence --enable-xmalloc --enable-utrace \
+  --with-xslroot=/usr/local/share/xsl/docbook --with-private-namespace=__ \
+  --with-lg-page-sizes=12,13,14,16
 gmake dist
   )
 }

Modified: head/contrib/jemalloc/doc/jemalloc.3
==
--- head/contrib/jemalloc/doc/jemalloc.3Tue Aug 18 22:37:25 2015
(r286910)
+++ head/contrib/jemalloc/doc/jemalloc.3Wed Aug 19 00:06:46 2015
(r286911)
@@ -2,12 +2,12 @@
 .\ Title: JEMALLOC
 .\Author: Jason Evans
 .\ Generator: DocBook XSL Stylesheets v1.76.1 http://docbook.sf.net/
-.\  Date: 08/17/2015
+.\  Date: 08/18/2015
 .\Manual: User Manual
 .\Source: jemalloc 4.0.0-0-g6e98caf8f064482b9ab292ef3638dea67420bbc2
 .\  Language: English
 .\
-.TH JEMALLOC 3 08/17/2015 jemalloc 4.0.0-0-g6e98caf8f064 User Manual
+.TH JEMALLOC 3 08/18/2015 jemalloc 4.0.0-0-g6e98caf8f064 User Manual
 .\ -
 .\ * Define some portability stuff
 .\ -
@@ -51,7 +51,8 @@ make variable)\.
 .sp
 .ft B
 .nf
-#include jemalloc/jemalloc\.h
+#include stdlib\.h
+#include malloc_np\.h
 .fi
 .ft
 .SS Standard API

Modified: head/include/malloc_np.h
==
--- head/include/malloc_np.hTue Aug 18 22:37:25 2015(r286910)
+++ head/include/malloc_np.hWed Aug 19 00:06:46 2015(r286911)
@@ -36,13 +36,14 @@
 #include

Re: svn commit: r286866 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/gen lib/libc

2015-08-18 Thread Jason Evans
On Aug 18, 2015, at 12:49 PM, Jan Beich jbe...@freebsd.org wrote:
 [various fixes]

Committed as r286911.

Thanks,
Jason
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r286866 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/gen lib/libc/...

2015-08-17 Thread Jason Evans
Author: jasone
Date: Tue Aug 18 00:21:25 2015
New Revision: 286866
URL: https://svnweb.freebsd.org/changeset/base/286866

Log:
  Update jemalloc to version 4.0.0.

Added:
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h   
(contents, props changed)
  head/contrib/jemalloc/include/jemalloc/internal/pages.h   (contents, props 
changed)
  head/contrib/jemalloc/include/jemalloc/internal/valgrind.h   (contents, props 
changed)
  head/contrib/jemalloc/include/jemalloc/jemalloc_typedefs.h   (contents, props 
changed)
  head/contrib/jemalloc/src/pages.c   (contents, props changed)
Modified:
  head/contrib/jemalloc/COPYING
  head/contrib/jemalloc/ChangeLog
  head/contrib/jemalloc/FREEBSD-Xlist
  head/contrib/jemalloc/FREEBSD-diffs
  head/contrib/jemalloc/FREEBSD-upgrade
  head/contrib/jemalloc/VERSION
  head/contrib/jemalloc/doc/jemalloc.3
  head/contrib/jemalloc/include/jemalloc/internal/arena.h
  head/contrib/jemalloc/include/jemalloc/internal/atomic.h
  head/contrib/jemalloc/include/jemalloc/internal/base.h
  head/contrib/jemalloc/include/jemalloc/internal/bitmap.h
  head/contrib/jemalloc/include/jemalloc/internal/chunk.h
  head/contrib/jemalloc/include/jemalloc/internal/chunk_dss.h
  head/contrib/jemalloc/include/jemalloc/internal/chunk_mmap.h
  head/contrib/jemalloc/include/jemalloc/internal/ckh.h
  head/contrib/jemalloc/include/jemalloc/internal/ctl.h
  head/contrib/jemalloc/include/jemalloc/internal/extent.h
  head/contrib/jemalloc/include/jemalloc/internal/hash.h
  head/contrib/jemalloc/include/jemalloc/internal/huge.h
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_macros.h
  head/contrib/jemalloc/include/jemalloc/internal/mutex.h
  head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h
  head/contrib/jemalloc/include/jemalloc/internal/prng.h
  head/contrib/jemalloc/include/jemalloc/internal/prof.h
  head/contrib/jemalloc/include/jemalloc/internal/public_namespace.h
  head/contrib/jemalloc/include/jemalloc/internal/ql.h
  head/contrib/jemalloc/include/jemalloc/internal/qr.h
  head/contrib/jemalloc/include/jemalloc/internal/quarantine.h
  head/contrib/jemalloc/include/jemalloc/internal/rb.h
  head/contrib/jemalloc/include/jemalloc/internal/rtree.h
  head/contrib/jemalloc/include/jemalloc/internal/size_classes.h
  head/contrib/jemalloc/include/jemalloc/internal/stats.h
  head/contrib/jemalloc/include/jemalloc/internal/tcache.h
  head/contrib/jemalloc/include/jemalloc/internal/tsd.h
  head/contrib/jemalloc/include/jemalloc/internal/util.h
  head/contrib/jemalloc/include/jemalloc/jemalloc.h
  head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h
  head/contrib/jemalloc/src/arena.c
  head/contrib/jemalloc/src/base.c
  head/contrib/jemalloc/src/bitmap.c
  head/contrib/jemalloc/src/chunk.c
  head/contrib/jemalloc/src/chunk_dss.c
  head/contrib/jemalloc/src/chunk_mmap.c
  head/contrib/jemalloc/src/ckh.c
  head/contrib/jemalloc/src/ctl.c
  head/contrib/jemalloc/src/extent.c
  head/contrib/jemalloc/src/huge.c
  head/contrib/jemalloc/src/jemalloc.c
  head/contrib/jemalloc/src/mutex.c
  head/contrib/jemalloc/src/prof.c
  head/contrib/jemalloc/src/quarantine.c
  head/contrib/jemalloc/src/rtree.c
  head/contrib/jemalloc/src/stats.c
  head/contrib/jemalloc/src/tcache.c
  head/contrib/jemalloc/src/tsd.c
  head/contrib/jemalloc/src/util.c
  head/include/malloc_np.h
  head/lib/libc/gen/tls.c
  head/lib/libc/stdlib/jemalloc/Makefile.inc

Modified: head/contrib/jemalloc/COPYING
==
--- head/contrib/jemalloc/COPYING   Mon Aug 17 23:44:38 2015
(r286865)
+++ head/contrib/jemalloc/COPYING   Tue Aug 18 00:21:25 2015
(r286866)
@@ -1,10 +1,10 @@
 Unless otherwise specified, files in the jemalloc source distribution are
 subject to the following license:
 

-Copyright (C) 2002-2014 Jason Evans jas...@canonware.com.
+Copyright (C) 2002-2015 Jason Evans jas...@canonware.com.
 All rights reserved.
 Copyright (C) 2007-2012 Mozilla Foundation.  All rights reserved.
-Copyright (C) 2009-2014 Facebook, Inc.  All rights reserved.
+Copyright (C) 2009-2015 Facebook, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:

Modified: head/contrib/jemalloc/ChangeLog
==
--- head/contrib/jemalloc/ChangeLog Mon Aug 17 23:44:38 2015
(r286865)
+++ head/contrib/jemalloc/ChangeLog Tue Aug 18 00:21:25 2015
(r286866)
@@ -1,10 +1,166 @@
 Following are change highlights associated with official releases.  Important
-bug fixes are all mentioned, but internal

svn commit: r263974 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src

2014-03-31 Thread Jason Evans
/jemalloc.3
==
--- head/contrib/jemalloc/doc/jemalloc.3Mon Mar 31 16:37:41 2014
(r263973)
+++ head/contrib/jemalloc/doc/jemalloc.3Mon Mar 31 17:04:04 2014
(r263974)
@@ -2,12 +2,12 @@
 .\ Title: JEMALLOC
 .\Author: Jason Evans
 .\ Generator: DocBook XSL Stylesheets v1.76.1 http://docbook.sf.net/
-.\  Date: 02/25/2014
+.\  Date: 03/31/2014
 .\Manual: User Manual
-.\Source: jemalloc 3.5.1-0-g7709a64c59daf0b1f938be49472fcc499e1bd136
+.\Source: jemalloc 3.6.0-0-g46c0af68bd248b04df75e4f92d5fb804c3d75340
 .\  Language: English
 .\
-.TH JEMALLOC 3 02/25/2014 jemalloc 3.5.1-0-g7709a64c59da User Manual
+.TH JEMALLOC 3 03/31/2014 jemalloc 3.6.0-0-g46c0af68bd24 User Manual
 .\ -
 .\ * Define some portability stuff
 .\ -
@@ -31,7 +31,7 @@
 jemalloc \- general purpose memory allocation functions
 .SH LIBRARY
 .PP
-This manual describes jemalloc 
3\.5\.1\-0\-g7709a64c59daf0b1f938be49472fcc499e1bd136\. More information can 
be found at the
+This manual describes jemalloc 
3\.6\.0\-0\-g46c0af68bd248b04df75e4f92d5fb804c3d75340\. More information can 
be found at the
 \m[blue]\fBjemalloc website\fR\m[]\\s-2\u[1]\d\s+2\.
 .PP
 The following configuration options are enabled in libc\*(Aqs built\-in 
jemalloc:
@@ -1035,7 +1035,7 @@ Purge unused dirty pages for arena i, 
 arena\.i\.dss (\fBconst char *\fR) rw
 .RS 4
 Set the precedence of dss allocation as related to mmap allocation for arena 
i, or for all arenas if i equals
-arenas\.narenas\. See
+arenas\.narenas\. Note that even during huge allocation this setting is 
read from the arena that would be chosen for small or large allocation so that 
applications can depend on consistent dss versus mmap allocation regardless of 
allocation size\. See
 opt\.dss
 for supported settings\.
 .RE

Modified: head/contrib/jemalloc/include/jemalloc/internal/hash.h
==
--- head/contrib/jemalloc/include/jemalloc/internal/hash.h  Mon Mar 31 
16:37:41 2014(r263973)
+++ head/contrib/jemalloc/include/jemalloc/internal/hash.h  Mon Mar 31 
17:04:04 2014(r263974)
@@ -320,7 +320,7 @@ hash_x64_128(const void *key, const int 
 JEMALLOC_INLINE void
 hash(const void *key, size_t len, const uint32_t seed, size_t r_hash[2])
 {
-#if (LG_SIZEOF_PTR == 3)
+#if (LG_SIZEOF_PTR == 3  !defined(JEMALLOC_BIG_ENDIAN))
hash_x64_128(key, len, seed, (uint64_t *)r_hash);
 #else
uint64_t hashes[2];

Modified: head/contrib/jemalloc/include/jemalloc/internal/huge.h
==
--- head/contrib/jemalloc/include/jemalloc/internal/huge.h  Mon Mar 31 
16:37:41 2014(r263973)
+++ head/contrib/jemalloc/include/jemalloc/internal/huge.h  Mon Mar 31 
17:04:04 2014(r263974)
@@ -17,18 +17,20 @@ extern size_t   huge_allocated;
 /* Protects chunk-related data structures. */
 extern malloc_mutex_t  huge_mtx;
 
-void   *huge_malloc(size_t size, bool zero);
-void   *huge_palloc(size_t size, size_t alignment, bool zero);
+void   *huge_malloc(size_t size, bool zero, dss_prec_t dss_prec);
+void   *huge_palloc(size_t size, size_t alignment, bool zero,
+dss_prec_t dss_prec);
 bool   huge_ralloc_no_move(void *ptr, size_t oldsize, size_t size,
 size_t extra);
 void   *huge_ralloc(void *ptr, size_t oldsize, size_t size, size_t extra,
-size_t alignment, bool zero, bool try_tcache_dalloc);
+size_t alignment, bool zero, bool try_tcache_dalloc, dss_prec_t dss_prec);
 #ifdef JEMALLOC_JET
 typedef void (huge_dalloc_junk_t)(void *, size_t);
 extern huge_dalloc_junk_t *huge_dalloc_junk;
 #endif
 void   huge_dalloc(void *ptr, bool unmap);
 size_t huge_salloc(const void *ptr);
+dss_prec_t huge_dss_prec_get(arena_t *arena);
 prof_ctx_t *huge_prof_ctx_get(const void *ptr);
 void   huge_prof_ctx_set(const void *ptr, prof_ctx_t *ctx);
 bool   huge_boot(void);

Modified: head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h
==
--- head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h Mon Mar 
31 16:37:41 2014(r263973)
+++ head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h Mon Mar 
31 17:04:04 2014(r263974)
@@ -770,7 +770,7 @@ imalloct(size_t size, bool try_tcache, a
if (size = arena_maxclass)
return (arena_malloc(arena, size, false, try_tcache));
else
-   return (huge_malloc(size, false));
+   return (huge_malloc(size, false, huge_dss_prec_get(arena)));
 }
 
 JEMALLOC_ALWAYS_INLINE void *
@@ -787,7 +787,7 @@ icalloct(size_t size, bool try_tcache, a
if (size = arena_maxclass

svn commit: r262521 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src

2014-02-25 Thread Jason Evans
Author: jasone
Date: Wed Feb 26 02:36:59 2014
New Revision: 262521
URL: http://svnweb.freebsd.org/changeset/base/262521

Log:
  Update jemalloc to version 3.5.1.

Modified:
  head/contrib/jemalloc/ChangeLog
  head/contrib/jemalloc/FREEBSD-Xlist
  head/contrib/jemalloc/VERSION
  head/contrib/jemalloc/doc/jemalloc.3
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_macros.h
  head/contrib/jemalloc/include/jemalloc/internal/prof.h
  head/contrib/jemalloc/include/jemalloc/jemalloc.h
  head/contrib/jemalloc/src/arena.c
  head/contrib/jemalloc/src/huge.c

Modified: head/contrib/jemalloc/ChangeLog
==
--- head/contrib/jemalloc/ChangeLog Wed Feb 26 02:02:51 2014
(r262520)
+++ head/contrib/jemalloc/ChangeLog Wed Feb 26 02:36:59 2014
(r262521)
@@ -3,8 +3,26 @@ bug fixes are all mentioned, but interna
 brevity (even though they are more fun to write about).  Much more detail can 
be
 found in the git revision history:
 
-http://www.canonware.com/cgi-bin/gitweb.cgi?p=jemalloc.git
-git://canonware.com/jemalloc.git
+https://github.com/jemalloc/jemalloc
+
+* 3.5.1 (February 25, 2014)
+
+  This version primarily addresses minor bugs in test code.
+
+  Bug fixes:
+  - Configure Solaris/Illumos to use MADV_FREE.
+  - Fix junk filling for mremap(2)-based huge reallocation.  This is only
+relevant if configuring with the --enable-mremap option specified.
+  - Avoid compilation failure if 'restrict' C99 keyword is not supported by the
+compiler.
+  - Add a configure test for SSE2 rather than assuming it is usable on i686
+systems.  This fixes test compilation errors, especially on 32-bit Linux
+systems.
+  - Fix mallctl argument size mismatches (size_t vs. uint64_t) in the stats 
unit
+test.
+  - Fix/remove flawed alignment-related overflow tests.
+  - Prevent compiler optimizations that could change backtraces in the
+prof_accum unit test.
 
 * 3.5.0 (January 22, 2014)
 
@@ -16,7 +34,7 @@ found in the git revision history:
 API.  The *allocx() functions are slightly simpler to use because they have
 fewer parameters, they directly return the results of primary interest, and
 mallocx()/rallocx() avoid the strict aliasing pitfall that
-allocm()/rallocx() share with posix_memalign().  Note that *allocm() is
+allocm()/rallocm() share with posix_memalign().  Note that *allocm() is
 slated for removal in the next non-bugfix release.
   - Add support for LinuxThreads.
 

Modified: head/contrib/jemalloc/FREEBSD-Xlist
==
--- head/contrib/jemalloc/FREEBSD-Xlist Wed Feb 26 02:02:51 2014
(r262520)
+++ head/contrib/jemalloc/FREEBSD-Xlist Wed Feb 26 02:36:59 2014
(r262521)
@@ -28,6 +28,7 @@ include/jemalloc/internal/public_unnames
 include/jemalloc/internal/size_classes.sh
 include/jemalloc/jemalloc.h.in
 include/jemalloc/jemalloc.sh
+include/jemalloc/jemalloc_defs.h
 include/jemalloc/jemalloc_defs.h.in
 include/jemalloc/jemalloc_macros.h
 include/jemalloc/jemalloc_macros.h.in

Modified: head/contrib/jemalloc/VERSION
==
--- head/contrib/jemalloc/VERSION   Wed Feb 26 02:02:51 2014
(r262520)
+++ head/contrib/jemalloc/VERSION   Wed Feb 26 02:36:59 2014
(r262521)
@@ -1 +1 @@
-3.5.0-0-gcc47dde16203a6ae7eb685b53e1ae501f3869bc6
+3.5.1-0-g7709a64c59daf0b1f938be49472fcc499e1bd136

Modified: head/contrib/jemalloc/doc/jemalloc.3
==
--- head/contrib/jemalloc/doc/jemalloc.3Wed Feb 26 02:02:51 2014
(r262520)
+++ head/contrib/jemalloc/doc/jemalloc.3Wed Feb 26 02:36:59 2014
(r262521)
@@ -2,12 +2,12 @@
 .\ Title: JEMALLOC
 .\Author: Jason Evans
 .\ Generator: DocBook XSL Stylesheets v1.76.1 http://docbook.sf.net/
-.\  Date: 01/22/2014
+.\  Date: 02/25/2014
 .\Manual: User Manual
-.\Source: jemalloc 3.5.0-0-gcc47dde16203a6ae7eb685b53e1ae501f3869bc6
+.\Source: jemalloc 3.5.1-0-g7709a64c59daf0b1f938be49472fcc499e1bd136
 .\  Language: English
 .\
-.TH JEMALLOC 3 01/22/2014 jemalloc 3.5.0-0-gcc47dde16203 User Manual
+.TH JEMALLOC 3 02/25/2014 jemalloc 3.5.1-0-g7709a64c59da User Manual
 .\ -
 .\ * Define some portability stuff
 .\ -
@@ -31,7 +31,7 @@
 jemalloc \- general purpose memory allocation functions
 .SH LIBRARY
 .PP
-This manual describes jemalloc 
3\.5\.0\-0\-gcc47dde16203a6ae7eb685b53e1ae501f3869bc6\. More information can 
be found at the
+This manual describes jemalloc 
3\.5\.1\-0\-g7709a64c59daf0b1f938be49472fcc499e1bd136\. More information can 
be found

Re: svn commit: r261071 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/gen lib/libc

2014-02-06 Thread Jason Evans
On Feb 6, 2014, at 8:01 PM, Lawrence Stewart lstew...@freebsd.org wrote:
 On 01/23/14 13:47, Jason Evans wrote:
 Author: jasone
 Date: Thu Jan 23 02:47:36 2014
 New Revision: 261071
 URL: http://svnweb.freebsd.org/changeset/base/261071
 
 Log:
  Update jemalloc to version 3.5.0.
 
 I suspect that this commit is related to the assertion failures I've
 been seeing on recent head when I updated from r260427 to r261453.
 Here's two I noticed today:
 
 jemalloc:
 /usr/local/poudriere/jails/head-amd64/usr/src/lib/libc/../../contrib/jemalloc/include/jemalloc/internal/arena.h:7
 76: Failed assertion: binind == actual_binind
 *** Signal 6
 
 and
 
 jemalloc:
 /usr/src/lib/libc/../../contrib/jemalloc/include/jemalloc/internal/arena.h:776:
 Failed assertion: binind == actual_binind
 Abort trap
 
 I seem to be able to reproduce the first one readily when poudriere
 tries to build chromium so I can provide more info and help test ideas.
 
 Cheers,
 Lawrence

Are the failures you saw happening only for the chromium build, or have you 
seen that same failure for other things as well?  If it’s just the chromium 
build, is there any chance that this same failure would have occurred prior to 
the jemalloc 3.5.0 update?

If this is an application bug, it’s probably due do a buffer overrun corrupting 
an adjacent page that contains page run metadata.  If it’s a jemalloc bug, I’m 
going to need to reproduce it and dig in; it’s unlikely to be easy to diagnose.

Thanks,
Jason
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r261071 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src include lib/libc/gen lib/libc/...

2014-01-22 Thread Jason Evans
Author: jasone
Date: Thu Jan 23 02:47:36 2014
New Revision: 261071
URL: http://svnweb.freebsd.org/changeset/base/261071

Log:
  Update jemalloc to version 3.5.0.

Added:
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h   
(contents, props changed)
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_macros.h   
(contents, props changed)
  head/contrib/jemalloc/include/jemalloc/internal/public_namespace.h   
(contents, props changed)
Deleted:
  head/contrib/jemalloc/include/jemalloc/jemalloc_defs.h
Modified:
  head/contrib/jemalloc/COPYING
  head/contrib/jemalloc/ChangeLog
  head/contrib/jemalloc/FREEBSD-Xlist
  head/contrib/jemalloc/FREEBSD-diffs
  head/contrib/jemalloc/FREEBSD-upgrade
  head/contrib/jemalloc/VERSION
  head/contrib/jemalloc/doc/jemalloc.3
  head/contrib/jemalloc/include/jemalloc/internal/arena.h
  head/contrib/jemalloc/include/jemalloc/internal/chunk_dss.h
  head/contrib/jemalloc/include/jemalloc/internal/ckh.h
  head/contrib/jemalloc/include/jemalloc/internal/hash.h
  head/contrib/jemalloc/include/jemalloc/internal/huge.h
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h
  head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h
  head/contrib/jemalloc/include/jemalloc/internal/prng.h
  head/contrib/jemalloc/include/jemalloc/internal/prof.h
  head/contrib/jemalloc/include/jemalloc/internal/ql.h
  head/contrib/jemalloc/include/jemalloc/internal/qr.h
  head/contrib/jemalloc/include/jemalloc/internal/rb.h
  head/contrib/jemalloc/include/jemalloc/internal/rtree.h
  head/contrib/jemalloc/include/jemalloc/internal/tcache.h
  head/contrib/jemalloc/include/jemalloc/internal/tsd.h
  head/contrib/jemalloc/include/jemalloc/internal/util.h
  head/contrib/jemalloc/include/jemalloc/jemalloc.h
  head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h
  head/contrib/jemalloc/src/arena.c
  head/contrib/jemalloc/src/bitmap.c
  head/contrib/jemalloc/src/chunk.c
  head/contrib/jemalloc/src/chunk_dss.c
  head/contrib/jemalloc/src/chunk_mmap.c
  head/contrib/jemalloc/src/ckh.c
  head/contrib/jemalloc/src/ctl.c
  head/contrib/jemalloc/src/huge.c
  head/contrib/jemalloc/src/jemalloc.c
  head/contrib/jemalloc/src/mutex.c
  head/contrib/jemalloc/src/prof.c
  head/contrib/jemalloc/src/quarantine.c
  head/contrib/jemalloc/src/rtree.c
  head/contrib/jemalloc/src/stats.c
  head/contrib/jemalloc/src/tcache.c
  head/contrib/jemalloc/src/tsd.c
  head/contrib/jemalloc/src/util.c
  head/include/malloc_np.h
  head/lib/libc/gen/tls.c
  head/lib/libc/stdlib/jemalloc/Makefile.inc
  head/lib/libc/stdlib/jemalloc/Symbol.map

Modified: head/contrib/jemalloc/COPYING
==
--- head/contrib/jemalloc/COPYING   Thu Jan 23 02:10:30 2014
(r261070)
+++ head/contrib/jemalloc/COPYING   Thu Jan 23 02:47:36 2014
(r261071)
@@ -1,10 +1,10 @@
 Unless otherwise specified, files in the jemalloc source distribution are
 subject to the following license:
 

-Copyright (C) 2002-2013 Jason Evans jas...@canonware.com.
+Copyright (C) 2002-2014 Jason Evans jas...@canonware.com.
 All rights reserved.
 Copyright (C) 2007-2012 Mozilla Foundation.  All rights reserved.
-Copyright (C) 2009-2013 Facebook, Inc.  All rights reserved.
+Copyright (C) 2009-2014 Facebook, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:

Modified: head/contrib/jemalloc/ChangeLog
==
--- head/contrib/jemalloc/ChangeLog Thu Jan 23 02:10:30 2014
(r261070)
+++ head/contrib/jemalloc/ChangeLog Thu Jan 23 02:47:36 2014
(r261071)
@@ -6,6 +6,59 @@ found in the git revision history:
 http://www.canonware.com/cgi-bin/gitweb.cgi?p=jemalloc.git
 git://canonware.com/jemalloc.git
 
+* 3.5.0 (January 22, 2014)
+
+  This version focuses on refactoring and automated testing, though it also
+  includes some non-trivial heap profiling optimizations not mentioned below.
+
+  New features:
+  - Add the *allocx() API, which is a successor to the experimental *allocm()
+API.  The *allocx() functions are slightly simpler to use because they have
+fewer parameters, they directly return the results of primary interest, and
+mallocx()/rallocx() avoid the strict aliasing pitfall that
+allocm()/rallocx() share with posix_memalign().  Note that *allocm() is
+slated for removal in the next non-bugfix release.
+  - Add support for LinuxThreads.
+
+  Bug fixes:
+  - Unless heap profiling is enabled, disable floating point code and don't 
link
+with libm.  This, in combination with e.g. EXTRA_CFLAGS=-mno-sse on x64
+systems, makes it possible to completely disable floating point register
+use.  Some versions

svn commit: r256823 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src

2013-10-20 Thread Jason Evans
/contrib/jemalloc/doc/jemalloc.3Mon Oct 21 04:15:55 2013
(r256822)
+++ head/contrib/jemalloc/doc/jemalloc.3Mon Oct 21 05:10:46 2013
(r256823)
@@ -2,12 +2,12 @@
 .\ Title: JEMALLOC
 .\Author: Jason Evans
 .\ Generator: DocBook XSL Stylesheets v1.76.1 http://docbook.sf.net/
-.\  Date: 06/02/2013
+.\  Date: 10/20/2013
 .\Manual: User Manual
-.\Source: jemalloc 3.4.0-0-g0ed518e5dab789ad2171bb38977a8927e2a26775
+.\Source: jemalloc 3.4.1-0-g0135fb806e4137dc9cdf152541926a2bc95e33f0
 .\  Language: English
 .\
-.TH JEMALLOC 3 06/02/2013 jemalloc 3.4.0-0-g0ed518e5dab7 User Manual
+.TH JEMALLOC 3 10/20/2013 jemalloc 3.4.1-0-g0135fb806e41 User Manual
 .\ -
 .\ * Define some portability stuff
 .\ -
@@ -31,7 +31,7 @@
 jemalloc \- general purpose memory allocation functions
 .SH LIBRARY
 .PP
-This manual describes jemalloc 
3\.4\.0\-0\-g0ed518e5dab789ad2171bb38977a8927e2a26775\. More information can 
be found at the
+This manual describes jemalloc 
3\.4\.1\-0\-g0135fb806e4137dc9cdf152541926a2bc95e33f0\. More information can 
be found at the
 \m[blue]\fBjemalloc website\fR\m[]\\s-2\u[1]\d\s+2\.
 .PP
 The following configuration options are enabled in libc\*(Aqs built\-in 
jemalloc:

Modified: head/contrib/jemalloc/include/jemalloc/internal/arena.h
==
--- head/contrib/jemalloc/include/jemalloc/internal/arena.h Mon Oct 21 
04:15:55 2013(r256822)
+++ head/contrib/jemalloc/include/jemalloc/internal/arena.h Mon Oct 21 
05:10:46 2013(r256823)
@@ -441,6 +441,7 @@ voidarena_postfork_child(arena_t *arena
 #ifndef JEMALLOC_ENABLE_INLINE
 arena_chunk_map_t  *arena_mapp_get(arena_chunk_t *chunk, size_t pageind);
 size_t *arena_mapbitsp_get(arena_chunk_t *chunk, size_t pageind);
+size_t arena_mapbitsp_read(size_t *mapbitsp);
 size_t arena_mapbits_get(arena_chunk_t *chunk, size_t pageind);
 size_t arena_mapbits_unallocated_size_get(arena_chunk_t *chunk,
 size_t pageind);
@@ -451,6 +452,7 @@ size_t  arena_mapbits_dirty_get(arena_chu
 size_t arena_mapbits_unzeroed_get(arena_chunk_t *chunk, size_t pageind);
 size_t arena_mapbits_large_get(arena_chunk_t *chunk, size_t pageind);
 size_t arena_mapbits_allocated_get(arena_chunk_t *chunk, size_t pageind);
+void   arena_mapbitsp_write(size_t *mapbitsp, size_t mapbits);
 void   arena_mapbits_unallocated_set(arena_chunk_t *chunk, size_t pageind,
 size_t size, size_t flags);
 void   arena_mapbits_unallocated_size_set(arena_chunk_t *chunk, size_t pageind,
@@ -498,10 +500,17 @@ arena_mapbitsp_get(arena_chunk_t *chunk,
 }
 
 JEMALLOC_ALWAYS_INLINE size_t
+arena_mapbitsp_read(size_t *mapbitsp)
+{
+
+   return (*mapbitsp);
+}
+
+JEMALLOC_ALWAYS_INLINE size_t
 arena_mapbits_get(arena_chunk_t *chunk, size_t pageind)
 {
 
-   return (*arena_mapbitsp_get(chunk, pageind));
+   return (arena_mapbitsp_read(arena_mapbitsp_get(chunk, pageind)));
 }
 
 JEMALLOC_ALWAYS_INLINE size_t
@@ -585,82 +594,89 @@ arena_mapbits_allocated_get(arena_chunk_
 }
 
 JEMALLOC_ALWAYS_INLINE void
+arena_mapbitsp_write(size_t *mapbitsp, size_t mapbits)
+{
+
+   *mapbitsp = mapbits;
+}
+
+JEMALLOC_ALWAYS_INLINE void
 arena_mapbits_unallocated_set(arena_chunk_t *chunk, size_t pageind, size_t 
size,
 size_t flags)
 {
-   size_t *mapbitsp;
+   size_t *mapbitsp = arena_mapbitsp_get(chunk, pageind);
 
-   mapbitsp = arena_mapbitsp_get(chunk, pageind);
assert((size  PAGE_MASK) == 0);
assert((flags  ~CHUNK_MAP_FLAGS_MASK) == 0);
assert((flags  (CHUNK_MAP_DIRTY|CHUNK_MAP_UNZEROED)) == flags);
-   *mapbitsp = size | CHUNK_MAP_BININD_INVALID | flags;
+   arena_mapbitsp_write(mapbitsp, size | CHUNK_MAP_BININD_INVALID | flags);
 }
 
 JEMALLOC_ALWAYS_INLINE void
 arena_mapbits_unallocated_size_set(arena_chunk_t *chunk, size_t pageind,
 size_t size)
 {
-   size_t *mapbitsp;
+   size_t *mapbitsp = arena_mapbitsp_get(chunk, pageind);
+   size_t mapbits = arena_mapbitsp_read(mapbitsp);
 
-   mapbitsp = arena_mapbitsp_get(chunk, pageind);
assert((size  PAGE_MASK) == 0);
-   assert((*mapbitsp  (CHUNK_MAP_LARGE|CHUNK_MAP_ALLOCATED)) == 0);
-   *mapbitsp = size | (*mapbitsp  PAGE_MASK);
+   assert((mapbits  (CHUNK_MAP_LARGE|CHUNK_MAP_ALLOCATED)) == 0);
+   arena_mapbitsp_write(mapbitsp, size | (mapbits  PAGE_MASK));
 }
 
 JEMALLOC_ALWAYS_INLINE void
 arena_mapbits_large_set(arena_chunk_t *chunk, size_t pageind, size_t size,
 size_t flags)
 {
-   size_t *mapbitsp;
+   size_t *mapbitsp = arena_mapbitsp_get(chunk, pageind);
+   size_t mapbits = arena_mapbitsp_read(mapbitsp);
size_t unzeroed;
 
-   mapbitsp = arena_mapbitsp_get(chunk, pageind);
assert((size  PAGE_MASK) == 0);
assert((flags  CHUNK_MAP_DIRTY

svn commit: r251300 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src

2013-06-03 Thread Jason Evans
+index 65de316..366676b 100644
 --- a/include/jemalloc/internal/private_namespace.h
 +++ b/include/jemalloc/internal/private_namespace.h
 @@ -216,7 +216,6 @@
@@ -122,10 +122,10 @@ index 31b1304..c3ef2f5 100644
  #define   ALLOCM_LG_ALIGN(la) (la)
 diff --git a/include/jemalloc/jemalloc_FreeBSD.h 
b/include/jemalloc/jemalloc_FreeBSD.h
 new file mode 100644
-index 000..9c97a13
+index 000..e6c8407
 --- /dev/null
 +++ b/include/jemalloc/jemalloc_FreeBSD.h
-@@ -0,0 +1,76 @@
+@@ -0,0 +1,117 @@
 +/*
 + * Override settings that were generated in jemalloc_defs.h as necessary.
 + */
@@ -196,14 +196,55 @@ index 000..9c97a13
 +#define   isthreaded  ((bool)__isthreaded)
 +
 +/* Mangle. */
++#undef je_malloc
++#undef je_calloc
++#undef je_realloc
++#undef je_free
++#undef je_posix_memalign
++#undef je_malloc_usable_size
++#undef je_allocm
++#undef je_rallocm
++#undef je_sallocm
++#undef je_dallocm
++#undef je_nallocm
++#define   je_malloc   __malloc
++#define   je_calloc   __calloc
++#define   je_realloc  __realloc
++#define   je_free __free
++#define   je_posix_memalign   __posix_memalign
++#define   je_malloc_usable_size   __malloc_usable_size
++#define   je_allocm   __allocm
++#define   je_rallocm  __rallocm
++#define   je_sallocm  __sallocm
++#define   je_dallocm  __dallocm
++#define   je_nallocm  __nallocm
 +#define   open_open
 +#define   read_read
 +#define   write   _write
 +#define   close   _close
 +#define   pthread_mutex_lock  _pthread_mutex_lock
 +#define   pthread_mutex_unlock_pthread_mutex_unlock
++
++#ifdef JEMALLOC_C_
++/*
++ * Define 'weak' symbols so that an application can have its own versions
++ * of malloc, calloc, realloc, free, et al.
++ */
++__weak_reference(__malloc, malloc);
++__weak_reference(__calloc, calloc);
++__weak_reference(__realloc, realloc);
++__weak_reference(__free, free);
++__weak_reference(__posix_memalign, posix_memalign);
++__weak_reference(__malloc_usable_size, malloc_usable_size);
++__weak_reference(__allocm, allocm);
++__weak_reference(__rallocm, rallocm);
++__weak_reference(__sallocm, sallocm);
++__weak_reference(__dallocm, dallocm);
++__weak_reference(__nallocm, nallocm);
++#endif
++
 diff --git a/src/jemalloc.c b/src/jemalloc.c
-index c117685..665d98f 100644
+index bc350ed..352c98e 100644
 --- a/src/jemalloc.c
 +++ b/src/jemalloc.c
 @@ -8,6 +8,10 @@ malloc_tsd_data(, arenas, arena_t *, NULL)
@@ -217,7 +258,7 @@ index c117685..665d98f 100644
  /* Runtime configuration options. */
  const char*je_malloc_conf;
  bool  opt_abort =
-@@ -453,7 +457,8 @@ malloc_conf_init(void)
+@@ -471,7 +475,8 @@ malloc_conf_init(void)
  #endif
;
  

Modified: head/contrib/jemalloc/VERSION
==
--- head/contrib/jemalloc/VERSION   Mon Jun  3 14:33:10 2013
(r251299)
+++ head/contrib/jemalloc/VERSION   Mon Jun  3 14:36:28 2013
(r251300)
@@ -1 +1 @@
-3.3.0-0-g83789f45307379e096c4e8be81d9e9a51e3f5a4a
+3.4.0-0-g0ed518e5dab789ad2171bb38977a8927e2a26775

Modified: head/contrib/jemalloc/doc/jemalloc.3
==
--- head/contrib/jemalloc/doc/jemalloc.3Mon Jun  3 14:33:10 2013
(r251299)
+++ head/contrib/jemalloc/doc/jemalloc.3Mon Jun  3 14:36:28 2013
(r251300)
@@ -2,12 +2,12 @@
 .\ Title: JEMALLOC
 .\Author: Jason Evans
 .\ Generator: DocBook XSL Stylesheets v1.76.1 http://docbook.sf.net/
-.\  Date: 01/23/2013
+.\  Date: 06/02/2013
 .\Manual: User Manual
-.\Source: jemalloc 3.3.0-0-g83789f45307379e096c4e8be81d9e9a51e3f5a4a
+.\Source: jemalloc 3.4.0-0-g0ed518e5dab789ad2171bb38977a8927e2a26775
 .\  Language: English
 .\
-.TH JEMALLOC 3 01/23/2013 jemalloc 3.3.0-0-g83789f453073 User Manual
+.TH JEMALLOC 3 06/02/2013 jemalloc 3.4.0-0-g0ed518e5dab7 User Manual
 .\ -
 .\ * Define some portability stuff
 .\ -
@@ -31,7 +31,7 @@
 jemalloc \- general purpose memory allocation functions
 .SH LIBRARY
 .PP
-This manual describes jemalloc 
3\.3\.0\-0\-g83789f45307379e096c4e8be81d9e9a51e3f5a4a\. More information can 
be found at the
+This manual describes jemalloc 
3\.4\.0\-0\-g0ed518e5dab789ad2171bb38977a8927e2a26775\. More information can 
be found at the
 \m[blue]\fBjemalloc website\fR\m[]\\s-2\u[1]\d\s+2\.
 .PP
 The following configuration options are enabled in libc\*(Aqs built\-in 
jemalloc:
@@ -392,7 +392,19 @@ Once, when the first call is made to one
 The string pointed to by the global variable
 \fImalloc_conf\fR, the \(lqname\(rq

svn commit: r245868 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src

2013-01-23 Thread Jason Evans
Author: jasone
Date: Thu Jan 24 03:08:37 2013
New Revision: 245868
URL: http://svnweb.freebsd.org/changeset/base/245868

Log:
  Import jemalloc 3.3.0.  This reduces zeroed memory validation overhead for
  non-MALLOC_PRODUCTION builds.

Modified:
  head/contrib/jemalloc/COPYING
  head/contrib/jemalloc/ChangeLog
  head/contrib/jemalloc/FREEBSD-diffs
  head/contrib/jemalloc/VERSION
  head/contrib/jemalloc/doc/jemalloc.3
  head/contrib/jemalloc/include/jemalloc/internal/arena.h
  head/contrib/jemalloc/include/jemalloc/internal/ckh.h
  head/contrib/jemalloc/include/jemalloc/internal/hash.h
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h
  head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h
  head/contrib/jemalloc/include/jemalloc/internal/tcache.h
  head/contrib/jemalloc/include/jemalloc/jemalloc.h
  head/contrib/jemalloc/include/jemalloc/jemalloc_defs.h
  head/contrib/jemalloc/src/arena.c
  head/contrib/jemalloc/src/chunk.c
  head/contrib/jemalloc/src/chunk_dss.c
  head/contrib/jemalloc/src/ckh.c
  head/contrib/jemalloc/src/ctl.c
  head/contrib/jemalloc/src/jemalloc.c
  head/contrib/jemalloc/src/prof.c
  head/contrib/jemalloc/src/tcache.c

Modified: head/contrib/jemalloc/COPYING
==
--- head/contrib/jemalloc/COPYING   Thu Jan 24 02:25:43 2013
(r245867)
+++ head/contrib/jemalloc/COPYING   Thu Jan 24 03:08:37 2013
(r245868)
@@ -1,10 +1,10 @@
 Unless otherwise specified, files in the jemalloc source distribution are
 subject to the following license:
 

-Copyright (C) 2002-2012 Jason Evans jas...@canonware.com.
+Copyright (C) 2002-2013 Jason Evans jas...@canonware.com.
 All rights reserved.
 Copyright (C) 2007-2012 Mozilla Foundation.  All rights reserved.
-Copyright (C) 2009-2012 Facebook, Inc.  All rights reserved.
+Copyright (C) 2009-2013 Facebook, Inc.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:

Modified: head/contrib/jemalloc/ChangeLog
==
--- head/contrib/jemalloc/ChangeLog Thu Jan 24 02:25:43 2013
(r245867)
+++ head/contrib/jemalloc/ChangeLog Thu Jan 24 03:08:37 2013
(r245868)
@@ -6,6 +6,23 @@ found in the git revision history:
 http://www.canonware.com/cgi-bin/gitweb.cgi?p=jemalloc.git
 git://canonware.com/jemalloc.git
 
+* 3.3.0 (January 23, 2013)
+
+  This version includes a few minor performance improvements in addition to the
+  listed new features and bug fixes.
+
+  New features:
+  - Add clipping support to lg_chunk option processing.
+  - Add the --enable-ivsalloc option.
+  - Add the --without-export option.
+  - Add the --disable-zone-allocator option.
+
+  Bug fixes:
+  - Fix arenas.extend mallctl to output the number of arenas.
+  - Fix chunk_recycyle() to unconditionally inform Valgrind that returned 
memory
+is undefined.
+  - Fix build break on FreeBSD related to alloca.h.
+
 * 3.2.0 (November 9, 2012)
 
   In addition to a couple of bug fixes, this version modifies page run

Modified: head/contrib/jemalloc/FREEBSD-diffs
==
--- head/contrib/jemalloc/FREEBSD-diffs Thu Jan 24 02:25:43 2013
(r245867)
+++ head/contrib/jemalloc/FREEBSD-diffs Thu Jan 24 03:08:37 2013
(r245868)
@@ -1,5 +1,5 @@
 diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in
-index 54b8747..91c4a4e 100644
+index 0930580..d45fa3d 100644
 --- a/doc/jemalloc.xml.in
 +++ b/doc/jemalloc.xml.in
 @@ -51,12 +51,23 @@
@@ -27,7 +27,7 @@ index 54b8747..91c4a4e 100644
refsect2
  titleStandard API/title
  funcprototype
-@@ -2170,4 +2181,16 @@ malloc_conf = lg_chunk:24;]]/programlisting/para
+@@ -2173,4 +2184,16 @@ malloc_conf = lg_chunk:24;]]/programlisting/para
  paraThe functionposix_memalignparameter//function function 
conforms
  to IEEE Std 1003.1-2001 (ldquo;POSIX.1rdquo;)./para
/refsect1
@@ -45,7 +45,7 @@ index 54b8747..91c4a4e 100644
 +  /refsect1
  /refentry
 diff --git a/include/jemalloc/internal/jemalloc_internal.h.in 
b/include/jemalloc/internal/jemalloc_internal.h.in
-index 475821a..73306ac 100644
+index c606c12..0d46d9d 100644
 --- a/include/jemalloc/internal/jemalloc_internal.h.in
 +++ b/include/jemalloc/internal/jemalloc_internal.h.in
 @@ -1,5 +1,8 @@
@@ -97,10 +97,10 @@ index de44e14..564d604 100644
  
  bool  malloc_mutex_init(malloc_mutex_t *mutex);
 diff --git a/include/jemalloc/internal/private_namespace.h 
b/include/jemalloc/internal/private_namespace.h
-index 06241cd..7b19906 100644
+index 903fb4d..d6638df 100644
 --- a/include/jemalloc/internal/private_namespace.h
 +++ b/include/jemalloc/internal/private_namespace.h
-@@ -204,7 +204,6

svn commit: r245869 - head/contrib/jemalloc

2013-01-23 Thread Jason Evans
Author: jasone
Date: Thu Jan 24 03:33:15 2013
New Revision: 245869
URL: http://svnweb.freebsd.org/changeset/base/245869

Log:
  Update list of ports required for importing jemalloc.

Modified:
  head/contrib/jemalloc/FREEBSD-upgrade

Modified: head/contrib/jemalloc/FREEBSD-upgrade
==
--- head/contrib/jemalloc/FREEBSD-upgrade   Thu Jan 24 03:08:37 2013
(r245868)
+++ head/contrib/jemalloc/FREEBSD-upgrade   Thu Jan 24 03:33:15 2013
(r245869)
@@ -9,6 +9,7 @@
 # - devel/git
 # - devel/gmake
 # - textproc/docbook-xsl
+# - textproc/libxslt
 #
 # The normal workflow for importing a new release is:
 #
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r245837 - head/usr.sbin/pkg_install/lib

2013-01-22 Thread Jason Evans
Author: jasone
Date: Wed Jan 23 07:22:33 2013
New Revision: 245837
URL: http://svnweb.freebsd.org/changeset/base/245837

Log:
  Fix compilation errors.

Modified:
  head/usr.sbin/pkg_install/lib/pkgng.c

Modified: head/usr.sbin/pkg_install/lib/pkgng.c
==
--- head/usr.sbin/pkg_install/lib/pkgng.c   Wed Jan 23 05:37:45 2013
(r245836)
+++ head/usr.sbin/pkg_install/lib/pkgng.c   Wed Jan 23 07:22:33 2013
(r245837)
@@ -50,8 +50,8 @@ void warnpkgng(void)
if (pkgngdir == NULL)
pkgngdir = /var/db/pkg;
 
-   rc = snprintf(pkgngpath, sizeof(pkgngpath) %s/local.sqlite, pkgngdir);
-   if (rc = sizeof(pkgngpath)) {
+   rc = snprintf(pkgngpath, sizeof(pkgngpath), %s/local.sqlite, 
pkgngdir);
+   if ((size_t)rc = sizeof(pkgngpath)) {
warnx(path too long: %s/local.sqlite, pkgngdir);
return;
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r242844 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src

2012-11-09 Thread Jason Evans
 100644
+index 475821a..73306ac 100644
 --- a/include/jemalloc/internal/jemalloc_internal.h.in
 +++ b/include/jemalloc/internal/jemalloc_internal.h.in
 @@ -1,5 +1,8 @@
@@ -97,19 +97,19 @@ index de44e14..564d604 100644
  
  bool  malloc_mutex_init(malloc_mutex_t *mutex);
 diff --git a/include/jemalloc/internal/private_namespace.h 
b/include/jemalloc/internal/private_namespace.h
-index b816647..b8ce6b1 100644
+index 06241cd..7b19906 100644
 --- a/include/jemalloc/internal/private_namespace.h
 +++ b/include/jemalloc/internal/private_namespace.h
-@@ -186,7 +186,6 @@
- #define   iqalloc JEMALLOC_N(iqalloc)
+@@ -204,7 +204,6 @@
  #define   iralloc JEMALLOC_N(iralloc)
+ #define   irallocx JEMALLOC_N(irallocx)
  #define   isalloc JEMALLOC_N(isalloc)
 -#define   isthreaded JEMALLOC_N(isthreaded)
  #define   ivsalloc JEMALLOC_N(ivsalloc)
  #define   jemalloc_postfork_child JEMALLOC_N(jemalloc_postfork_child)
  #define   jemalloc_postfork_parent JEMALLOC_N(jemalloc_postfork_parent)
 diff --git a/include/jemalloc/jemalloc.h.in b/include/jemalloc/jemalloc.h.in
-index ad06948..505dd38 100644
+index 31b1304..c3ef2f5 100644
 --- a/include/jemalloc/jemalloc.h.in
 +++ b/include/jemalloc/jemalloc.h.in
 @@ -15,6 +15,7 @@ extern C {
@@ -122,7 +122,7 @@ index ad06948..505dd38 100644
  #define   ALLOCM_LG_ALIGN(la) (la)
 diff --git a/include/jemalloc/jemalloc_FreeBSD.h 
b/include/jemalloc/jemalloc_FreeBSD.h
 new file mode 100644
-index 000..9efab93
+index 000..9c97a13
 --- /dev/null
 +++ b/include/jemalloc/jemalloc_FreeBSD.h
 @@ -0,0 +1,76 @@
@@ -203,7 +203,7 @@ index 000..9efab93
 +#define   pthread_mutex_lock  _pthread_mutex_lock
 +#define   pthread_mutex_unlock_pthread_mutex_unlock
 diff --git a/src/jemalloc.c b/src/jemalloc.c
-index bc54cd7..fa9fcf0 100644
+index 8a667b6..aaf5012 100644
 --- a/src/jemalloc.c
 +++ b/src/jemalloc.c
 @@ -8,6 +8,10 @@ malloc_tsd_data(, arenas, arena_t *, NULL)
@@ -217,7 +217,7 @@ index bc54cd7..fa9fcf0 100644
  /* Runtime configuration options. */
  const char*je_malloc_conf;
  #ifdef JEMALLOC_DEBUG
-@@ -429,7 +433,8 @@ malloc_conf_init(void)
+@@ -448,7 +452,8 @@ malloc_conf_init(void)
  #endif
;
  
@@ -228,12 +228,12 @@ index bc54cd7..fa9fcf0 100644
 * Do nothing; opts is already initialized to
 * the value of the MALLOC_CONF environment
 diff --git a/src/mutex.c b/src/mutex.c
-index 37a843e..4a90a05 100644
+index 55e18c2..6b6f438 100644
 --- a/src/mutex.c
 +++ b/src/mutex.c
 @@ -66,6 +66,17 @@ pthread_create(pthread_t *__restrict thread,
  #ifdef JEMALLOC_MUTEX_INIT_CB
- int   _pthread_mutex_init_calloc_cb(pthread_mutex_t *mutex,
+ JEMALLOC_EXPORT int   _pthread_mutex_init_calloc_cb(pthread_mutex_t *mutex,
  void *(calloc_cb)(size_t, size_t));
 +
 +__weak_reference(_pthread_mutex_init_calloc_cb_stub,
@@ -250,7 +250,7 @@ index 37a843e..4a90a05 100644
  
  bool
 diff --git a/src/util.c b/src/util.c
-index 9b73c3e..f94799f 100644
+index b3a0114..df1c5d5 100644
 --- a/src/util.c
 +++ b/src/util.c
 @@ -58,6 +58,22 @@ wrtmessage(void *cbopaque, const char *s)

Modified: head/contrib/jemalloc/VERSION
==
--- head/contrib/jemalloc/VERSION   Sat Nov 10 00:36:53 2012
(r242843)
+++ head/contrib/jemalloc/VERSION   Sat Nov 10 01:46:13 2012
(r242844)
@@ -1 +1 @@
-3.0.0-0-gfc9b1dbf69f59d7ecfc4ac68da9847e017e1d046
+3.2.0-0-g87499f6748ebe4817571e817e9f680ccb5bf54a9

Modified: head/contrib/jemalloc/doc/jemalloc.3
==
--- head/contrib/jemalloc/doc/jemalloc.3Sat Nov 10 00:36:53 2012
(r242843)
+++ head/contrib/jemalloc/doc/jemalloc.3Sat Nov 10 01:46:13 2012
(r242844)
@@ -2,12 +2,12 @@
 .\ Title: JEMALLOC
 .\Author: Jason Evans
 .\ Generator: DocBook XSL Stylesheets v1.76.1 http://docbook.sf.net/
-.\  Date: 05/12/2012
+.\  Date: 11/09/2012
 .\Manual: User Manual
-.\Source: jemalloc 3.0.0-0-gfc9b1dbf69f59d7ecfc4ac68da9847e017e1d046
+.\Source: jemalloc 3.2.0-0-g87499f6748ebe4817571e817e9f680ccb5bf54a9
 .\  Language: English
 .\
-.TH JEMALLOC 3 05/12/2012 jemalloc 3.0.0-0-gfc9b1dbf69f5 User Manual
+.TH JEMALLOC 3 11/09/2012 jemalloc 3.2.0-0-g87499f6748eb User Manual
 .\ -
 .\ * Define some portability stuff
 .\ -
@@ -31,7 +31,7 @@
 jemalloc \- general purpose memory allocation functions
 .SH LIBRARY
 .PP
-This manual describes jemalloc 
3\.0\.0\-0\-gfc9b1dbf69f59d7ecfc4ac68da9847e017e1d046\. More information can 
be found at the
+This manual describes jemalloc 
3\.2\.0\-0\-g87499f6748ebe4817571e817e9f680ccb5bf54a9\. More information can 
be found at the
 \m[blue]\fBjemalloc website\fR\m[]\\s-2\u[1]\d\s+2

Re: jemalloc and clang (was: Re: svn commit: r239462 - in head)

2012-08-22 Thread Jason Evans
On Aug 21, 2012, at 1:39 AM, Dimitry Andric d...@freebsd.org wrote:
 On 2012-08-21 02:17, Jan Beich wrote:
 ...
 Time to revert r228540?
 
 Index: contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h
 ===
 --- contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h (revision 
 239467)
 +++ contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h (working copy)
 @@ -56,10 +56,6 @@
  #ifndef JEMALLOC_TLS_MODEL
  #  define JEMALLOC_TLS_MODEL/* Default. */
  #endif
 -#ifdef __clang__
 -#  undef JEMALLOC_TLS_MODEL
 -#  define JEMALLOC_TLS_MODEL/* clang does not support tls_model 
 yet. */
 -#endif
 
  #define STATIC_PAGE_SHIFT   PAGE_SHIFT
  #define LG_SIZEOF_INT   2
 
 Well, if Jason would like to support upstream jemalloc for different
 versions of clang, it is probably better to to use __has_feature()
 instead.
 
 Jason, what do you think of the attached patch?  Or could we just remove
 the whole #ifdef __clang__ part?
 jemalloc-clang-tlsmodel-1.diff

I'm happy with the above patch (completely removing the #ifdef __clang__).

Jason
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r235385 - in head/contrib/jemalloc: . doc include/jemalloc/internal

2012-05-12 Thread Jason Evans
Author: jasone
Date: Sun May 13 01:33:28 2012
New Revision: 235385
URL: http://svn.freebsd.org/changeset/base/235385

Log:
  Fix config_lazy_lock so that thread caching isn't used for
  single-threaded applications.

Modified:
  head/contrib/jemalloc/FREEBSD-diffs
  head/contrib/jemalloc/doc/jemalloc.3
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h

Modified: head/contrib/jemalloc/FREEBSD-diffs
==
--- head/contrib/jemalloc/FREEBSD-diffs Sun May 13 01:30:27 2012
(r235384)
+++ head/contrib/jemalloc/FREEBSD-diffs Sun May 13 01:33:28 2012
(r235385)
@@ -45,7 +45,7 @@ index 877c500..7d659a7 100644
 +  /refsect1
  /refentry
 diff --git a/include/jemalloc/internal/jemalloc_internal.h.in 
b/include/jemalloc/internal/jemalloc_internal.h.in
-index 268cd14..cfb1fb9 100644
+index 268cd14..2acd2eb 100644
 --- a/include/jemalloc/internal/jemalloc_internal.h.in
 +++ b/include/jemalloc/internal/jemalloc_internal.h.in
 @@ -1,5 +1,8 @@
@@ -67,6 +67,21 @@ index 268cd14..cfb1fb9 100644
  #define   JEMALLOC_NO_DEMANGLE
  #include ../jemalloc@install_suffix@.h
  
+@@ -95,13 +101,7 @@ static const bool config_fill =
+ false
+ #endif
+ ;
+-static const bool config_lazy_lock =
+-#ifdef JEMALLOC_LAZY_LOCK
+-true
+-#else
+-false
+-#endif
+-;
++static const bool config_lazy_lock = true;
+ static const bool config_prof =
+ #ifdef JEMALLOC_PROF
+ true
 diff --git a/include/jemalloc/internal/mutex.h 
b/include/jemalloc/internal/mutex.h
 index de44e14..564d604 100644
 --- a/include/jemalloc/internal/mutex.h

Modified: head/contrib/jemalloc/doc/jemalloc.3
==
--- head/contrib/jemalloc/doc/jemalloc.3Sun May 13 01:30:27 2012
(r235384)
+++ head/contrib/jemalloc/doc/jemalloc.3Sun May 13 01:33:28 2012
(r235385)
@@ -2,12 +2,12 @@
 .\ Title: JEMALLOC
 .\Author: Jason Evans
 .\ Generator: DocBook XSL Stylesheets v1.76.1 http://docbook.sf.net/
-.\  Date: 05/11/2012
+.\  Date: 05/12/2012
 .\Manual: User Manual
 .\Source: jemalloc 3.0.0-0-gfc9b1dbf69f59d7ecfc4ac68da9847e017e1d046
 .\  Language: English
 .\
-.TH JEMALLOC 3 05/11/2012 jemalloc 3.0.0-0-gfc9b1dbf69f5 User Manual
+.TH JEMALLOC 3 05/12/2012 jemalloc 3.0.0-0-gfc9b1dbf69f5 User Manual
 .\ -
 .\ * Define some portability stuff
 .\ -

Modified: head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h
==
--- head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h Sun May 
13 01:30:27 2012(r235384)
+++ head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h Sun May 
13 01:33:28 2012(r235385)
@@ -101,13 +101,7 @@ static const bool config_fill =
 false
 #endif
 ;
-static const bool config_lazy_lock =
-#ifdef JEMALLOC_LAZY_LOCK
-true
-#else
-false
-#endif
-;
+static const bool config_lazy_lock = true;
 static const bool config_prof =
 #ifdef JEMALLOC_PROF
 true
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r235322 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src

2012-05-11 Thread Jason Evans
Author: jasone
Date: Sat May 12 05:26:49 2012
New Revision: 235322
URL: http://svn.freebsd.org/changeset/base/235322

Log:
  Import jemalloc 3.0.0.  This fixes memory zeroing bugs that manifested as
  jemalloc assertion failures for debug builds, or as calloc() sometimes
  returning non-zeroed memory for production builds.

Modified:
  head/contrib/jemalloc/ChangeLog
  head/contrib/jemalloc/FREEBSD-diffs
  head/contrib/jemalloc/VERSION
  head/contrib/jemalloc/doc/jemalloc.3
  head/contrib/jemalloc/include/jemalloc/internal/arena.h
  head/contrib/jemalloc/include/jemalloc/jemalloc.h
  head/contrib/jemalloc/src/arena.c
  head/contrib/jemalloc/src/jemalloc.c

Modified: head/contrib/jemalloc/ChangeLog
==
--- head/contrib/jemalloc/ChangeLog Sat May 12 05:05:22 2012
(r235321)
+++ head/contrib/jemalloc/ChangeLog Sat May 12 05:26:49 2012
(r235322)
@@ -6,7 +6,7 @@ found in the git revision history:
 http://www.canonware.com/cgi-bin/gitweb.cgi?p=jemalloc.git
 git://canonware.com/jemalloc.git
 
-* 3.0.0 (XXX not yet released)
+* 3.0.0 (May 11, 2012)
 
   Although this version adds some major new features, the primary focus is on
   internal code cleanup that facilitates maintainability and portability, most
@@ -23,6 +23,7 @@ found in the git revision history:
 + FreeBSD
 + Mac OS X Lion
 + MinGW
++ Windows (no support yet for replacing the system malloc)
   - Add support for additional architectures:
 + MIPS
 + SH4
@@ -31,12 +32,13 @@ found in the git revision history:
   - Add nallocm(), which rounds a request size up to the nearest size class
 without actually allocating.
   - Implement aligned_alloc() (blame C11).
-  - Add the --disable-munmap option, and make it the default on Linux.
-  - Add the --with-mangling option.
-  - Add the --disable-experimental option.
   - Add the thread.tcache.enabled mallctl.
   - Add the opt.prof_final mallctl.
   - Update pprof (from gperftools 2.0).
+  - Add the --with-mangling option.
+  - Add the --disable-experimental option.
+  - Add the --disable-munmap option, and make it the default on Linux.
+  - Add the --enable-mremap option, which disables use of mremap(2) by default.
 
   Incompatible changes:
   - Enable stats by default.
@@ -71,6 +73,7 @@ found in the git revision history:
 write-after-free memory corruption.
   - Fix a potential deadlock that could occur during interval- and
 growth-triggered heap profile dumps.
+  - Fix large calloc() zeroing bugs due to dropping chunk map unzeroed flags.
   - Fix chunk_alloc_dss() to stop claiming memory is zeroed.  This bug could
 cause memory corruption and crashes with --enable-dss specified.
   - Fix fork-related bugs that could cause deadlock in children between fork

Modified: head/contrib/jemalloc/FREEBSD-diffs
==
--- head/contrib/jemalloc/FREEBSD-diffs Sat May 12 05:05:22 2012
(r235321)
+++ head/contrib/jemalloc/FREEBSD-diffs Sat May 12 05:26:49 2012
(r235322)
@@ -1,5 +1,5 @@
 diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in
-index 93c16dc..b5c5595 100644
+index 877c500..7d659a7 100644
 --- a/doc/jemalloc.xml.in
 +++ b/doc/jemalloc.xml.in
 @@ -51,12 +51,23 @@
@@ -192,7 +192,7 @@ index 000..9efab93
 +#define   pthread_mutex_lock  _pthread_mutex_lock
 +#define   pthread_mutex_unlock_pthread_mutex_unlock
 diff --git a/src/jemalloc.c b/src/jemalloc.c
-index d42e91d..cdf6222 100644
+index bc54cd7..fa9fcf0 100644
 --- a/src/jemalloc.c
 +++ b/src/jemalloc.c
 @@ -8,6 +8,10 @@ malloc_tsd_data(, arenas, arena_t *, NULL)

Modified: head/contrib/jemalloc/VERSION
==
--- head/contrib/jemalloc/VERSION   Sat May 12 05:05:22 2012
(r235321)
+++ head/contrib/jemalloc/VERSION   Sat May 12 05:26:49 2012
(r235322)
@@ -1 +1 @@
-1.0.0-335-g37b6f95dcd866f51c91488531a2efc3ed4c2b754
+3.0.0-0-gfc9b1dbf69f59d7ecfc4ac68da9847e017e1d046

Modified: head/contrib/jemalloc/doc/jemalloc.3
==
--- head/contrib/jemalloc/doc/jemalloc.3Sat May 12 05:05:22 2012
(r235321)
+++ head/contrib/jemalloc/doc/jemalloc.3Sat May 12 05:26:49 2012
(r235322)
@@ -2,12 +2,12 @@
 .\ Title: JEMALLOC
 .\Author: Jason Evans
 .\ Generator: DocBook XSL Stylesheets v1.76.1 http://docbook.sf.net/
-.\  Date: 05/09/2012
+.\  Date: 05/11/2012
 .\Manual: User Manual
-.\Source: jemalloc 1.0.0-335-g37b6f95dcd866f51c91488531a2efc3ed4c2b754
+.\Source: jemalloc 3.0.0-0-gfc9b1dbf69f59d7ecfc4ac68da9847e017e1d046
 .\  Language: English
 .\
-.TH JEMALLOC 3 05/09/2012 jemalloc 1.0.0-335-g37b6f95dcd User Manual
+.TH JEMALLOC 3 05/11/2012 jemalloc 3.0.0-0-gfc9b1dbf69f5 User Manual

svn commit: r235238 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src

2012-05-10 Thread Jason Evans
-index 99ae26d..b80676c 100644
+index 9b73c3e..f94799f 100644
 --- a/src/util.c
 +++ b/src/util.c
-@@ -60,6 +60,22 @@ wrtmessage(void *cbopaque, const char *s)
- void  (*je_malloc_message)(void *, const char *s)
- JEMALLOC_ATTR(visibility(default)) = wrtmessage;
+@@ -58,6 +58,22 @@ wrtmessage(void *cbopaque, const char *s)
+ 
+ JEMALLOC_EXPORT void  (*je_malloc_message)(void *, const char *s);
  
-+JEMALLOC_CATTR(visibility(hidden), static)
++JEMALLOC_ATTR(visibility(hidden))
 +void
 +wrtmessage_1_0(const char *s1, const char *s2, const char *s3,
 +const char *s4)
@@ -258,5 +263,5 @@ index 99ae26d..b80676c 100644
 +__sym_compat(_malloc_message, __malloc_message_1_0, FBSD_1.0);
 +
  /*
-  * glibc provides a non-standard strerror_r() when _GNU_SOURCE is defined, so
-  * provide a wrapper.
+  * Wrapper around malloc_message() that avoids the need for
+  * je_malloc_message(...) throughout the code.

Modified: head/contrib/jemalloc/VERSION
==
--- head/contrib/jemalloc/VERSION   Thu May 10 18:25:59 2012
(r235237)
+++ head/contrib/jemalloc/VERSION   Thu May 10 18:29:40 2012
(r235238)
@@ -1 +1 @@
-1.0.0-286-ga8f8d7540d66ddee7337db80c92890916e1063ca
+1.0.0-335-g37b6f95dcd866f51c91488531a2efc3ed4c2b754

Modified: head/contrib/jemalloc/doc/jemalloc.3
==
--- head/contrib/jemalloc/doc/jemalloc.3Thu May 10 18:25:59 2012
(r235237)
+++ head/contrib/jemalloc/doc/jemalloc.3Thu May 10 18:29:40 2012
(r235238)
@@ -2,12 +2,12 @@
 .\ Title: JEMALLOC
 .\Author: Jason Evans
 .\ Generator: DocBook XSL Stylesheets v1.76.1 http://docbook.sf.net/
-.\  Date: 04/21/2012
+.\  Date: 05/09/2012
 .\Manual: User Manual
-.\Source: jemalloc 1.0.0-286-ga8f8d7540d66ddee7337db80c92890916e1063ca
+.\Source: jemalloc 1.0.0-335-g37b6f95dcd866f51c91488531a2efc3ed4c2b754
 .\  Language: English
 .\
-.TH JEMALLOC 3 04/21/2012 jemalloc 1.0.0-286-ga8f8d7540d User Manual
+.TH JEMALLOC 3 05/09/2012 jemalloc 1.0.0-335-g37b6f95dcd User Manual
 .\ -
 .\ * Define some portability stuff
 .\ -
@@ -31,7 +31,7 @@
 jemalloc \- general purpose memory allocation functions
 .SH LIBRARY
 .PP
-This manual describes jemalloc 
1\.0\.0\-286\-ga8f8d7540d66ddee7337db80c92890916e1063ca\. More information 
can be found at the
+This manual describes jemalloc 
1\.0\.0\-335\-g37b6f95dcd866f51c91488531a2efc3ed4c2b754\. More information 
can be found at the
 \m[blue]\fBjemalloc website\fR\m[]\\s-2\u[1]\d\s+2\.
 .PP
 The following configuration options are enabled in libc\*(Aqs built\-in 
jemalloc:
@@ -567,6 +567,12 @@ was specified during build configuration
 was specified during build configuration\.
 .RE
 .PP
+config\.mremap (\fBbool\fR) r\-
+.RS 4
+\fB\-\-enable\-mremap\fR
+was specified during build configuration\.
+.RE
+.PP
 config\.munmap (\fBbool\fR) r\-
 .RS 4
 \fB\-\-enable\-munmap\fR
@@ -1462,7 +1468,7 @@ jemalloc website
 .IP  2. 4
 Valgrind
 .RS 4
-\%http://http://valgrind.org/
+\%http://valgrind.org/
 .RE
 .IP  3. 4
 gperftools package

Modified: head/contrib/jemalloc/include/jemalloc/internal/arena.h
==
--- head/contrib/jemalloc/include/jemalloc/internal/arena.h Thu May 10 
18:25:59 2012(r235237)
+++ head/contrib/jemalloc/include/jemalloc/internal/arena.h Thu May 10 
18:29:40 2012(r235238)
@@ -109,7 +109,8 @@ struct arena_chunk_map_s {
 *
 * p : run page offset
 * s : run size
-* c : (binind+1) for size class (used only if prof_promote is true)
+* n : binind for size class; large objects set these to BININD_INVALID
+* except for promoted allocations (see prof_promote)
 * x : don't care
 * - : 0
 * + : 1
@@ -117,35 +118,38 @@ struct arena_chunk_map_s {
 * [dula] : bit unset
 *
 *   Unallocated (clean):
-*    du-a
-*    -Uxx
-*    dU-a
+*    du-a
+*    -Uxx
+*    dU-a
 *
 *   Unallocated (dirty):
-*    D--a
-*    
-*    D--a
+*    D--a
+*    
+*    D--a
 *
 *   Small:
-*    d--A
-*    ---A
-*  

svn commit: r234924 - head/sys/sys

2012-05-02 Thread Jason Evans
Author: jasone
Date: Wed May  2 10:15:42 2012
New Revision: 234924
URL: http://svn.freebsd.org/changeset/base/234924

Log:
  Bump __FreeBSD_version due to jemalloc import.

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hWed May  2 09:19:42 2012(r234923)
+++ head/sys/sys/param.hWed May  2 10:15:42 2012(r234924)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 111  /* Master, propagated to newvers */
+#define __FreeBSD_version 112  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r234569 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src lib/libc/gen

2012-04-22 Thread Jason Evans
Author: jasone
Date: Sun Apr 22 08:49:13 2012
New Revision: 234569
URL: http://svn.freebsd.org/changeset/base/234569

Log:
  Import jemalloc a8f8d7540d66ddee7337db80c92890916e1063ca (dev branch,
  prior to 3.0.0 release).  This fixes several bugs related to memory
  initialization.
  
  Mangle __jemalloc_a0{malloc,calloc,free}() just like all the other
  library-internal symbols in jemalloc, and adjust the tls allocation code
  in libc to use the mangled names.

Modified:
  head/contrib/jemalloc/ChangeLog
  head/contrib/jemalloc/FREEBSD-diffs
  head/contrib/jemalloc/VERSION
  head/contrib/jemalloc/doc/jemalloc.3
  head/contrib/jemalloc/include/jemalloc/internal/chunk.h
  head/contrib/jemalloc/include/jemalloc/internal/chunk_mmap.h
  head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h
  head/contrib/jemalloc/include/jemalloc/internal/tsd.h
  head/contrib/jemalloc/include/jemalloc/jemalloc.h
  head/contrib/jemalloc/src/chunk.c
  head/contrib/jemalloc/src/chunk_dss.c
  head/contrib/jemalloc/src/chunk_mmap.c
  head/contrib/jemalloc/src/huge.c
  head/contrib/jemalloc/src/jemalloc.c
  head/lib/libc/gen/tls.c

Modified: head/contrib/jemalloc/ChangeLog
==
--- head/contrib/jemalloc/ChangeLog Sun Apr 22 07:55:56 2012
(r234568)
+++ head/contrib/jemalloc/ChangeLog Sun Apr 22 08:49:13 2012
(r234569)
@@ -70,6 +70,8 @@ found in the git revision history:
 invalid statistics and crashes.
   - Work around TLS dallocation via free() on Linux.  This bug could cause
 write-after-free memory corruption.
+  - Fix chunk_alloc_dss() to stop claiming memory is zeroed.  This bug could
+cause memory corruption and crashes with --enable-dss specified.
   - Fix malloc_stats_print() to honor 'b' and 'l' in the opts parameter.
   - Fix realloc(p, 0) to act like free(p).
   - Do not enforce minimum alignment in memalign().

Modified: head/contrib/jemalloc/FREEBSD-diffs
==
--- head/contrib/jemalloc/FREEBSD-diffs Sun Apr 22 07:55:56 2012
(r234568)
+++ head/contrib/jemalloc/FREEBSD-diffs Sun Apr 22 08:49:13 2012
(r234569)
@@ -1,5 +1,5 @@
 diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in
-index f78f423..ce6df80 100644
+index e8a5722..cec85b5 100644
 --- a/doc/jemalloc.xml.in
 +++ b/doc/jemalloc.xml.in
 @@ -51,12 +51,23 @@
@@ -82,17 +82,10 @@ index 8837ef5..d7133f4 100644
  
  bool  malloc_mutex_init(malloc_mutex_t *mutex);
 diff --git a/include/jemalloc/internal/private_namespace.h 
b/include/jemalloc/internal/private_namespace.h
-index 15fe3c5..be94eb8 100644
+index bb1b63e..00eb169 100644
 --- a/include/jemalloc/internal/private_namespace.h
 +++ b/include/jemalloc/internal/private_namespace.h
-@@ -1,6 +1,3 @@
--#define   a0calloc JEMALLOC_N(a0calloc)
--#define   a0free JEMALLOC_N(a0free)
--#define   a0malloc JEMALLOC_N(a0malloc)
- #define   arena_alloc_junk_small JEMALLOC_N(arena_alloc_junk_small)
- #define   arena_bin_index JEMALLOC_N(arena_bin_index)
- #define   arena_bin_info JEMALLOC_N(arena_bin_info)
-@@ -167,7 +164,6 @@
+@@ -165,7 +165,6 @@
  #define   iqalloc JEMALLOC_N(iqalloc)
  #define   iralloc JEMALLOC_N(iralloc)
  #define   isalloc JEMALLOC_N(isalloc)
@@ -195,7 +188,7 @@ index 000..2c5797f
 +#define   pthread_mutex_lock  _pthread_mutex_lock
 +#define   pthread_mutex_unlock_pthread_mutex_unlock
 diff --git a/src/jemalloc.c b/src/jemalloc.c
-index 00c2b23..729f4e1 100644
+index f9c8916..8e24a5a 100644
 --- a/src/jemalloc.c
 +++ b/src/jemalloc.c
 @@ -8,6 +8,9 @@ malloc_tsd_data(, arenas, arena_t *, NULL)

Modified: head/contrib/jemalloc/VERSION
==
--- head/contrib/jemalloc/VERSION   Sun Apr 22 07:55:56 2012
(r234568)
+++ head/contrib/jemalloc/VERSION   Sun Apr 22 08:49:13 2012
(r234569)
@@ -1 +1 @@
-1.0.0-283-g606f1fdc3cdbc700717133ca56685313caea24bb
+1.0.0-286-ga8f8d7540d66ddee7337db80c92890916e1063ca

Modified: head/contrib/jemalloc/doc/jemalloc.3
==
--- head/contrib/jemalloc/doc/jemalloc.3Sun Apr 22 07:55:56 2012
(r234568)
+++ head/contrib/jemalloc/doc/jemalloc.3Sun Apr 22 08:49:13 2012
(r234569)
@@ -2,12 +2,12 @@
 .\ Title: JEMALLOC
 .\Author: Jason Evans
 .\ Generator: DocBook XSL Stylesheets v1.76.1 http://docbook.sf.net/
-.\  Date: 04/20/2012
+.\  Date: 04/21/2012
 .\Manual: User Manual
-.\Source: jemalloc 1.0.0-283-g606f1fdc3cdbc700717133ca56685313caea24bb
+.\Source: jemalloc 1.0.0-286-ga8f8d7540d66ddee7337db80c92890916e1063ca
 .\  Language: English
 .\
-.TH JEMALLOC 3 04/20/2012 jemalloc 1.0.0-283-g606f1fdc3c User Manual
+.TH JEMALLOC 3 04/21/2012 jemalloc 1.0.0-286-ga8f8d7540d User Manual

svn commit: r234543 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src

2012-04-21 Thread Jason Evans
(a0calloc)
+-#define   a0free JEMALLOC_N(a0free)
+-#define   a0malloc JEMALLOC_N(a0malloc)
+ #define   arena_alloc_junk_small JEMALLOC_N(arena_alloc_junk_small)
+ #define   arena_bin_index JEMALLOC_N(arena_bin_index)
+ #define   arena_bin_info JEMALLOC_N(arena_bin_info)
+@@ -167,7 +164,6 @@
+ #define   iqalloc JEMALLOC_N(iqalloc)
+ #define   iralloc JEMALLOC_N(iralloc)
+ #define   isalloc JEMALLOC_N(isalloc)
+-#define   isthreaded JEMALLOC_N(isthreaded)
+ #define   ivsalloc JEMALLOC_N(ivsalloc)
+ #define   jemalloc_postfork_child JEMALLOC_N(jemalloc_postfork_child)
+ #define   jemalloc_postfork_parent JEMALLOC_N(jemalloc_postfork_parent)
 diff --git a/include/jemalloc/jemalloc.h.in b/include/jemalloc/jemalloc.h.in
 index f0581db..f26d8bc 100644
 --- a/include/jemalloc/jemalloc.h.in
@@ -175,7 +195,7 @@ index 000..2c5797f
 +#define   pthread_mutex_lock  _pthread_mutex_lock
 +#define   pthread_mutex_unlock_pthread_mutex_unlock
 diff --git a/src/jemalloc.c b/src/jemalloc.c
-index 0decd8a..73fad29 100644
+index 00c2b23..729f4e1 100644
 --- a/src/jemalloc.c
 +++ b/src/jemalloc.c
 @@ -8,6 +8,9 @@ malloc_tsd_data(, arenas, arena_t *, NULL)
@@ -221,7 +241,7 @@ index 4b8ce57..7be5fc9 100644
  
  bool
 diff --git a/src/util.c b/src/util.c
-index 2aab61f..8b05042 100644
+index 99ae26d..b80676c 100644
 --- a/src/util.c
 +++ b/src/util.c
 @@ -60,6 +60,22 @@ wrtmessage(void *cbopaque, const char *s)

Modified: head/contrib/jemalloc/FREEBSD-upgrade
==
--- head/contrib/jemalloc/FREEBSD-upgrade   Sat Apr 21 14:39:47 2012
(r234542)
+++ head/contrib/jemalloc/FREEBSD-upgrade   Sat Apr 21 15:09:22 2012
(r234543)
@@ -72,7 +72,8 @@ do_extract() {
 find . -name '*.orig' -delete
 # Generate various files.
 ./autogen.sh --enable-cc-silence --enable-dss --enable-xmalloc \
-  --enable-utrace --with-xslroot=/usr/local/share/xsl/docbook
+  --enable-utrace --with-xslroot=/usr/local/share/xsl/docbook \
+  --with-private-namespace=__jemalloc_
 gmake dist
   )
 }

Modified: head/contrib/jemalloc/VERSION
==
--- head/contrib/jemalloc/VERSION   Sat Apr 21 14:39:47 2012
(r234542)
+++ head/contrib/jemalloc/VERSION   Sat Apr 21 15:09:22 2012
(r234543)
@@ -1 +1 @@
-1.0.0-266-gb57d3ec571c6551231be62b7bf92c084a8c8291c
+1.0.0-283-g606f1fdc3cdbc700717133ca56685313caea24bb

Modified: head/contrib/jemalloc/doc/jemalloc.3
==
--- head/contrib/jemalloc/doc/jemalloc.3Sat Apr 21 14:39:47 2012
(r234542)
+++ head/contrib/jemalloc/doc/jemalloc.3Sat Apr 21 15:09:22 2012
(r234543)
@@ -2,12 +2,12 @@
 .\ Title: JEMALLOC
 .\Author: Jason Evans
 .\ Generator: DocBook XSL Stylesheets v1.76.1 http://docbook.sf.net/
-.\  Date: 04/17/2012
+.\  Date: 04/20/2012
 .\Manual: User Manual
-.\Source: jemalloc 1.0.0-266-gb57d3ec571c6551231be62b7bf92c084a8c8291c
+.\Source: jemalloc 1.0.0-283-g606f1fdc3cdbc700717133ca56685313caea24bb
 .\  Language: English
 .\
-.TH JEMALLOC 3 04/17/2012 jemalloc 1.0.0-266-gb57d3ec571 User Manual
+.TH JEMALLOC 3 04/20/2012 jemalloc 1.0.0-283-g606f1fdc3c User Manual
 .\ -
 .\ * Define some portability stuff
 .\ -
@@ -31,7 +31,7 @@
 jemalloc \- general purpose memory allocation functions
 .SH LIBRARY
 .PP
-This manual describes jemalloc 
1\.0\.0\-266\-gb57d3ec571c6551231be62b7bf92c084a8c8291c\. More information 
can be found at the
+This manual describes jemalloc 
1\.0\.0\-283\-g606f1fdc3cdbc700717133ca56685313caea24bb\. More information 
can be found at the
 \m[blue]\fBjemalloc website\fR\m[]\\s-2\u[1]\d\s+2\.
 .PP
 The following configuration options are enabled in libc\*(Aqs built\-in 
jemalloc:
@@ -753,14 +753,7 @@ Maximum size class (log base 2) to cache
 .PP
 opt\.prof (\fBbool\fR) r\- [\fB\-\-enable\-prof\fR]
 .RS 4
-Memory profiling enabled/disabled\. If enabled, profile memory allocation 
activity, and use an
-\fBatexit\fR(3)
-function to dump final memory usage to a file named according to the pattern
-prefix\.pid\.seq\.f\.heap, where
-prefix
-is controlled by the
-opt\.prof_prefix
-option\. See the
+Memory profiling enabled/disabled\. If enabled, profile memory allocation 
activity\. See the
 opt\.prof_active
 option for on\-the\-fly activation/deactivation\. See the
 opt\.lg_prof_sample
@@ -768,12 +761,14 @@ option for probabilistic sampling contro
 opt\.prof_accum
 option for control of cumulative sample reporting\. See the
 opt\.lg_prof_interval
-option for information on interval\-triggered profile dumping, and the
+option for information on interval\-triggered profile dumping, the
 opt

Re: svn commit: r234370 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src incl

2012-04-19 Thread Jason Evans
On Apr 19, 2012, at 7:15 AM, Conrad J. Sabatier wrote:
 Actually, I keep getting undefined reference to _malloc_options while
 building libexec/atrun on amd64.  Not sure what the problem may be.
 Could it have something to do with doing a debug build (with -g)?
 
 === libexec/atrun (all)
 […]
 -lutil /usr/obj/usr/src/tmp/usr/lib/libc.so: undefined reference to
 `_malloc_options' clang: error: linker command failed with exit code 1
 (use -v to see invocation) *** [atrun] Error code 1

Perhaps this is related to using clang rather than gcc.  I'll start a 
clang-based buildworld to see if it reproduces here.

Jason___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r234370 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src incl

2012-04-19 Thread Jason Evans
On Apr 19, 2012, at 11:44 AM, Jason Evans wrote:
 On Apr 19, 2012, at 7:15 AM, Conrad J. Sabatier wrote:
 Actually, I keep getting undefined reference to _malloc_options while
 building libexec/atrun on amd64.  Not sure what the problem may be.
 Could it have something to do with doing a debug build (with -g)?
 
 === libexec/atrun (all)
 […]
 -lutil /usr/obj/usr/src/tmp/usr/lib/libc.so: undefined reference to
 `_malloc_options' clang: error: linker command failed with exit code 1
 (use -v to see invocation) *** [atrun] Error code 1
 
 Perhaps this is related to using clang rather than gcc.  I'll start a 
 clang-based buildworld to see if it reproduces here.
 
 Jason


With /etc/make.conf as:

CFLAGS+=-g
STRIP=
CC=clang
CXX=clang++
CPP=clang-cpp

I got this buildworld failure:
---
clang -O2 -pipe -g  -I/usr/src/lib/csu/amd64/../common  
-I/usr/src/lib/csu/amd64/../../libc/include -fno-omit-frame-pointer -std=gnu99 
-Qunused-arguments  -Wsystem-headers -Werror -Wall -Wno-format-y2k -W 
-Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wreturn-type -Wcast-qual -Wwrite-strin
gs -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline 
-Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign 
-Wno-empty-body -Wno-string-plus-int -c -o crt1.o crt1.scrt1.s:8:2: error: 
input can't have .file dwarf directives when -g is used to generate dwarf debug 
info for assembly code
.file   1 /usr/src/lib/csu/amd64/crt1.c^
crt1.s:8:8: error: file number already allocated.file   1 
/usr/src/lib/csu/amd64/crt1.c
^crt1.s:9:2: error: input can't have .file dwarf directives 
when -g is used to generate dwarf debug info for assembly code
.file   2 /usr/src/lib/csu/amd64/../common/crtbrand.c
^crt1.s:10:2: error: input can't have .file dwarf directives when -g is used to 
generate dwarf debug info for assembly code
.file   3 /usr/src/lib/csu/amd64/../common/ignore_init.c^
---

I removed the CFLAGS+=-g line, and buildworld succeeded.

Jason___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r234370 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src inclu...

2012-04-17 Thread Jason Evans
 changed)
  head/contrib/jemalloc/src/tsd.c   (contents, props changed)
  head/contrib/jemalloc/src/util.c   (contents, props changed)
  head/lib/libc/stdlib/jemalloc/
  head/lib/libc/stdlib/jemalloc/Makefile.inc   (contents, props changed)
  head/lib/libc/stdlib/jemalloc/Symbol.map   (contents, props changed)
  head/lib/libc/stdlib/reallocf.3
 - copied, changed from r234194, head/lib/libc/stdlib/malloc.3
Deleted:
  head/lib/libc/stdlib/aligned_alloc.3
  head/lib/libc/stdlib/malloc.3
  head/lib/libc/stdlib/malloc.c
  head/lib/libc/stdlib/ql.h
  head/lib/libc/stdlib/qr.h
  head/lib/libc/stdlib/rb.h
Modified:
  head/include/malloc_np.h
  head/include/stdlib.h
  head/lib/libc/Makefile
  head/lib/libc/gen/tls.c
  head/lib/libc/stdlib/Makefile.inc
  head/lib/libc/stdlib/Symbol.map

Added: head/contrib/jemalloc/COPYING
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/contrib/jemalloc/COPYING   Tue Apr 17 07:22:14 2012
(r234370)
@@ -0,0 +1,27 @@
+Unless otherwise specified, files in the jemalloc source distribution are
+subject to the following license:
+
+Copyright (C) 2002-2012 Jason Evans jas...@canonware.com.
+All rights reserved.
+Copyright (C) 2007-2012 Mozilla Foundation.  All rights reserved.
+Copyright (C) 2009-2012 Facebook, Inc.  All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+1. Redistributions of source code must retain the above copyright notice(s),
+   this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice(s),
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY EXPRESS
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
+EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+

Added: head/contrib/jemalloc/ChangeLog
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/contrib/jemalloc/ChangeLog Tue Apr 17 07:22:14 2012
(r234370)
@@ -0,0 +1,322 @@
+Following are change highlights associated with official releases.  Important
+bug fixes are all mentioned, but internal enhancements are omitted here for
+brevity (even though they are more fun to write about).  Much more detail can 
be
+found in the git revision history:
+
+http://www.canonware.com/cgi-bin/gitweb.cgi?p=jemalloc.git
+git://canonware.com/jemalloc.git
+
+* 3.0.0 (XXX not yet released)
+
+  Although this version adds some major new features, the primary focus is on
+  internal code cleanup that facilitates maintainability and portability, most
+  of which is not reflected in the ChangeLog.  This is the first release to
+  incorporate substantial contributions from numerous other developers, and the
+  result is a more broadly useful allocator (see the git revision history for
+  contribution details).  Note that the license has been unified, thanks to
+  Facebook granting a license under the same terms as the other copyright
+  holders (see COPYING).
+
+  New features:
+  - Implement Valgrind support, redzones, and quarantine.
+  - Add support for additional operating systems:
++ FreeBSD
++ Mac OS X Lion
+  - Add support for additional architectures:
++ MIPS
++ SH4
++ Tilera
+  - Add support for cross compiling.
+  - Add nallocm(), which rounds a request size up to the nearest size class
+without actually allocating.
+  - Implement aligned_alloc() (blame C11).
+  - Add the --disable-munmap option, and make it the default on Linux.
+  - Add the --with-mangling option.
+  - Add the --disable-experimental option.
+  - Add the thread.tcache.enabled mallctl.
+
+  Incompatible changes:
+  - Enable stats by default.
+  - Enable fill by default.
+  - Disable lazy locking by default.
+  - Rename the tcache.flush mallctl to thread.tcache.flush.
+  - Rename the arenas.pagesize mallctl to arenas.page.
+
+  Removed features:
+  - Remove

Re: svn commit: r234370 - in head: contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include contrib/jemalloc/include/jemalloc contrib/jemalloc/include/jemalloc/internal contrib/jemalloc/src incl

2012-04-17 Thread Jason Evans
On Apr 17, 2012, at 11:05 AM, Adrian Chadd wrote:
 On 17 April 2012 02:43, Bjoern A. Zeeb b...@freebsd.org wrote:
 
 Actually it seems these failed:
 
 arm.armeb buildworld failed, check _.arm.armeb.buildworld for details
 arm.arm buildworld failed, check _.arm.arm.buildworld for details
 mips.mips64 buildworld failed, check _.mips.mips64.buildworld for details
 mips.mipsel buildworld failed, check _.mips.mipsel.buildworld for details
 mips.mips64el buildworld failed, check _.mips.mips64el.buildworld for details
 mips.mipsn32 buildworld failed, check _.mips.mipsn32.buildworld for details
 mips.mips buildworld failed, check _.mips.mips.buildworld for details
 i386.i386 buildworld failed, check _.i386.i386.buildworld for details
 pc98.i386 buildworld failed, check _.pc98.i386.buildworld for details
 powerpc.powerpc buildworld failed, check _.powerpc.powerpc.buildworld for 
 details
 powerpc.powerpc64 buildworld failed, check _.powerpc.powerpc64.buildworld 
 for details
 
 This looks like it only works on amd64 and sparc64. Lucky them. :)

It could have been worse; I only tested on amd64. ;-)

Seriously though, I should be able to get this straightened out today.

Jason___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r234395 - head

2012-04-17 Thread Jason Evans
Author: jasone
Date: Tue Apr 17 20:21:04 2012
New Revision: 234395
URL: http://svn.freebsd.org/changeset/base/234395

Log:
  Add an UPDATING entry for the contrib/jemalloc import.

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Tue Apr 17 20:16:49 2012(r234394)
+++ head/UPDATING   Tue Apr 17 20:21:04 2012(r234395)
@@ -22,6 +22,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
machines to maximize performance.  (To disable malloc debugging, run
ln -s aj /etc/malloc.conf.)
 
+20120417:
+   The malloc(3) implementation embedded in libc now uses sources imported
+   as contrib/jemalloc.  The most disruptive API change is to
+   /etc/malloc.conf.  If your system has an old-style /etc/malloc.conf,
+   delete it prior to installworld, and optionally re-create it using the
+   new format after rebooting.  See malloc.conf(5) for details
+   (specifically the TUNING section and the opt.* entries in the MALLCTL
+   NAMESPACE section).
+
 20120328:
Big-endian MIPS TARGET_ARCH values no longer end in eb.  mips64eb
is now spelled mips64.  mipsn32eb is now spelled mipsn32.  mipseb is
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r234396 - head

2012-04-17 Thread Jason Evans
Author: jasone
Date: Tue Apr 17 20:35:54 2012
New Revision: 234396
URL: http://svn.freebsd.org/changeset/base/234396

Log:
  Update directions on how to disable malloc debugging.

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Tue Apr 17 20:21:04 2012(r234395)
+++ head/UPDATING   Tue Apr 17 20:35:54 2012(r234396)
@@ -19,8 +19,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
includes various WITNESS- related kernel options, INVARIANTS, malloc
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 disable malloc debugging, run
-   ln -s aj /etc/malloc.conf.)
+   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.)
 
 20120417:
The malloc(3) implementation embedded in libc now uses sources imported
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r234402 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal

2012-04-17 Thread Jason Evans
Author: jasone
Date: Tue Apr 17 22:05:55 2012
New Revision: 234402
URL: http://svn.freebsd.org/changeset/base/234402

Log:
  Import jemalloc b57d3ec571c6551231be62b7bf92c084a8c8291c (dev branch,
  prior to 3.0.0 release), which supports atomic operations based on atomic(9).
  This should fix build failures for several platforms.

Modified:
  head/contrib/jemalloc/FREEBSD-diffs
  head/contrib/jemalloc/VERSION
  head/contrib/jemalloc/doc/jemalloc.3
  head/contrib/jemalloc/include/jemalloc/internal/atomic.h
  head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h
  head/contrib/jemalloc/include/jemalloc/jemalloc.h
  head/contrib/jemalloc/include/jemalloc/jemalloc_defs.h

Modified: head/contrib/jemalloc/FREEBSD-diffs
==
--- head/contrib/jemalloc/FREEBSD-diffs Tue Apr 17 21:55:35 2012
(r234401)
+++ head/contrib/jemalloc/FREEBSD-diffs Tue Apr 17 22:05:55 2012
(r234402)
@@ -45,17 +45,19 @@ index 98d0ba4..23d2152 100644
 +  /refsect1
  /refentry
 diff --git a/include/jemalloc/internal/jemalloc_internal.h.in 
b/include/jemalloc/internal/jemalloc_internal.h.in
-index aa21aa5..e0f5fed 100644
+index 905653a..b235a0d 100644
 --- a/include/jemalloc/internal/jemalloc_internal.h.in
 +++ b/include/jemalloc/internal/jemalloc_internal.h.in
-@@ -1,3 +1,6 @@
+@@ -1,5 +1,8 @@
+ #ifndef JEMALLOC_INTERNAL_H
+ #define JEMALLOC_INTERNAL_H
 +#include libc_private.h
 +#include namespace.h
 +
  #include sys/mman.h
  #include sys/param.h
  #include sys/syscall.h
-@@ -33,6 +36,9 @@
+@@ -35,6 +38,9 @@
  #include pthread.h
  #include math.h
  

Modified: head/contrib/jemalloc/VERSION
==
--- head/contrib/jemalloc/VERSION   Tue Apr 17 21:55:35 2012
(r234401)
+++ head/contrib/jemalloc/VERSION   Tue Apr 17 22:05:55 2012
(r234402)
@@ -1 +1 @@
-1.0.0-258-g9ef7f5dc34ff02f50d401e41c8d9a4a928e7c2aa
+1.0.0-266-gb57d3ec571c6551231be62b7bf92c084a8c8291c

Modified: head/contrib/jemalloc/doc/jemalloc.3
==
--- head/contrib/jemalloc/doc/jemalloc.3Tue Apr 17 21:55:35 2012
(r234401)
+++ head/contrib/jemalloc/doc/jemalloc.3Tue Apr 17 22:05:55 2012
(r234402)
@@ -2,12 +2,12 @@
 .\ Title: JEMALLOC
 .\Author: Jason Evans
 .\ Generator: DocBook XSL Stylesheets v1.76.1 http://docbook.sf.net/
-.\  Date: 04/16/2012
+.\  Date: 04/17/2012
 .\Manual: User Manual
-.\Source: jemalloc 1.0.0-258-g9ef7f5dc34ff02f50d401e41c8d9a4a928e7c2aa
+.\Source: jemalloc 1.0.0-266-gb57d3ec571c6551231be62b7bf92c084a8c8291c
 .\  Language: English
 .\
-.TH JEMALLOC 3 04/16/2012 jemalloc 1.0.0-258-g9ef7f5dc34 User Manual
+.TH JEMALLOC 3 04/17/2012 jemalloc 1.0.0-266-gb57d3ec571 User Manual
 .\ -
 .\ * Define some portability stuff
 .\ -
@@ -31,7 +31,7 @@
 jemalloc \- general purpose memory allocation functions
 .SH LIBRARY
 .PP
-This manual describes jemalloc 
1\.0\.0\-258\-g9ef7f5dc34ff02f50d401e41c8d9a4a928e7c2aa\. More information 
can be found at the
+This manual describes jemalloc 
1\.0\.0\-266\-gb57d3ec571c6551231be62b7bf92c084a8c8291c\. More information 
can be found at the
 \m[blue]\fBjemalloc website\fR\m[]\\s-2\u[1]\d\s+2\.
 .PP
 The following configuration options are enabled in libc\*(Aqs built\-in 
jemalloc:

Modified: head/contrib/jemalloc/include/jemalloc/internal/atomic.h
==
--- head/contrib/jemalloc/include/jemalloc/internal/atomic.hTue Apr 17 
21:55:35 2012(r234401)
+++ head/contrib/jemalloc/include/jemalloc/internal/atomic.hTue Apr 17 
22:05:55 2012(r234402)
@@ -32,7 +32,8 @@ unsigned  atomic_sub_u(unsigned *p, unsig
 #if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_ATOMIC_C_))
 
/**/
 /* 64-bit operations. */
-#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
+#if (LG_SIZEOF_PTR == 3 || LG_SIZEOF_INT == 3)
+#  ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
 JEMALLOC_INLINE uint64_t
 atomic_add_uint64(uint64_t *p, uint64_t x)
 {
@@ -60,7 +61,7 @@ atomic_sub_uint64(uint64_t *p, uint64_t 
 
return (OSAtomicAdd64(-((int64_t)x), (int64_t *)p));
 }
-#elif (defined(__amd64__) || defined(__x86_64__))
+#  elif (defined(__amd64__) || defined(__x86_64__))
 JEMALLOC_INLINE uint64_t
 atomic_add_uint64(uint64_t *p, uint64_t x)
 {
@@ -87,7 +88,29 @@ atomic_sub_uint64(uint64_t *p, uint64_t 
 
return (x);
 }
-#elif (defined(JE_FORCE_SYNC_COMPARE_AND_SWAP_8))
+#  elif (defined(JEMALLOC_ATOMIC9))
+JEMALLOC_INLINE uint64_t
+atomic_add_uint64(uint64_t *p, uint64_t x)
+{
+
+   /*
+* atomic_fetchadd_64() doesn't exist, but we only

svn commit: r234236 - head/share/misc

2012-04-13 Thread Jason Evans
Author: jasone
Date: Fri Apr 13 20:58:01 2012
New Revision: 234236
URL: http://svn.freebsd.org/changeset/base/234236

Log:
  Added myself to committers-src.dot.

Modified:
  head/share/misc/committers-src.dot

Modified: head/share/misc/committers-src.dot
==
--- head/share/misc/committers-src.dot  Fri Apr 13 20:23:32 2012
(r234235)
+++ head/share/misc/committers-src.dot  Fri Apr 13 20:58:01 2012
(r234236)
@@ -156,6 +156,7 @@ iedowse [label=Ian Dowse\niedowse@FreeB
 imp [label=Warner Losh\n...@freebsd.org\n1996/09/20]
 ivoras [label=Ivan Voras\nivo...@freebsd.org\n2008/06/10]
 jamie [label=Jamie Gritton\nja...@freebsd.org\n2009/01/28]
+jasone [label=Jason Evans\njas...@freebsd.org\n1999/03/03]
 jceel [label=Jakub Klama\njc...@freebsd.org\n2011/09/25]
 jchandra [label=Jayachandran C.\njchan...@freebsd.org\n2010/05/19]
 jeff [label=Jeff Roberson\nj...@freebsd.org\n2002/02/21]
@@ -478,6 +479,7 @@ marcel - arun
 marcel - marius
 marcel - nwhitehorn
 
+markm - jasone
 markm - sheldonh
 
 mav - ae
@@ -494,6 +496,7 @@ mlaier - thompsa
 mlaier - eri
 
 msmith - cokane
+msmith - jasone
 msmith - scottl
 
 murray - delphij
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r204493 - head/lib/libc/stdlib

2010-02-28 Thread Jason Evans
Author: jasone
Date: Sun Feb 28 22:57:13 2010
New Revision: 204493
URL: http://svn.freebsd.org/changeset/base/204493

Log:
  Rewrite red-black trees to do lazy balance fixup.  This improves
  insert/remove speed by ~30%.

Modified:
  head/lib/libc/stdlib/malloc.c
  head/lib/libc/stdlib/rb.h

Modified: head/lib/libc/stdlib/malloc.c
==
--- head/lib/libc/stdlib/malloc.c   Sun Feb 28 22:33:53 2010
(r204492)
+++ head/lib/libc/stdlib/malloc.c   Sun Feb 28 22:57:13 2010
(r204493)
@@ -194,6 +194,7 @@ __FBSDID($FreeBSD$);
 
 #include un-namespace.h
 
+#defineRB_COMPACT
 #include rb.h
 #if (defined(MALLOC_TCACHE)  defined(MALLOC_STATS))
 #include qr.h
@@ -1746,7 +1747,7 @@ extent_szad_comp(extent_node_t *a, exten
 }
 
 /* Wrap red-black tree macros in functions. */
-rb_wrap(__unused static, extent_tree_szad_, extent_tree_t, extent_node_t,
+rb_gen(__unused static, extent_tree_szad_, extent_tree_t, extent_node_t,
 link_szad, extent_szad_comp)
 #endif
 
@@ -1760,7 +1761,7 @@ extent_ad_comp(extent_node_t *a, extent_
 }
 
 /* Wrap red-black tree macros in functions. */
-rb_wrap(__unused static, extent_tree_ad_, extent_tree_t, extent_node_t, 
link_ad,
+rb_gen(__unused static, extent_tree_ad_, extent_tree_t, extent_node_t, link_ad,
 extent_ad_comp)
 
 /*
@@ -2346,7 +2347,7 @@ arena_chunk_comp(arena_chunk_t *a, arena
 }
 
 /* Wrap red-black tree macros in functions. */
-rb_wrap(__unused static, arena_chunk_tree_dirty_, arena_chunk_tree_t,
+rb_gen(__unused static, arena_chunk_tree_dirty_, arena_chunk_tree_t,
 arena_chunk_t, link_dirty, arena_chunk_comp)
 
 static inline int
@@ -2362,7 +2363,7 @@ arena_run_comp(arena_chunk_map_t *a, are
 }
 
 /* Wrap red-black tree macros in functions. */
-rb_wrap(__unused static, arena_run_tree_, arena_run_tree_t, arena_chunk_map_t,
+rb_gen(__unused static, arena_run_tree_, arena_run_tree_t, arena_chunk_map_t,
 link, arena_run_comp)
 
 static inline int
@@ -2394,7 +2395,7 @@ arena_avail_comp(arena_chunk_map_t *a, a
 }
 
 /* Wrap red-black tree macros in functions. */
-rb_wrap(__unused static, arena_avail_tree_, arena_avail_tree_t,
+rb_gen(__unused static, arena_avail_tree_, arena_avail_tree_t,
 arena_chunk_map_t, link, arena_avail_comp)
 
 static inline void
@@ -2824,6 +2825,18 @@ arena_run_alloc(arena_t *arena, size_t s
return (run);
 }
 
+#ifdef MALLOC_DEBUG
+static arena_chunk_t *
+chunks_dirty_iter_cb(arena_chunk_tree_t *tree, arena_chunk_t *chunk, void *arg)
+{
+   size_t *ndirty = (size_t *)arg;
+
+   assert(chunk-dirtied);
+   *ndirty += chunk-ndirty;
+   return (NULL);
+}
+#endif
+
 static void
 arena_purge(arena_t *arena)
 {
@@ -2832,11 +2845,8 @@ arena_purge(arena_t *arena)
 #ifdef MALLOC_DEBUG
size_t ndirty = 0;
 
-   rb_foreach_begin(arena_chunk_t, link_dirty, arena-chunks_dirty,
-   chunk) {
-   assert(chunk-dirtied);
-   ndirty += chunk-ndirty;
-   } rb_foreach_end(arena_chunk_t, link_dirty, arena-chunks_dirty, chunk)
+   arena_chunk_tree_dirty_iter(arena-chunks_dirty, NULL,
+   chunks_dirty_iter_cb, (void *)ndirty);
assert(ndirty == arena-ndirty);
 #endif
assert((arena-nactive  opt_lg_dirty_mult)  arena-ndirty);

Modified: head/lib/libc/stdlib/rb.h
==
--- head/lib/libc/stdlib/rb.h   Sun Feb 28 22:33:53 2010(r204492)
+++ head/lib/libc/stdlib/rb.h   Sun Feb 28 22:57:13 2010(r204493)
@@ -1,6 +1,7 @@
-/**
+/*-
+ 
***
  *
- * Copyright (C) 2008 Jason Evans jas...@freebsd.org.
+ * Copyright (C) 2008-2010 Jason Evans jas...@freebsd.org.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -29,40 +30,23 @@
  *
  **
  *
- * cpp macro implementation of left-leaning red-black trees.
+ * cpp macro implementation of left-leaning 2-3 red-black trees.  Parent
+ * pointers are not used, and color bits are stored in the least significant
+ * bit of right-child pointers (if RB_COMPACT is defined), thus making node
+ * linkage as compact as is possible for red-black trees.
  *
  * Usage:
  *
- *   (Optional, see assert(3).)
- *   #define NDEBUG
- *
- *   (Required.)
+ *   #include stdint.h
+ *   #include stdbool.h
+ *   #define NDEBUG // (Optional, see assert(3).)
  *   #include assert.h
+ *   #define RB_COMPACT // (Optional, embed color bits in right-child 
pointers.)
  *   #include rb.h
  *   ...
  *
- * All operations are done non-recursively.  Parent pointers are not used, and
- * color bits are stored in the least significant bit of right-child pointers,
- * thus making node linkage as compact

svn commit: r203329 - head/lib/libc/stdlib

2010-01-31 Thread Jason Evans
 objects, or backing
+one large object).
 The combination of chunk alignment and chunk page maps makes it possible to
 determine all metadata regarding small and large allocations in constant time.
 .Pp
-Small objects are managed in groups by page runs.
+Small and medium objects are managed in groups by page runs.
 Each run maintains a bitmap that tracks which regions are in use.
 Allocation requests that are no more than half the quantum (8 or 16, depending
 on architecture) are rounded up to the nearest power of two.
@@ -419,10 +419,17 @@ Allocation requests that are more than t
 class, but no more than the minimum subpage-multiple size class (see the
 .Dq C
 option) are rounded up to the nearest multiple of the cacheline size (64).
-Allocation requests that are more than the minimum subpage-multiple size class
-are rounded up to the nearest multiple of the subpage size (256).
-Allocation requests that are more than one page, but small enough to fit in
-an arena-managed chunk (see the
+Allocation requests that are more than the minimum subpage-multiple size class,
+but no more than the maximum subpage-multiple size class are rounded up to the
+nearest multiple of the subpage size (256).
+Allocation requests that are more than the maximum subpage-multiple size class,
+but no more than the maximum medium size class (see the
+.Dq M
+option) are rounded up to the nearest medium size class; spacing is an
+automatically determined power of two and ranges from the subpage size to the
+page size.
+Allocation requests that are more than the maximum medium size class, but small
+enough to fit in an arena-managed chunk (see the
 .Dq K
 option), are rounded up to the nearest run size.
 Allocation requests that are too large to fit in an arena-managed chunk are
@@ -480,13 +487,12 @@ option is set, all warnings are treated 
 .Pp
 The
 .Va _malloc_message
-variable allows the programmer to override the function which emits
-the text strings forming the errors and warnings if for some reason
-the
-.Dv stderr
+variable allows the programmer to override the function which emits the text
+strings forming the errors and warnings if for some reason the
+.Dv STDERR_FILENO
 file descriptor is not suitable for this.
-Please note that doing anything which tries to allocate memory in
-this function is likely to result in a crash or deadlock.
+Please note that doing anything which tries to allocate memory in this function
+is likely to result in a crash or deadlock.
 .Pp
 All messages are prefixed by
 .Dq Ao Ar progname Ac Ns Li : (malloc) .

Modified: head/lib/libc/stdlib/malloc.c
==
--- head/lib/libc/stdlib/malloc.c   Sun Jan 31 22:31:01 2010
(r203328)
+++ head/lib/libc/stdlib/malloc.c   Sun Jan 31 23:16:10 2010
(r203329)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (C) 2006-2008 Jason Evans jas...@freebsd.org.
+ * Copyright (C) 2006-2010 Jason Evans jas...@freebsd.org.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -47,58 +47,67 @@
  *
  * Allocation requests are rounded up to the nearest size class, and no record
  * of the original request size is maintained.  Allocations are broken into
- * categories according to size class.  Assuming runtime defaults, 4 kB pages
+ * categories according to size class.  Assuming runtime defaults, 4 KiB pages
  * and a 16 byte quantum on a 32-bit system, the size classes in each category
  * are as follows:
  *
- *   |===|
- *   | Category | Subcategory  |Size |
- *   |===|
- *   | Small| Tiny |   2 |
- *   |  |  |   4 |
- *   |  |  |   8 |
- *   |  |--+-|
- *   |  | Quantum-spaced   |  16 |
- *   |  |  |  32 |
- *   |  |  |  48 |
- *   |  |  | ... |
- *   |  |  |  96 |
- *   |  |  | 112 |
- *   |  |  | 128 |
- *   |  |--+-|
- *   |  | Cacheline-spaced | 192 |
- *   |  |  | 256 |
- *   |  |  | 320 |
- *   |  |  | 384 |
- *   |  |  | 448 |
- *   |  |  | 512 |
- *   |  |--+-|
- *   |  | Sub-page | 760 |
- *   |  |  |1024 |
- *   |  |  |1280 |
- *   |  |  | ... |
- *   |  |  |3328 |
- *   |  |  |3584 |
- *   |  |  |3840 |
- *   |===|
- *   | Large

svn commit: r200340 - head/lib/libc/stdlib

2009-12-09 Thread Jason Evans
Author: jasone
Date: Thu Dec 10 00:16:11 2009
New Revision: 200340
URL: http://svn.freebsd.org/changeset/base/200340

Log:
  Fix the posix_memalign() changes in r196861 to actually return a NULL pointer
  as intended.
  
  PR:   standards/138307

Modified:
  head/lib/libc/stdlib/malloc.c

Modified: head/lib/libc/stdlib/malloc.c
==
--- head/lib/libc/stdlib/malloc.c   Wed Dec  9 23:14:53 2009
(r200339)
+++ head/lib/libc/stdlib/malloc.c   Thu Dec 10 00:16:11 2009
(r200340)
@@ -5340,6 +5340,7 @@ posix_memalign(void **memptr, size_t ali
size = 1;
else {
result = NULL;
+   *memptr = NULL;
ret = 0;
goto RETURN;
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r200345 - head/lib/libc/stdlib

2009-12-09 Thread Jason Evans
Author: jasone
Date: Thu Dec 10 02:51:40 2009
New Revision: 200345
URL: http://svn.freebsd.org/changeset/base/200345

Log:
  Simplify arena_run_reg_dalloc(), and remove a bug that was due to incorrect
  initialization of ssize_invs.

Modified:
  head/lib/libc/stdlib/malloc.c

Modified: head/lib/libc/stdlib/malloc.c
==
--- head/lib/libc/stdlib/malloc.c   Thu Dec 10 01:45:06 2009
(r200344)
+++ head/lib/libc/stdlib/malloc.c   Thu Dec 10 02:51:40 2009
(r200345)
@@ -2419,7 +2419,7 @@ arena_run_reg_alloc(arena_run_t *run, ar
 static inline void
 arena_run_reg_dalloc(arena_run_t *run, arena_bin_t *bin, void *ptr, size_t 
size)
 {
-   unsigned diff, regind, elm, bit;
+   unsigned shift, diff, regind, elm, bit;
 
assert(run-magic == ARENA_RUN_MAGIC);
 
@@ -2428,31 +2428,16 @@ arena_run_reg_dalloc(arena_run_t *run, a
 * actual division here can reduce allocator throughput by over 20%!
 */
diff = (unsigned)((uintptr_t)ptr - (uintptr_t)run - bin-reg0_offset);
-   if ((size  (size - 1)) == 0) {
-   /*
-* log2_table allows fast division of a power of two in the
-* [1..128] range.
-*
-* (x / divisor) becomes (x  log2_table[divisor - 1]).
-*/
-   static const unsigned char log2_table[] = {
-   0, 1, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 4,
-   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,
-   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,
-   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7
-   };
 
-   if (size = 128)
-   regind = (diff  log2_table[size - 1]);
-   else if (size = 32768)
-   regind = diff  (8 + log2_table[(size  8) - 1]);
-   else
-   regind = diff / size;
-   } else if (size  qspace_max) {
+   /* Rescale (factor powers of 2 out of the numerator and denominator). */
+   shift = ffs(size) - 1;
+   diff = shift;
+   size = shift;
+
+   if (size == 1) {
+   /* The divisor was a power of 2. */
+   regind = diff;
+   } else {
/*
 * To divide by a number D that is not a power of two we
 * multiply by (2^21 / D) and then right shift by 21 positions.
@@ -2461,78 +2446,32 @@ arena_run_reg_dalloc(arena_run_t *run, a
 *
 * becomes
 *
-*   (X * qsize_invs[(D  QUANTUM_2POW) - 3])
-*SIZE_INV_SHIFT
+*   (X * size_invs[D - 3])  SIZE_INV_SHIFT
 *
 * We can omit the first three elements, because we never
-* divide by 0, and QUANTUM and 2*QUANTUM are both powers of
-* two, which are handled above.
+* divide by 0, and 1 and 2 are both powers of two, which are
+* handled above.
 */
 #defineSIZE_INV_SHIFT 21
-#defineQSIZE_INV(s) (((1U  SIZE_INV_SHIFT) / (s  QUANTUM_2POW)) + 
1)
-   static const unsigned qsize_invs[] = {
-   QSIZE_INV(3),
-   QSIZE_INV(4), QSIZE_INV(5), QSIZE_INV(6), QSIZE_INV(7)
-#if (QUANTUM_2POW  4)
-   ,
-   QSIZE_INV(8), QSIZE_INV(9), QSIZE_INV(10), QSIZE_INV(11),
-   QSIZE_INV(12),QSIZE_INV(13), QSIZE_INV(14), QSIZE_INV(15)
-#endif
-   };
-   assert(QUANTUM * (((sizeof(qsize_invs)) / sizeof(unsigned)) + 3)
-   = (1U  QSPACE_MAX_2POW_DEFAULT));
-
-   if (size = (((sizeof(qsize_invs) / sizeof(unsigned)) + 2) 
-   QUANTUM_2POW)) {
-   regind = qsize_invs[(size  QUANTUM_2POW) - 3] * diff;
-   regind = SIZE_INV_SHIFT;
-   } else
-   regind = diff / size;
-#undef QSIZE_INV
-   } else if (size  cspace_max) {
-#defineCSIZE_INV(s) (((1U  SIZE_INV_SHIFT) / (s  CACHELINE_2POW)) 
+ 1)
-   static const unsigned csize_invs[] = {
-   CSIZE_INV(3),
-   CSIZE_INV(4), CSIZE_INV(5), CSIZE_INV(6), CSIZE_INV(7)
+#defineSIZE_INV(s) (((1U  SIZE_INV_SHIFT) / (s)) + 1)
+   static const unsigned size_invs[] = {
+   SIZE_INV(3),
+   SIZE_INV(4), SIZE_INV(5), SIZE_INV(6), SIZE_INV(7),
+   SIZE_INV(8), SIZE_INV(9), SIZE_INV(10), SIZE_INV(11),
+   SIZE_INV(12), 

svn commit: r185483 - head/lib/libc/stdlib

2008-11-30 Thread Jason Evans
Author: jasone
Date: Sun Nov 30 19:30:31 2008
New Revision: 185483
URL: http://svn.freebsd.org/changeset/base/185483

Log:
  Adjust an assertion to handle the case where a lock is contested, but
  spinning is avoided due to running on a single-CPU system.
  
  Reported by:  stefanf

Modified:
  head/lib/libc/stdlib/malloc.c

Modified: head/lib/libc/stdlib/malloc.c
==
--- head/lib/libc/stdlib/malloc.c   Sun Nov 30 19:06:35 2008
(r185482)
+++ head/lib/libc/stdlib/malloc.c   Sun Nov 30 19:30:31 2008
(r185483)
@@ -1284,7 +1284,7 @@ malloc_spin_lock(pthread_mutex_t *lock)
 * inversion.
 */
_pthread_mutex_lock(lock);
-   assert((ret  BLOCK_COST_2POW) != 0);
+   assert((ret  BLOCK_COST_2POW) != 0 || ncpus == 1);
return (ret  BLOCK_COST_2POW);
}
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]