From owner-freebsd-virtualization@FreeBSD.ORG Tue Jun 23 08:06:08 2015 Return-Path: Delivered-To: freebsd-virtualization@nevdull.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D791F1D8 for ; Tue, 23 Jun 2015 08:06:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2674F616 for ; Tue, 23 Jun 2015 08:06:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA12607; Tue, 23 Jun 2015 11:06:05 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Z7JDZ-0006Fg-Ag; Tue, 23 Jun 2015 11:06:05 +0300 Message-ID: <55891335.5090403@FreeBSD.org> Date: Tue, 23 Jun 2015 11:05:09 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Neel Natu CC: "freebsd-virtualization@freebsd.org" Subject: Re: bhyve: centos 7.1 with multiple virtual processors References: <5587EE05.2020001@FreeBSD.org> <558900A7.40609@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2015 08:06:08 -0000 On 23/06/2015 10:26, Neel Natu wrote: > Hi Andriy, > > On Mon, Jun 22, 2015 at 11:45 PM, Andriy Gapon wrote: >> On 23/06/2015 05:37, Neel Natu wrote: >>> Hi Andriy, >>> >>> FWIW I can boot up a Centos 7.1 virtual machine with 2 and 4 vcpus >>> fine on my host with 8 physical cores. >>> >>> I have some questions about your setup inline. >>> >>> On Mon, Jun 22, 2015 at 4:14 AM, Andriy Gapon wrote: >>>> >>>> If I run a CentOS 7.1 VM with more than one CPU more often than not it would >>>> hang on startup and bhyve would start spinning. >>>> >>>> The following are the last messages seen in the VM: >>>> >>>> Switching to clocksource hpet >>>> ------------[ cut here ]------------ >>>> WARNING: at kernel/time/clockevents.c:239 clockevents_program_event+0xdb/0xf0() >>>> Modules linked in: >>>> CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.10.0-229.4.2.el7.x86_64 #1 >>>> Hardware name: BHYVE, BIOS 1.00 03/14/2014 >>>> 0000000000000000 00000000cab5bdb6 ffff88003fc03e08 ffffffff81604eaa >>>> ffff88003fc03e40 ffffffff8106e34b 80000000000f423f 80000000000f423f >>>> ffffffff81915440 0000000000000000 0000000000000000 ffff88003fc03e50 >>>> Call Trace: >>>> [] dump_stack+0x19/0x1b >>>> [] warn_slowpath_common+0x6b/0xb0 >>>> [] warn_slowpath_null+0x1a/0x20 >>>> [] clockevents_program_event+0xdb/0xf0 >>>> [] tick_handle_periodic_broadcast+0x41/0x50 >>>> [] timer_interrupt+0x15/0x20 >>>> [] handle_irq_event_percpu+0x3e/0x1e0 >>>> [] handle_irq_event+0x3d/0x60 >>>> [] handle_edge_irq+0x77/0x130 >>>> [] handle_irq+0xbf/0x150 >>>> [] ? irq_enter+0x17/0xa0 >>>> [] do_IRQ+0x4f/0xf0 >>>> [] common_interrupt+0x6d/0x6d >>>> [] ? selinux_inode_alloc_security+0x59/0xa0 >>>> [] ? __d_instantiate+0xbf/0x100 >>>> [] ? __d_instantiate+0x9f/0x100 >>>> [] d_instantiate+0x3d/0x70 >>>> [] debugfs_mknod.isra.5.part.6.constprop.15+0x98/0x130 >>>> [] __create_file+0x1c2/0x2c0 >>>> [] ? set_graph_function+0x1f/0x1f >>>> [] debugfs_create_dir+0x1b/0x20 >>>> [] tracing_init_dentry_tr+0x7e/0x90 >>>> [] tracing_init_dentry+0x10/0x20 >>>> [] ftrace_init_debugfs+0x13/0x1fd >>>> [] ? set_graph_function+0x1f/0x1f >>>> [] do_one_initcall+0xb8/0x230 >>>> [] kernel_init_freeable+0x18b/0x22a >>>> [] ? initcall_blacklist+0xb0/0xb0 >>>> [] ? rest_init+0x80/0x80 >>>> [] kernel_init+0xe/0xf0 >>>> [] ret_from_fork+0x7c/0xb0 >>>> [] ? rest_init+0x80/0x80 >>>> ---[ end trace d5caa1cab8e7e98d ]--- >>>> >>> >>> A few questions to narrow this down: >>> - Is the host very busy when the VM is started (or what is the host >>> doing when this happened)? >> >> The host typically is not heavily loaded. There is X server running and some >> applications. I'd imagine that those could cause some additional latency but >> not CPU starvation. >> > > Yup, I agree. > > Does this ever happen with a single vcpu guest? Never seen the problem with a single CPU so far. Also, never had that problem with FreeBSD guests. > The other mystery is the NMIs the host is receiving. I (re)verified to > make sure that bhyve/vmm.ko do not assert NMIs so it has to be > something else on the host that's doing it ... But the correlation with the multi-CPU non-FreeBSD guests seems to be significant. P.S. meanwhile I found this old-ish thread that seems to describe exactly the problem I am seeing but on real hardware: http://thread.gmane.org/gmane.linux.kernel/1483297 -- Andriy Gapon