From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id D05B29190 for ; Mon, 5 Oct 2015 15:08:59 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 05 Oct 2015 06:08:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,638,1437462000"; d="scan'208";a="574380985" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by FMSMGA003.fm.intel.com with ESMTP; 05 Oct 2015 06:08:55 -0700 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 5 Oct 2015 06:08:55 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx123.amr.corp.intel.com (10.18.125.38) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 5 Oct 2015 06:08:55 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.246]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.92]) with mapi id 14.03.0248.002; Mon, 5 Oct 2015 21:08:53 +0800 From: "Xie, Huawei" To: "Michael S. Tsirkin" , "shesha Sreenivasamurthy (shesha)" Thread-Topic: [dpdk-dev] Unlinking hugepage backing file after initialiation Thread-Index: AdD6X9Ju/MtsxfWdQh2Z6wcUnply7Q== Date: Mon, 5 Oct 2015 13:08:52 +0000 Message-ID: References: <20150929161628.GA3810@redhat.com> <20150930003531-mutt-send-email-mst@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.237.221.74] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" 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: Mon, 05 Oct 2015 13:09:00 -0000 On 9/30/2015 5:36 AM, Michael S. Tsirkin wrote:=0A= > On Tue, Sep 29, 2015 at 05:50:00PM +0000, shesha Sreenivasamurthy (shesha= ) wrote:=0A= >> Sure. Then, is there any real reason why the backing files should not be= =0A= >> unlinked ?=0A= > AFAIK qemu unlinks them already.=0A= Sorry, i didn't make it clear. Let us take the physical Ethernet=0A= controller in the host for example=0A= =0A= 1) DPDK app1 unlinked huge page after initialization.=0A= 2) DPDK app1 crashed or got killed unexpectedly.=0A= 3) The nic device is just DMAing to the buffer memory allocated from=0A= the huge page.=0A= 4) Another app2 started, allocated memory from the hugetlbfs, and the=0A= memory allocated happened to be the buffer memory.=0A= Ok, the nic device dmaed to memory of app2, which corrupted app2.=0A= Btw, the window opened is very very narrow, but we could avoid this=0A= corruption if we don't unlink huge page immediately. We could=0A= reinitialize the nic through binding operation and then remove the huge=0A= page.=0A= =0A= I mentioned virtio at the first time. For its case, the one who does DMA=0A= is vhost and i am talking about the guest huge page not the huge pages=0A= used to back guest memory.=0A= =0A= So we had better not unlink huge pages unless we have other solution to=0A= avoid the corruption.=0A= =0A=