From owner-freebsd-emulation@FreeBSD.ORG Sat Nov 17 20:53:09 2012 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CCE2F9AE for ; Sat, 17 Nov 2012 20:53:09 +0000 (UTC) (envelope-from alexclear@gmail.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id 944558FC0C for ; Sat, 17 Nov 2012 20:53:09 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id kp6so2721983pab.13 for ; Sat, 17 Nov 2012 12:53:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=9afbGH+SVGHOAnTDprzJtAp0EtO4+6RNDmkyHMcfVeU=; b=xbAiDxkomWJ93BPS9pvuucRRNNhBPEzxMNywSNCmbR5Pha2vQvNvrZPxwcnLZWzzDT P8xYLMKrwb+ggM2wEIwVZ5vmdjyYW3EPAPAJ+EGC7dg4htqTORKuwEbEPkr/n+myrqOb 6ekt+OiKhmTa95VJQKFvLkuUO7g9fkkSqgE+IQLbtZZYBB8gUiGqbUk7fwdTX32QBLke UPSWzhzOMtJ1SSoPSOXDEctUHDN1globUeUmJ8qW43I6RZ8Pr5UsTeNb8b2tKStAYbke ZJdUuiGJmpvIDX/UPtSIJX7FCWItn7aDDJ/owwvUAF8+dGDcfdeSBIXBluGvMByxaWry 966A== MIME-Version: 1.0 Received: by 10.68.233.197 with SMTP id ty5mr27334873pbc.9.1353185589098; Sat, 17 Nov 2012 12:53:09 -0800 (PST) Received: by 10.66.227.166 with HTTP; Sat, 17 Nov 2012 12:53:08 -0800 (PST) In-Reply-To: References: <50A67D9F.8040505@wp.pl> <50A787A6.8050402@wp.pl> Date: Sat, 17 Nov 2012 23:53:08 +0300 Message-ID: Subject: Re: VirtualBox 4.1.22 on FreeBSD 9.0-RELEASE problem: VBoxHeadless eats 100% CPU From: Alex Chistyakov To: Adam Vande More Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-emulation@freebsd.org X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2012 20:53:10 -0000 On Sun, Nov 18, 2012 at 12:32 AM, Alex Chistyakov wrote: > On Sat, Nov 17, 2012 at 11:29 PM, Adam Vande More wrote: >> On Sat, Nov 17, 2012 at 1:19 PM, Alex Chistyakov >> wrote: >>> >>> Okay the situation has changed radically after upgrade to 4.2.4, >>> VBoxHeadless does not consume 100% CPU anymore but now I have another >>> problem: >>> >>> --- 192.168.221.11 ping statistics --- >>> 677 packets transmitted, 677 packets received, 0.0% packet loss >>> round-trip min/avg/max/stddev = 0.233/4997.489/52552.511/10627.598 ms >>> >>> This is results of ping between host and guest systems. >>> >>> A common pattern is like this: >>> >>> 64 bytes from 192.168.221.11: icmp_seq=63 ttl=64 time=21.168 ms >>> 64 bytes from 192.168.221.11: icmp_seq=64 ttl=64 time=1.914 ms >>> 64 bytes from 192.168.221.11: icmp_seq=65 ttl=64 time=49.005 ms >>> 64 bytes from 192.168.221.11: icmp_seq=66 ttl=64 time=7.190 ms >>> 64 bytes from 192.168.221.11: icmp_seq=67 ttl=64 time=56.000 ms >>> 64 bytes from 192.168.221.11: icmp_seq=68 ttl=64 time=0.276 ms >>> 64 bytes from 192.168.221.11: icmp_seq=69 ttl=64 time=0.817 ms >>> 64 bytes from 192.168.221.11: icmp_seq=70 ttl=64 time=12.177 ms >>> 64 bytes from 192.168.221.11: icmp_seq=71 ttl=64 time=11.181 ms >>> 64 bytes from 192.168.221.11: icmp_seq=72 ttl=64 time=19790.362 ms >>> 64 bytes from 192.168.221.11: icmp_seq=73 ttl=64 time=18789.374 ms >>> 64 bytes from 192.168.221.11: icmp_seq=74 ttl=64 time=17788.379 ms >>> >>> >>> I also have got a lot of "soft lockup - CPU#0 stuck for 22s!" Linux >>> kernel messages on the guest. >>> Since this is a periodic problem I guess the best way to track it down >>> is to get thread stack dump samples using gdb when the lock occures >>> but unfortunately I am not familiar with FreeBSD flavour of gdb, it >>> seems to be quite different. But I will try anyway. >> >> >> Does 'sysctl kern.eventtimer.periodic=1' help? > > No it does not. I also tried to boot the guest using highrez=off and > nohz=off and got steady 100% CPU consumption immediately. > Sampling result on host is: > > 46.04% [11023] cpu_search_highest @ /boot/kernel/kernel > 81.93% [9031] cpu_search_highest > 59.55% [5378] sched_idletd > 100.0% [5378] fork_exit > 40.45% [3653] cpu_search_highest > 100.0% [3653] sched_idletd > 17.92% [1975] sched_idletd > 100.0% [1975] fork_exit > 00.15% [17] fork_exit > > Looks like lots of extra rescheduling and I wonder if setting CPU > affinity can help with this. Yeah, that was it! Setting CPU affinity helped. So, the CPU usage is down to 0% now and ping is 0.255/0.296/0.875/0.086 ms as it should be! So, to summarize, I disabled tickless kernels on both host and guest (not sure if disabling on guest was really needed) and pinned the VBoxHeadless process to a certain CPU core using cpuset. Thanks, -- SY, Alex