Commit Graph

21 Commits

Author SHA1 Message Date
Oran Agra
c6a26519a1 fix a rare active defrag edge case bug leading to stagnation
There's a rare case which leads to stagnation in the defragger, causing
it to keep scanning the keyspace and do nothing (not moving any
allocation), this happens when all the allocator slabs of a certain bin
have the same % utilization, but the slab from which new allocations are
made have a lower utilization.

this commit fixes it by removing the current slab from the overall
average utilization of the bin, and also eliminate any precision loss in
the utilization calculation and move the decision about the defrag to
reside inside jemalloc.

and also add a test that consistently reproduce this issue.
2021-10-12 12:55:35 +03:00
Yoav Steinberg
908d3bdad9 Fix defrag to support sharded bins in arena (added in v5.2.1)
See 37b8913925
2021-10-10 18:29:13 +03:00
Oran Agra
91bc78a8b8 Active defrag fixes for 32bit builds (again)
* overflow in jemalloc fragmentation hint to the defragger
2021-10-10 18:29:13 +03:00
Oran Agra
29d7f97c96 add defrag hint support into jemalloc 5 2021-10-10 18:29:13 +03:00
Yoav Steinberg
4d5911b4e4 Merge commit '220a0f0880419450c9409202aac1fab4b8be0719' as 'deps/jemalloc' 2021-10-10 18:26:48 +03:00
Yoav Steinberg
4a884343f5 Delete old jemalloc before pulling in subtree. 2021-10-10 18:03:38 +03:00
Oran Agra
fd7d51c353 Resolve nonsense static analysis warnings 2021-05-03 18:59:47 +03:00
Oran Agra
88d71f4793 fix a rare active defrag edge case bug leading to stagnation
There's a rare case which leads to stagnation in the defragger, causing
it to keep scanning the keyspace and do nothing (not moving any
allocation), this happens when all the allocator slabs of a certain bin
have the same % utilization, but the slab from which new allocations are
made have a lower utilization.

this commit fixes it by removing the current slab from the overall
average utilization of the bin, and also eliminate any precision loss in
the utilization calculation and move the decision about the defrag to
reside inside jemalloc.

and also add a test that consistently reproduce this issue.
2020-05-20 16:04:42 +03:00
Oran Agra
920158ec81 Active defrag fixes for 32bit builds (again)
* overflow in jemalloc fragmentation hint to the defragger
2018-07-11 16:09:00 +03:00
Oran Agra
e8099cabd1 add defrag hint support into jemalloc 5 2018-06-27 10:52:39 +03:00
antirez
08e1c8e820 Jemalloc upgraded to version 5.0.1. 2018-05-24 17:17:37 +02:00
antirez
e3b8492e83 Revert "Jemalloc updated to 4.4.0."
This reverts commit 36c1acc222d29e6e2dc9fc25362e4faa471111bd.
2017-04-22 13:17:07 +02:00
antirez
27e29f4fe6 Jemalloc updated to 4.4.0.
The original jemalloc source tree was modified to:

1. Remove the configure error that prevents nested builds.
2. Insert the Redis private Jemalloc API in order to allow the
Redis fragmentation function to work.
2017-01-30 09:58:34 +01:00
antirez
173d692bc2 Defrag: activate it only if running modified version of Jemalloc.
This commit also includes minor aesthetic changes like removal of
trailing spaces.
2017-01-10 11:25:39 +01:00
antirez
a9951b1b6a Jemalloc updated to 4.0.3. 2015-10-06 16:55:37 +02:00
antirez
6b836b6b41 Jemalloc: use LG_QUANTUM of 3 for AMD64 and I386.
This gives us a 24 bytes size class which is dict.c dictEntry size, thus
improving the memory efficiency of Redis significantly.
Moreover other non 16 bytes aligned tiny classes are added that further
reduce the fragmentation of the allocator.

Technically speaking LG_QUANTUM should be 4 on i386 / AMD64 because of
SSE types and other 16 bytes types, however we don't use those, and our
jemalloc only targets Redis.

New versions of Jemalloc will have an explicit configure switch in order
to specify the quantum value for a platform without requiring any change
to the Jemalloc source code: we'll switch to this system when available.

This change was originally proposed by Oran Agra (@oranagra) as a change
to the Jemalloc script to generate the size classes define. We ended
doing it differently by changing LG_QUANTUM since it is apparently the
supported Jemalloc method to obtain a 24 bytes size class, moreover it
also provides us other potentially useful size classes.

Related to issue #2510.
2015-07-24 10:20:02 +02:00
antirez
fceef8e0dd Jemalloc updated to 3.6.0.
Not a single bug in about 3 months, and our previous version was
too old (3.2.0).
2014-06-20 14:59:20 +02:00
antirez
7383c3b129 Jemalloc updated to version 3.2.0. 2012-11-28 18:39:35 +01:00
antirez
ad4c0b4117 Jemalloc updated to 3.0.0.
Full changelog here:

http://www.canonware.com/cgi-bin/gitweb.cgi?p=jemalloc.git;a=blob_plain;f=ChangeLog;hb=master

Notable improvements from the point of view of Redis:

1) Bugfixing.
2) Support for Valgrind.
3) Support for OSX Lion, FreeBSD.
2012-05-16 11:09:45 +02:00
jbergstroem
1d03c1c98a Update to jemalloc 2.2.5 2011-11-23 21:36:25 +01:00
antirez
a78e148b7d jemalloc source added 2011-06-20 11:30:06 +02:00