summaryrefslogtreecommitdiff
path: root/doc
Commit message (Collapse)AuthorAgeFilesLines
* Remove duplicated words in documentationJasmin Parent2022-07-111-3/+1
|
* Make the default option of zero realloc match the system allocator.Qi Wang2022-05-051-7/+8
|
* Small doc tweak of opt.trust_madvise.Qi Wang2022-04-281-4/+3
| | | | Avoid quoted enabled and disabled because it's a bool type instead of char *.
* Minor typo fix in doc.Qi Wang2022-04-271-1/+1
|
* Correct the name of stats.mutexes.prof_thds_data in doc.Qi Wang2022-04-251-1/+1
|
* fix some typoscuishuang2022-04-251-1/+1
| | | | Signed-off-by: cuishuang <imcusg@gmail.com>
* Rename zero_realloc option "strict" to "alloc".Qi Wang2022-04-201-3/+3
| | | | | With realloc(ptr, 0) being UB per C23, the option name "strict" makes less sense now. Rename to "alloc" which describes the behavior.
* Add prof_leak_error optionyunxu2022-01-211-0/+19
| | | | | | The option makes the process to exit with error code 1 if a memory leak is detected. This is useful for implementing automated tools that rely on leak detection.
* Correct opt.prof_leak documentationAlex Lapenkou2021-11-231-2/+4
| | | | | | | The option has been misleading, because it stays disabled unless prof_final is also specified. In practice it's impossible to detect that the option is silently disabled, because it just doesn't provide any output as if there are no memory leaks detected.
* Rename prof.dump_prefix to prof.prefixQi Wang2021-08-121-14/+8
| | | | | This better aligns with our naming convention. The option has not been included in any upstream release yet.
* Fix doc large size 54 KiB errorlirui2021-03-261-1/+1
|
* Implement opt.cache_oblivious.Qi Wang2021-02-111-0/+16
| | | | Keep config.cache_oblivious for now to remain backward-compatible.
* Add runtime detection for MADV_DONTNEED zeroes pages (mostly for qemu)Azat Khuzhin2021-01-201-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qemu does not support this, yet [1], and you can get very tricky assert if you will run program with jemalloc in use under qemu: <jemalloc>: ../contrib/jemalloc/src/extent.c:1195: Failed assertion: "p[i] == 0" [1]: https://patchwork.kernel.org/patch/10576637/ Here is a simple example that shows the problem [2]: // Gist to check possible issues with MADV_DONTNEED // For example it does not supported by qemu user // There is a patch for this [1], but it hasn't been applied. // [1]: https://lists.gnu.org/archive/html/qemu-devel/2018-08/msg05422.html #include <sys/mman.h> #include <stdio.h> #include <stddef.h> #include <assert.h> #include <string.h> int main(int argc, char **argv) { void *addr = mmap(NULL, 1<<16, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); if (addr == MAP_FAILED) { perror("mmap"); return 1; } memset(addr, 'A', 1<<16); if (!madvise(addr, 1<<16, MADV_DONTNEED)) { puts("MADV_DONTNEED does not return error. Check memory."); for (int i = 0; i < 1<<16; ++i) { assert(((unsigned char *)addr)[i] == 0); } } else { perror("madvise"); } if (munmap(addr, 1<<16)) { perror("munmap"); return 1; } return 0; } ### unpatched qemu $ qemu-x86_64-static /tmp/test-MADV_DONTNEED MADV_DONTNEED does not return error. Check memory. test-MADV_DONTNEED: /tmp/test-MADV_DONTNEED.c:19: main: Assertion `((unsigned char *)addr)[i] == 0' failed. qemu: uncaught target signal 6 (Aborted) - core dumped Aborted (core dumped) ### patched qemu (by returning ENOSYS error) $ qemu-x86_64 /tmp/test-MADV_DONTNEED madvise: Success ### patch for qemu to return ENOSYS diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 897d20c076..5540792e0e 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -11775,7 +11775,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, turns private file-backed mappings into anonymous mappings. This will break MADV_DONTNEED. This is a hint, so ignoring and returning success is ok. */ - return 0; + return ENOSYS; #endif #ifdef TARGET_NR_fcntl64 case TARGET_NR_fcntl64: [2]: https://gist.github.com/azat/12ba2c825b710653ece34dba7f926ece v2: - review fixes - add opt_dont_trust_madvise v3: - review fixes - rename opt_dont_trust_madvise to opt_trust_madvise
* Allow opt.tcache_max to accept small size classes.Qi Wang2020-10-241-1/+1
| | | | | | | | | Previously all the small size classes were cached. However this has downsides -- particularly when page size is greater than 4K (e.g. iOS), which will result in much higher SMALL_MAXCLASS. This change allows tcache_max to be set to lower values, to better control resources taken by tcache.
* Switch from opt.lg_tcache_max to opt.tcache_maxQi Wang2020-10-221-7/+9
| | | | Though for convenience, keep parsing lg_tcache_max.
* Add a hard limit on tcache max size class.Qi Wang2020-10-161-2/+2
| | | | | | For locality reasons, tcache bins are integrated in TSD. Allowing all size classes to be cached has little benefit, but takes up much thread local storage. In addition, it complicates the layout which we try hard to optimize.
* Verify output space before doing heavy work in mallctlYinan Zhang2020-07-271-2/+19
|
* Modify mallctl output length when neededYinan Zhang2020-07-271-1/+2
| | | | | This is the only reason why `oldlenp` was designed to be in the form of a pointer.
* Unify printing for prof counts objectYinan Zhang2020-06-291-3/+3
|
* Add thread.peak.[read|reset] mallctls.David Goldblatt2020-06-111-0/+36
| | | | These can be used to track net allocator activity on a per-thread basis.
* Implement opt.stats_interval and the _opts options.Qi Wang2020-01-291-0/+35
| | | | | | 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).
* Fix syntax errors in doc for thread.idle.Qi Wang2020-01-231-3/+3
|
* Add "thread.idle" mallctl.David Goldblatt2020-01-221-0/+22
| | | | | This can encapsulate various internal cleaning logic, and can be used to free up resources before a long sleep.
* Emphasize no modification through thread.allocatedp allowed.Qi Wang2019-11-131-2/+4
|
* Add stats counters for number of zero reallocsDavid T. Goldblatt2019-10-291-0/+15
|
* Realloc: Make behavior of realloc(ptr, 0) configurable.David T. Goldblatt2019-10-291-0/+27
|
* Add "prof.dump_prefix" to override filename prefixes for dumps.zhxchen172019-09-121-8/+34
|
* Report stats for tdatas_mtx and prof_dump_mtxYinan Zhang2019-08-091-0/+24
|
* Update manual for opt.retain (new default on Windows).Qi Wang2019-07-251-11/+11
|
* Fix logic in printingYinan Zhang2019-07-161-1/+1
| | | | | | `cbopaque` can now be overriden without overriding `write_cb` in the first place. (Otherwise there would be no need to have the `cbopaque` parameter in `malloc_message`.)
* Add confirm_conf optionYinan Zhang2019-05-221-0/+17
| | | | | | If the confirm_conf option is set, when the program starts, each of the four malloc_conf strings will be printed, and each option will be printed when being set.
* Track nfills and nflushes for arenas.i.small / large.Qi Wang2019-05-151-0/+44
| | | | | | Small is added purely for convenience. Large flushes wasn't tracked before and can be useful in analysis. Large fill simply reports nmalloc, since there is no batch fill for large currently.
* Add nonfull_slabs to bin_stats_t.Doron Roberts-Kedes2019-04-291-0/+11
| | | | | | | When config_stats is enabled track the size of bin->slabs_nonfull in the new nonfull_slabs counter in bin_stats_t. This metric should be useful for establishing an upper ceiling on the savings possible by meshing.
* Tweak the wording about oversize_threshold.Qi Wang2019-04-011-3/+3
|
* Document opt.oversize_threshold.Qi Wang2019-03-291-3/+25
|
* Rename huge_threshold to oversize_threshold.Qi Wang2019-01-251-3/+1
| | | | | The keyword huge tend to remind people of huge pages which is not relevent to the feature.
* Mention different mmap(2) behaviour with retain:true.Edward Tomasz Napierala2019-01-231-0/+3
|
* Add stats for the size of extent_avail heapTyler Etzel2018-08-021-0/+11
|
* Add extents information to mallocstats outputTyler Etzel2018-08-021-4/+29
| | | | - Show number/bytes of extents of each size that are dirty, muzzy, retained.
* Rename huge_threshold to experimental, and tweak documentation.Qi Wang2018-06-291-5/+8
|
* Mallctl: Add arenas.lookupLatchesar Ionkov2018-05-011-0/+9
| | | | | Implement a new mallctl operation that allows looking up the arena a region of memory belongs to.
* Document liveness requirements for extent_hooks_t structures.Qi Wang2018-04-111-1/+3
|
* background_thread: add max thread count configDave Watson2018-04-101-0/+23
| | | | | Looking at the thread counts in our services, jemalloc's background thread is useful, but mostly idle. Add a config option to tune down the number of threads.
* Add opt.thp which allows explicit hugepage usage.Qi Wang2018-03-081-0/+22
| | | | | | | | "always" marks all user mappings as MADV_HUGEPAGE; while "never" marks all mappings as MADV_NOHUGEPAGE. The default setting "default" does not change any settings. Note that all the madvise calls are part of the default extent hooks by design, so that customized extent hooks have complete control over the mappings including hugepage settings.
* Remove config.thp which wasn't in use.Qi Wang2018-03-081-10/+0
|
* Add opt.lg_extent_max_active_fitQi Wang2017-11-161-0/+16
| | | | | | | | | | When allocating from dirty extents (which we always prefer if available), large active extents can get split even if the new allocation is much smaller, in which case the introduced fragmentation causes high long term damage. This new option controls the threshold to reuse and split an existing active extent. We avoid using a large extent for much smaller sizes, in order to reduce fragmentation. In some workload, adding the threshold improves virtual memory usage by >10x.
* Add arena.i.retain_grow_limitQi Wang2017-11-031-0/+16
| | | | | | | This option controls the max size when grow_retained. This is useful when we have customized extent hooks reserving physical memory (e.g. 1G huge pages). Without this feature, the default increasing sequence could result in fragmented and wasted physical memory.
* Document the potential issues about opt.background_thread.Qi Wang2017-10-111-3/+6
|
* Fix a link for dirty_decay_ms in manual.Qi Wang2017-09-111-1/+1
|
* Add stats for metadata_thp.Qi Wang2017-08-301-0/+26
| | | | Report number of THPs used in arena and aggregated stats.