summaryrefslogtreecommitdiff
path: root/deps/README.md
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2018-05-24 17:16:12 +0200
committerantirez <antirez@gmail.com>2018-05-24 17:16:12 +0200
commit8f4e2075a703acce08056321f49defd44dae19ed (patch)
treeabc63d2dcae9fdbe85e013d972d190a03e97001f /deps/README.md
parentde4b6cb27b4e535cfbabaddf7bb9cd6d19534cfe (diff)
downloadredis-8f4e2075a703acce08056321f49defd44dae19ed.tar.gz
Update documentation about how to upgrade Jemalloc.
Diffstat (limited to 'deps/README.md')
-rw-r--r--deps/README.md23
1 files changed, 20 insertions, 3 deletions
diff --git a/deps/README.md b/deps/README.md
index 0ce480046..69b3585cf 100644
--- a/deps/README.md
+++ b/deps/README.md
@@ -13,13 +13,30 @@ How to upgrade the above dependencies
Jemalloc
---
-Jemalloc is unmodified. We only change settings via the `configure` script of Jemalloc using the `--with-lg-quantum` option, setting it to the value of 3 instead of 4. This provides us with more size classes that better suit the Redis data structures, in order to gain memory efficiency.
-
-So in order to upgrade jemalloc:
+Jemalloc is modified with changes that allow us to implement the Redis
+active defragmentation logic. However this feature of Redis is not mandatory
+and Redis is able to understand if the Jemalloc version it is compiled
+against supports such Redis-specific modifications. So in theory, if you
+are not interested in the active defragmentation, you can replace Jemalloc
+just following tose steps:
1. Remove the jemalloc directory.
2. Substitute it with the new jemalloc source tree.
+However note that we change Jemalloc settings via the `configure` script of Jemalloc using the `--with-lg-quantum` option, setting it to the value of 3 instead of 4. This provides us with more size classes that better suit the Redis data structures, in order to gain memory efficiency.
+
+Instead if you want to upgrade Jemalloc while also providing support for
+defragmentation, you have to replace it with a newer version, and make
+the following changes:
+
+1. In Jemalloc three, file `include/jemalloc/jemalloc_macros.h.in`, make sure
+ to add `#define JEMALLOC_FRAG_HINT`.
+2. Implement the function `je_get_defrag_hint()` inside `src/jemalloc.c`. You
+ can see how it is implemented in the current Jemalloc source tree shipped
+ with Redis, and rewrite it according to the new Jemalloc internals, if they
+ changed, otherwise you could just copy the old implementation if you are
+ upgrading just to a similar version of Jemalloc.
+
Geohash
---