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 C1C88A00C2; Fri, 24 Apr 2020 12:43:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E41051C1DD; Fri, 24 Apr 2020 12:43:27 +0200 (CEST) Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by dpdk.org (Postfix) with ESMTP id 514011C1CD for ; Fri, 24 Apr 2020 12:43:26 +0200 (CEST) Received: by mail-pf1-f193.google.com with SMTP id x2so905239pfx.7 for ; Fri, 24 Apr 2020 03:43:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:to:cc:subject:date:message-id :content-transfer-encoding; bh=+jaCLZA3jx9w+15fi8Qw38nwPVDJgF5BpUfc32e5dBg=; b=mjs5vo5axDdR7J1mE/ebrNJYx+an1MPYwBm38cMORLZLpZFITyO9ZOBKMWittTdNgs czopbc9921hv6PHeYKYi96wgxCURhA4n6/yKNN56DEGORvMaUPqKcx/suI0CKM6rV3c1 E0g/PbWNV59GW2ZWlrp8w/Rn1QuICCukXyvYOZjmQouZGaqTEn1yFaxXzsolPK65tw6N o1fY7CYn97cVuBOpCN5D4lz47Dw/0i8DxvQnwGJsWOBQWaM+b3Lp4rdI1EaaF2h/3vp6 gVso7w0Hcnb4f8kVf//qcYTxNxVE8Pv+CezRNRr2JIxQ6uWE0wVhssBm/8ALUtq7YPt2 mKfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :content-transfer-encoding; bh=+jaCLZA3jx9w+15fi8Qw38nwPVDJgF5BpUfc32e5dBg=; b=Xt/4l9tM7nFbT2qOvnTLQHaw9S21uP6xfpp+EWW5qJny4bgo5myBq7/QZol3qEKwCM HNSG1118oaDLnPHlbd1l9GOGtgcabJYWiULOHmCx/o326N1S5hHluP0mJWXk+huofcTv tXFXpM6xzGY6dOQcoeR+DnZxOy/ssQRFoyDp1A4t69Flc4FpSq4qmPA+PCBTPd8y9W7N TzS95fMNzmpDDSDz4jJGOSNuO8brqC0wwKp5lB/xzxB4Ze6JxKlpmZuHVi4G1eTqv3T1 gOjIeWgAHin7jsAoXurngyT6K11lU4K26oJCl01txAg9VeosIMcdKXXniy3SQgjxpHbG ldSw== MIME-Version: 1.0 X-Gm-Message-State: AGi0PubvvWv7gPrTF2esr4Pl2fuzFyrrZu0e1uoeZNUwMrg48i6FkbmJ eTY6//Oen37CXqICqEbzuo2Gdy90FXhpJYWIsWZQfaVgyqmOEz99U3VMdyst5Y4bCey0dG/7 X-Google-Smtp-Source: APiQypJSEOUCyAotvMiaMiZWqvUuptE2DLvTzujcjo0wlRRwh06EjLVzdAnyvJeogcDTRBGXgmG4dw== X-Received: by 2002:aa7:8593:: with SMTP id w19mr8887020pfn.97.1587725005465; Fri, 24 Apr 2020 03:43:25 -0700 (PDT) Received: from 31_216.localdomain ([47.240.108.254]) by smtp.gmail.com with ESMTPSA id a23sm5186765pfo.145.2020.04.24.03.43.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Apr 2020 03:43:24 -0700 (PDT) From: Li Feng To: Anatoly Burakov Cc: dev@dpdk.org, stable@dpdk.org, kyle@smartx.com, lifeng1519@gmail.com, fanyang@smartx.com, david.marchand@redhat.com, Li Feng Date: Fri, 24 Apr 2020 18:42:05 +0800 Message-Id: <20200424104205.26846-1-fengli@smartx.com> X-Mailer: git-send-email 2.11.0 Content-Type: text/plain; charset="GB2312" Content-Transfer-Encoding: quoted-printable Subject: [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" 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 *h= i, /* erase page data */ memset(ms->addr, 0, ms->len); =20 - if (mmap(ms->addr, ms->len, PROT_READ, + if (mmap(ms->addr, ms->len, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0) =3D=3D MAP_FAILED) { RTE_LOG(DEBUG, EAL, "couldn't unmap page\n"); --=20 2.11.0 --=20 The SmartX email address is only for business purpose. Any sent message=20 that is not related to the business is not authorized or permitted by=20 SmartX. =B1=BE=D3=CA=CF=E4=CE=AA=B1=B1=BE=A9=D6=BE=C1=E8=BA=A3=C4=C9=BF=C6=BC=BC=D3= =D0=CF=DE=B9=AB=CB=BE=A3=A8SmartX=A3=A9=B9=A4=D7=F7=D3=CA=CF=E4. =C8=E7=B1= =BE=D3=CA=CF=E4=B7=A2=B3=F6=B5=C4=D3=CA=BC=FE=D3=EB=B9=A4=D7=F7=CE=DE=B9=D8= ,=B8=C3=D3=CA=BC=FE=CE=B4=B5=C3=B5=BD=B1=BE=B9=AB=CB=BE=C8=CE=BA=CE=B5=C4= =C3=F7=CA=BE=BB=F2=C4=AC=CA=BE=B5=C4=CA=DA=C8=A8.