Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion storage/innobase/buf/buf0buf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ Created 11/5/1995 Heikki Tuuri
#include "lzo/lzo1x.h"
#endif

#ifdef HAVE_MADVISE
#include <sys/mman.h>
#endif

#ifdef HAVE_LIBNUMA
#include <numa.h>
#include <numaif.h>
Expand Down Expand Up @@ -1595,6 +1599,13 @@ buf_chunk_init(

return(NULL);
}
#if defined(HAVE_MADVISE) && defined(MADV_DONTDUMP)
if (madvise(chunk->mem, chunk->mem_pfx.m_size, MADV_DONTDUMP))
{
ib::warn() << "Failed to set memory to DONTDUMP: "
<< strerror(errno);
}
#endif

#ifdef HAVE_LIBNUMA
if (srv_numa_interleave) {
Expand All @@ -1612,7 +1623,6 @@ buf_chunk_init(
}
#endif /* HAVE_LIBNUMA */


/* Allocate the block descriptors from
the start of the memory block. */
chunk->blocks = (buf_block_t*) chunk->mem;
Expand Down Expand Up @@ -1880,6 +1890,13 @@ buf_pool_init_instance(
&block->debug_latch));
}

#if defined(HAVE_MADVISE) && defined(MADV_DODUMP)
if (madvise(chunk->mem, chunk->mem_pfx.m_size, MADV_DODUMP))
{
ib::warn() << "Failed to set memory to DODUMP: "
<< strerror(errno);
}
#endif
buf_pool->allocator.deallocate_large(
chunk->mem, &chunk->mem_pfx);
}
Expand Down Expand Up @@ -2027,6 +2044,13 @@ buf_pool_free_instance(
ut_d(rw_lock_free(&block->debug_latch));
}

#if defined(HAVE_MADVISE) && defined(MADV_DODUMP)
if (madvise(chunk->mem, chunk->mem_pfx.m_size, MADV_DODUMP))
{
ib::warn() << "Failed to set memory to DODUMP: "
<< strerror(errno);
}
#endif
buf_pool->allocator.deallocate_large(
chunk->mem, &chunk->mem_pfx);
}
Expand Down Expand Up @@ -2905,6 +2929,13 @@ buf_pool_resize()
&block->debug_latch));
}

#if defined(HAVE_MADVISE) && defined(MADV_DODUMP)
if (madvise(chunk->mem, chunk->mem_pfx.m_size, MADV_DODUMP))
{
ib::warn() << "Failed to set memory to DODUMP: "
<< strerror(errno);
}
#endif
buf_pool->allocator.deallocate_large(
chunk->mem, &chunk->mem_pfx);

Expand Down