From: Li Feng Date: Fri, 24 Apr 2020 10:42:05 +0000 (+0800) Subject: mem: mark pages as not accessed when freeing memory X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=76e91e3f14fc13f31608167d698682790be45cba mem: mark pages as not accessed when freeing memory Commit 8a4baf06c17a ("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: 8a4baf06c17a ("mem: mark pages as not accessed when reserving VA") Cc: stable@dpdk.org Signed-off-by: Li Feng Acked-by: Anatoly Burakov --- diff --git a/lib/librte_eal/linux/eal_memalloc.c b/lib/librte_eal/linux/eal_memalloc.c index af6d0d023a..678094acf9 100644 --- a/lib/librte_eal/linux/eal_memalloc.c +++ b/lib/librte_eal/linux/eal_memalloc.c @@ -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");