mirror of
https://github.com/redis/redis.git
synced 2026-05-28 04:02:46 -04:00
Bypass the THP check for strings
This commit is contained in:
parent
02d8ec2a3f
commit
d8de0fe341
1 changed files with 4 additions and 2 deletions
|
|
@ -856,8 +856,10 @@ void dismissGCRAObject(robj *o, size_t size_hint) {
|
|||
* it can reduce unnecessary iteration for complex data types that are probably
|
||||
* not going to release any memory. */
|
||||
void dismissObject(robj *o, size_t size_hint) {
|
||||
/* madvise(MADV_DONTNEED) may not work if Transparent Huge Pages is enabled. */
|
||||
if (server.thp_enabled) return;
|
||||
/* madvise(MADV_DONTNEED) may not work if Transparent Huge Pages is enabled.
|
||||
* Strings use sdsfree() which doesn't depend on madvise, so skip this
|
||||
* check for them. */
|
||||
if (server.thp_enabled && o->type != OBJ_STRING) return;
|
||||
|
||||
/* Currently we use zmadvise_dontneed only when we use jemalloc with Linux.
|
||||
* so we avoid these pointless loops when they're not going to do anything. */
|
||||
|
|
|
|||
Loading…
Reference in a new issue