On 9/30/2015 5:36 AM, Michael S. Tsirkin wrote: > On Tue, Sep 29, 2015 at 05:50:00PM +0000, shesha Sreenivasamurthy (shesha) > wrote: >> Sure. Then, is there any real reason why the backing files should not be >> unlinked ? > AFAIK qemu unlinks them already. Sorry, i didn't make it clear. Let us take the physical Ethernet controller in the host for example
1) DPDK app1 unlinked huge page after initialization. 2) DPDK app1 crashed or got killed unexpectedly. 3) The nic device is just DMAing to the buffer memory allocated from the huge page. 4) Another app2 started, allocated memory from the hugetlbfs, and the memory allocated happened to be the buffer memory. Ok, the nic device dmaed to memory of app2, which corrupted app2. Btw, the window opened is very very narrow, but we could avoid this corruption if we don't unlink huge page immediately. We could reinitialize the nic through binding operation and then remove the huge page. I mentioned virtio at the first time. For its case, the one who does DMA is vhost and i am talking about the guest huge page not the huge pages used to back guest memory. So we had better not unlink huge pages unless we have other solution to avoid the corruption.