From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfVEQ-0003K5-9U for qemu-devel@nongnu.org; Thu, 01 Sep 2016 12:52:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bfVEN-0002Uy-4s for qemu-devel@nongnu.org; Thu, 01 Sep 2016 12:52:50 -0400 References: <1472674630-18886-1-git-send-email-ehabkost@redhat.com> <20160831214625.373180.83128@ex-std-node742.prod.rhcloud.com> <20160901151030.GC1151@thinpad.lan.raisama.net> From: Michal Privoznik Message-ID: Date: Thu, 1 Sep 2016 18:52:42 +0200 MIME-Version: 1.0 In-Reply-To: <20160901151030.GC1151@thinpad.lan.raisama.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] vl: Delay initialization of memory backends List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost , qemu-devel@nongnu.org Cc: famz@redhat.com, pbonzini@redhat.com, bsd@redhat.com, qemu-stable@nongnu.org, Yang Hongyang , Jason Wang On 01.09.2016 17:10, Eduardo Habkost wrote: > On Wed, Aug 31, 2016 at 02:47:21PM -0700, no-reply@ec2-52-6-146-230.compute-1.amazonaws.com wrote: > [...] >> GTESTER check-qtest-x86_64 >> qemu-system-x86_64: Failed initializing vhost-user memory map, consider using -object memory-backend-file share=on >> qemu-system-x86_64: vhost_set_mem_table failed: Success (0) > [...] >> ** >> ERROR:/tmp/qemu-test/src/tests/vhost-user-test.c:149:wait_for_fds: assertion failed: (s->fds_num) > > Ouch. It looks like the ordering requirements are messier than I > thought. vhost-user depends on the memory backends to be already > initialized. > > We can't use early initialization because prealloc delays chardev > init too much. We can't delay initialization because it is done > after netdevs. > > We _really_ need to change this to simply use the ordering used > on the command-line/config instead of hardcoding messy ordering > requirements, but I wouldn't like to wait for a QemuOpts > refactoring to fix the bug. I will take a look at the memory > regions initialization path, and try to trigger the > memory-backend prealloc code there. > What I don't understand here is, if kernel already has a pool of hugepages from which qemu tries to allocate some, why does allocation take up to 1 minute? I would understand if it was during building of the pool, but once those pages are reserved allocating them should take no time. Isn't this a problem in kernel (too)? Michal