mem: mark pages as not accessed when freeing memory

Commit 8a4baf06c1 ("mem: mark pages as not accessed when reserving VA")
has mapped the initialized memory with PROT_NONE, and when it's unmapped,
eal_memalloc.c should remmap the anonymous memory with PROT_NONE too.

Fixes: 8a4baf06c1 ("mem: mark pages as not accessed when reserving VA")
Cc: stable@dpdk.org

Signed-off-by: Li Feng <fengli@smartx.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
This commit is contained in:
Li Feng 2020-04-24 18:42:05 +08:00 committed by David Marchand
parent a9aa14d9aa
commit 76e91e3f14

View File

@ -680,7 +680,7 @@ free_seg(struct rte_memseg *ms, struct hugepage_info *hi,
/* erase page data */
memset(ms->addr, 0, ms->len);
if (mmap(ms->addr, ms->len, PROT_READ,
if (mmap(ms->addr, ms->len, PROT_NONE,
MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0) ==
MAP_FAILED) {
RTE_LOG(DEBUG, EAL, "couldn't unmap page\n");