From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1DE07A00C2; Fri, 24 Apr 2020 13:25:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 514191BFEF; Fri, 24 Apr 2020 13:25:55 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 29EF71BF92; Fri, 24 Apr 2020 13:25:52 +0200 (CEST) IronPort-SDR: ENeLV/lN22CgdO2c4uZCsYg4VmZx6U6VY2flIcin6dj44WWiKWBiGeGOV0sQ9yg5OQV4qstM9M Nzkke/XHsVuQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2020 04:25:52 -0700 IronPort-SDR: rPly2XJm0Rx3hJ5eei9+/YfWVHyrxlBKc3DT/GksCTgH5nS6NnGDB8/HFB0Yzp0TSFdZfbG5wF 6Q2JTztb5Nxw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,311,1583222400"; d="scan'208";a="430736318" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.212.61.196]) ([10.212.61.196]) by orsmga005.jf.intel.com with ESMTP; 24 Apr 2020 04:25:50 -0700 To: Li Feng Cc: dev@dpdk.org, stable@dpdk.org, kyle@smartx.com, lifeng1519@gmail.com, fanyang@smartx.com, david.marchand@redhat.com References: <20200424104205.26846-1-fengli@smartx.com> From: "Burakov, Anatoly" Message-ID: <2812cdbf-7761-42fd-f764-76d90aad5f6d@intel.com> Date: Fri, 24 Apr 2020 12:25:49 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200424104205.26846-1-fengli@smartx.com> Content-Type: text/plain; charset=gbk; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] mem: mark pages as not accessed when returning back to memory pool X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 24-Apr-20 11:42 AM, Li Feng wrote: > 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. > > Signed-off-by: Li Feng > --- > lib/librte_eal/linux/eal_memalloc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/librte_eal/linux/eal_memalloc.c b/lib/librte_eal/linux/eal_memalloc.c > index 9d2a6fc6f..64a2b44c1 100644 > --- a/lib/librte_eal/linux/eal_memalloc.c > +++ b/lib/librte_eal/linux/eal_memalloc.c > @@ -683,7 +683,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"); > Fixes: 8a4baf06c17a ("mem: mark pages as not accessed when reserving VA") Cc: david.marchand@redhat.com Cc: stable@dpdk.org Acked-by: Anatoly Burakov -- Thanks, Anatoly