From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 82135B62 for ; Tue, 29 Sep 2015 17:17:25 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 29 Sep 2015 08:15:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,608,1437462000"; d="scan'208";a="654395455" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga003.jf.intel.com with ESMTP; 29 Sep 2015 08:15:51 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 29 Sep 2015 08:15:51 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 29 Sep 2015 08:15:51 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.75]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.210]) with mapi id 14.03.0248.002; Tue, 29 Sep 2015 23:15:43 +0800 From: "Xie, Huawei" To: "shesha Sreenivasamurthy (shesha)" Thread-Topic: [dpdk-dev] Unlinking hugepage backing file after initialiation Thread-Index: AdD6X9Ju/MtsxfWdQh2Z6wcUnply7Q== Date: Tue, 29 Sep 2015 15:15:42 +0000 Message-ID: References: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" , "ms >> Michael S. Tsirkin" Subject: Re: [dpdk-dev] Unlinking hugepage backing file after initialiation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2015 15:17:26 -0000 On 9/29/2015 10:38 AM, Xie, Huawei wrote:=0A= > On 9/29/2015 8:04 AM, shesha Sreenivasamurthy (shesha) wrote:=0A= >> Hello,=0A= >> As of DPDK2.1, backing files are created in hugetablefs during mapping (= in eal_memory.c::rte_eal_hugepage_init()) and these files are not cleaned u= p (unlinked) after initialization (mmap-ing). This means, when the applicat= ion crashes or stopped, the memory is still consumed. Therefore, is there a= ny reason not to unlink backing files after initialization ? If no, I will = send a patch for the change.=0A= > shesha:=0A= > You remind me the virtio unexpected crashing issue. DPDK runs in user=0A= > space. It is quite possible it dies unexpectedly, either crash or being= =0A= > killed.=0A= > When the dpdk virtio app crashes, it doesn't have a chance to notify=0A= > host, so host is still using its memory, backed by guest huge page.=0A= > If huge page files are still reserved in hugetlbfs, we have a chance to= =0A= > recover virtio first, then unlink the huge pages.=0A= > Otherwise if the huge pages are allocated by other process, its memory=0A= > could be corrupted by host.=0A= >=0A= > Certainly it is not implemented like that for this purpose, but i think= =0A= > it is a temporary solution for this user space virtio driver issue.=0A= =0A= I realized it is not a virtio specific issue, but apply to all user=0A= space driver.=0A= And the chance is very very small.=0A= =0A= Also commented by Bruce/Konstantin, it is implemented this way for=0A= multiple processes.=0A= =0A= >=0A= > /huawei=0A= > =0A= >=0A= >=0A= >=0A= >=0A= >=0A= >> --=0A= >> - Thanks=0A= >> char * (*shesha) (uint64_t cache, uint8_t F00D)=0A= >> { return 0x0000C0DE; }=0A= >>=0A= >=0A= =0A=