From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afsHH-0004o6-Hl for qemu-devel@nongnu.org; Tue, 15 Mar 2016 12:57:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afsHC-0001x3-Hp for qemu-devel@nongnu.org; Tue, 15 Mar 2016 12:57:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51868) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afsHC-0001wO-C9 for qemu-devel@nongnu.org; Tue, 15 Mar 2016 12:56:58 -0400 References: <1457378754-21649-1-git-send-email-armbru@redhat.com> <1457378754-21649-3-git-send-email-armbru@redhat.com> <56DEDEF9.6030506@redhat.com> <87io0nsnfv.fsf@blackfin.pond.sub.org> From: Paolo Bonzini Message-ID: <56E83ED4.9070103@redhat.com> Date: Tue, 15 Mar 2016 17:56:52 +0100 MIME-Version: 1.0 In-Reply-To: <87io0nsnfv.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 02/42] exec: Fix memory allocation when memory path isn't on hugetlbfs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: mlureau@redhat.com, cam@cs.ualberta.ca, claudio.fontana@huawei.com, qemu-devel@nongnu.org, david.marchand@6wind.com On 15/03/2016 17:41, Markus Armbruster wrote: > Paolo Bonzini writes: > >> On 07/03/2016 20:25, Markus Armbruster wrote: >>> gethugepagesize() works reliably only when its argument is on >>> hugetlbfs. When it's not, it returns the filesystem's "optimal >>> transfer block size", which may or may not be the actual page size >>> you'll get when you mmap(). >>> >>> If the value is too small or not a power of two, we fail >>> qemu_ram_mmap()'s assertions. These were added in commit 794e8f3 >>> (v2.5.0). The bug's impact before that is currently unknown. Seems >>> fairly unlikely at least when the normal page size is 4KiB. >>> >>> Else, if the value is too large, we align more strictly than >>> necessary. >>> >>> gethugepagesize() goes back to commit c902760 (v0.13). That commit >>> clearly intended gethugepagesize() to be used on hugetlbfs only. Not >>> only was it named accordingly, it also printed a warning when used on >>> anything else. However, the commit neglected to spell out the >>> restriction in user documentation of -mem-path. >>> >>> Commit bfc2a1a (v2.5.0) dropped the warning as bogus "because QEMU >>> functions perfectly well with the path on a regular tmpfs filesystem". >>> It sure does when you're sufficiently lucky. In my testing, I was >>> lucky, too. >>> >>> Fix by switching to qemu_fd_getpagesize(). Rename the variable >>> holding its result from hpagesize to page_size. >>> >>> Cc: Paolo Bonzini >>> Signed-off-by: Markus Armbruster > [...] >> >> Queued, thanks. > > Not in master, yet. What repo+branch should I use as base for v3? I'll send a pull request later today, keep an eye on it. Paolo