From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Sacha Subject: Re: IOTLB page size question Date: Fri, 17 Oct 2014 14:01:14 -0700 Message-ID: <5441839A.4030904@alcatel-lucent.com> References: <543C3B1B.8050802@alcatel-lucent.com> <1413236514.4202.50.camel@ul30vt.home> <543C5D34.4020406@alcatel-lucent.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit To: Return-path: Received: from us-hpatc-esg-02.alcatel-lucent.com ([135.245.18.28]:43692 "EHLO smtp-us.alcatel-lucent.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750936AbaJQVBU (ORCPT ); Fri, 17 Oct 2014 17:01:20 -0400 Received: from us70uusmtp4.zam.alcatel-lucent.com (unknown [135.5.2.66]) by Websense Email Security Gateway with ESMTPS id 071246AA4AB46 for ; Fri, 17 Oct 2014 21:01:16 +0000 (GMT) Received: from US70UWXCHHUB02.zam.alcatel-lucent.com (us70uwxchhub02.zam.alcatel-lucent.com [135.5.2.49]) by us70uusmtp4.zam.alcatel-lucent.com (GMO) with ESMTP id s9HL1G5m031581 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Fri, 17 Oct 2014 17:01:18 -0400 In-Reply-To: <543C5D34.4020406@alcatel-lucent.com> Sender: kvm-owner@vger.kernel.org List-ID: On 10/13/2014 04:16 PM, Jan Sacha wrote: >> Legacy KVM device assignment maps IOMMU pages using the host kernel page >> size for the region while VFIO will pass the largest contiguous range of >> pages available to the IOMMU, regardless of kernel page size. If VFIO >> doesn't have the same problem then perhaps the kernel idea of the page >> size for that reason has changed between mappings. Thanks, > When I have a VM running, I can see on the host OS: > > # cat /proc/1360/numa_maps > 2aaaaac00000 prefer:0 > file=/dev/hugepages/libvirt/qemu/qemu_back_mem.DO2GNu\040(deleted) > huge dirty=3070 N0=3070 > ... > > # cat /proc/1360/maps > 2aaaaac00000-2aac2a800000 rw-s 00000000 00:1e 19928 > /dev/hugepages/libvirt/qemu/qemu_back_mem.DO2GNu (deleted) > ... > > So it looks to me that there should be roughly 6GB mapped using huge > (2M) pages. PID 1360 is the qemu process. The VM is configured to use > 6GB. However, the IOTLB seems to be using 2k pages for all memory > below 4GB in the guest physical space. It does use 2M pages for memory > above 4GB. Does this make sense? We found a solution so I can answer my own question. This behavior was caused by a bug in the kernel. It was fixed in 3.13. https://github.com/torvalds/linux/commit/e0230e1327fb862c9b6cde24ae62d55f9db62c9b Jan