Yinan Zhang
95a59d2f72
Unify tcache flag reading and selection
2020-06-19 11:06:05 -07:00
Yinan Zhang
4b0c008489
Unify zero flag reading and setting
2020-06-19 11:06:05 -07:00
Yinan Zhang
2a84f9b8fc
Unify alignment flag reading and computation
2020-06-19 11:06:05 -07:00
Yinan Zhang
40fa6674a9
Fix prof timestamp conf reading
2020-06-17 16:02:51 -07:00
David Goldblatt
40672b0b78
Remove duplicate logging in malloc.
2020-06-16 10:33:55 -07:00
Jon Haslam
4aea743279
High Resolution Timestamps for Profiling
2020-06-15 12:12:49 -07:00
David Goldblatt
6cdac3c573
Tcache: Make flush fractions configurable.
2020-05-16 13:34:23 -07:00
David Goldblatt
ee72bf1cfd
Tcache: Add tcache gc delay option.
...
This can reduce flushing frequency for small size classes.
2020-05-16 13:34:23 -07:00
David Goldblatt
d338dd45d7
Tcache: Make incremental gc bytes configurable.
2020-05-16 13:34:23 -07:00
David Goldblatt
181093173d
Tcache: make slot sizing configurable.
2020-05-16 13:34:23 -07:00
David Goldblatt
634afc4124
Tcache: Make size computation configurable.
2020-05-16 13:34:23 -07:00
David Goldblatt
5dead37a9d
Allow narenas:default.
...
This can be useful when you know you want to override some lower-priority
configuration setting with its default value, but don't know what that value
would be.
2020-05-14 10:30:08 -07:00
Yinan Zhang
f533ab6da6
Add forking handling for stats
2020-05-11 15:35:06 -07:00
David Goldblatt
f1f8a75496
Let opt.zero propagate to core allocation.
...
I.e. set dopts->zero early on if opt.zero is true, rather than leaving it set by
the entry-point function (malloc, calloc, etc.) and then memsetting. This
avoids situations where we zero once in the large-alloc pathway and then again
via memset.
2020-05-04 12:36:45 -07:00
David Goldblatt
cd29ebefd0
Tcache: treat small and large cache bins uniformly
2020-04-14 15:20:19 -07:00
David Goldblatt
a13fbad374
Tcache: split up fast and slow path data.
2020-04-14 15:20:19 -07:00
David Goldblatt
79ae7f9211
Rtree: Remove the per-field accessors.
...
We instead split things into "edata" and "metadata".
2020-04-10 13:12:47 -07:00
David Goldblatt
294b276fc7
PA: Parameterize emap. Move emap_global to arena.
...
This lets us test the PA module without interfering with the global emap used by
the real allocator (the one not under test).
2020-04-10 13:12:47 -07:00
Yinan Zhang
09cd79495f
Encapsulate buffer allocation failure in buffered writer
2020-04-01 09:41:20 -07:00
David T. Goldblatt
d936b46d3a
Add malloc_conf_2_conf_harder
...
This comes in handy when you're just a user of a canary system who wants to
change settings set by the configuration system itself.
2020-03-31 06:25:08 -07:00
Yinan Zhang
2256ef8961
Add option to fetch system thread name on each prof sample
2020-03-24 21:39:57 -07:00
Yinan Zhang
ba783b3a0f
Remove prof -> thread_event dependency
2020-03-12 13:55:00 -07:00
Yinan Zhang
441d88d1c7
Rewrite profiling thread event
2020-03-12 13:55:00 -07:00
David Goldblatt
d701a085c2
Fast path: allow low-water mark changes.
...
This lets us put more allocations on an "almost as fast" path after a flush.
This results in around a 4% reduction in malloc cycles in prod workloads
(corresponding to about a 0.1% reduction in overall cycles).
2020-03-12 11:54:19 -07:00
David Goldblatt
79f1ee2fc0
Move junking out of arena/tcache code.
...
This is debug only and we keep it off the fast path. Moving it here simplifies
the internal logic.
This never tries to junk on regions that were shrunk via xallocx. I think this
is fine for two reasons:
- The shrunk-with-xallocx case is rare.
- We don't always do that anyway before this diff (it depends on the opt
settings and extent hooks in effect).
2020-03-12 11:54:19 -07:00
David T. Goldblatt
162c2bcf31
Background thread: take base as a parameter.
2020-02-18 11:22:09 -08:00
David T. Goldblatt
29436fa056
Break prof and tcache knowledge of b0.
2020-02-18 11:22:09 -08:00
David T. Goldblatt
a0c1f4ac57
Rtree: take the base allocator as a parameter.
...
This facilitates better testing by avoiding mixing of the "real" base with the
base used by the rtree under test.
2020-02-18 11:22:09 -08:00
David T. Goldblatt
7013716aaa
Emap: Take (and propagate) a zeroed parameter.
...
Rtree needs this, and we should really treat them similarly.
2020-02-18 11:22:09 -08:00
David Goldblatt
7e6c8a7286
Emap: Standardize naming.
...
Namespace everything under emap_, always specify what it is we're looking up
(emap_lookup -> emap_edata_lookup), and use "ctx" over "info".
2020-02-17 10:50:51 -08:00
David Goldblatt
06e42090f7
Make jemalloc.c use the emap interface.
...
While we're here, we'll also clean up some style nits.
2020-02-17 10:50:51 -08:00
David Goldblatt
f7d9c6c42d
Emap: Move in alloc_ctx lookup functionality.
2020-02-17 10:50:51 -08:00
David Goldblatt
9b5d105fc3
Emap: Move in iealloc.
...
This is logically scoped to the emap.
2020-02-17 10:50:51 -08:00
David Goldblatt
01f255161c
Add emap, for tracking extent locking.
2020-02-17 10:50:51 -08:00
Yinan Zhang
9cac3fa8f5
Encapsulate buffer allocation in buffered writer
2020-02-04 13:21:58 -08:00
Yinan Zhang
bdc08b5158
Better naming buffered writer
2020-02-04 13:21:58 -08:00
Qi Wang
e896522616
Abbreviate thread-event to te.
2020-02-04 13:07:05 -08:00
Qi Wang
5e500523a0
Remove thread_event_boot().
2020-02-04 00:18:15 -08:00
Qi Wang
97dd79db6c
Implement deallocation events.
...
Make the event module to accept two event types, and pass around the event
context. Use bytes-based events to trigger tcache GC on deallocation, and get
rid of the tcache ticker.
2020-02-04 00:18:15 -08:00
Qi Wang
974222c626
Add safety check on sdallocx slow / sampled path.
2020-01-31 00:04:22 -08:00
Qi Wang
88d9eca848
Enforce page alignment for sampled allocations.
...
This allows sampled allocations to be checked through alignment, therefore
enable sized deallocation regardless of cache_oblivious.
2020-01-31 00:04:22 -08:00
Qi Wang
88b0e03a4e
Implement opt.stats_interval and the _opts options.
...
Add options stats_interval and stats_interval_opts to allow interval based stats
printing. This provides an easy way to collect stats without code changes,
because opt.stats_print may not work (some binaries never exit).
2020-01-29 09:57:55 -08:00
Yinan Zhang
f81341a48b
Fallback to unbuffered printing if OOM
2020-01-21 17:09:44 -08:00
Qi Wang
dab81bd315
Rework and fix the assertions on malloc fastpath.
...
The first half of the malloc fastpath may execute before malloc_init. Make the
assertions work in that case.
2020-01-14 15:00:41 -08:00
Yinan Zhang
2b604a3016
Record request size in prof recent entries
2020-01-10 12:01:01 -08:00
Yinan Zhang
40a391408c
Define constructor for buffered writer argument
2020-01-10 11:59:02 -08:00
Yinan Zhang
6d8e616902
Make buffered writer an independent module
2020-01-10 11:59:02 -08:00
Yinan Zhang
6b6b4709b3
Unify buffered writer naming
2020-01-09 14:31:31 -08:00
Yinan Zhang
9a60cf54ec
Last-N profiling mode
2019-12-30 15:58:57 -08:00
David Goldblatt
c8dae890c8
Extent -> Ehooks: Move over default hooks.
2019-12-20 10:18:40 -08:00