VBox influences applications running on other CPUs

Christian Menard christian.menard at ...104...
Thu Nov 6 14:00:04 CET 2014


Hello again,

this issue is related to my previous message. My goal is not only to run 
VBox+Android but also some other secure applications in parallel. Therefore I 
introduced a small server that multiplexes the Input and Framebuffer session so 
that it is possible to switch between Android and Nitpicker based on a key 
stroke. I attached a runscript to illustrate the setup.

In my setup VBox+Android are executed on one CPU and everything else runs on 
another CPU. This SMP setup is necessary as otherwise Android stops booting 
up. Parallel load during startup of Android seems to have some influence and 
stops execution of the VM, but so far I could not identify the reason. 

To the problem: Not only the performance of Android is very bad, but the whole 
system feels slow and unresponsive. Applications like liquid_framebuffer are 
significantly slowed down when VBox is running. This happens also when the VM 
is actually in a halted state. I find it very strange that VBox running on one 
CPU has such a strong impact on the performance of Apps running on another 
CPU. It leaves me wondering if there is something wrong with synchronization 
or the scheduler itself. Do you have any ideas or hints?

All best
Christian
-------------- next part --------------
#
# \brief  Run the demo scenario with Android running in a liquid_fb.
#         Virtualbox and Nitpicker+Launchpad need to run on seperate CPUs,
#         otherwise Android does not boot up. For an unknown reasopn Virtualbox
#         only runs on CPU 0.
# \author Christian Menard
# \date   2014-07-08
#

#
# Build
#

# base components
set build_components { core init drivers/timer }

# basic driver components
append build_components {
	drivers/acpi
	drivers/pci
	drivers/framebuffer
	drivers/usb
	server/fb_switcher
}

# nitpicker components
append build_components {
	server/nitpicker 
	app/pointer 
	app/status_bar
	server/report_rom
}

# application components
append build_components {
	server/liquid_framebuffer  
	server/nitlog
	test/nitpicker 
	app/launchpad
	app/scout
}


# android components 
append build_components { 
	drivers/rtc
	virtualbox
	server/liquid_framebuffer  
}

build $build_components
create_boot_directory

#
# Generate config
#

# Basic configuration

set config {
<config>
	<affinity-space width="2" height="1" />
	<parent-provides>
		<service name="ROM"/>
		<service name="RAM"/>
		<service name="CAP"/>
		<service name="IRQ"/>
		<service name="IO_MEM"/>
		<service name="IO_PORT"/>
		<service name="PD"/>
		<service name="RM"/>
		<service name="CPU"/>
		<service name="LOG"/>
		<service name="SIGNAL"/>
	</parent-provides>
	<default-route>
		<any-service> <parent/> <any-child/> </any-service>
	</default-route>
	<start name="timer">
		<affinity xpos="1" ypos="0" width="1" height="1" />
		<resource name="RAM" quantum="1M"/>
		<provides> <service name="Timer"/> </provides>
	</start>
}

# Basic driver configuration

append config {
	<start name="acpi">
		<affinity xpos="1" ypos="0" width="1" height="1" />
		<resource name="RAM" quantum="32M"/>
		<binary name="acpi_drv"/>
		<provides>
			<service name="PCI"/>
			<service name="IRQ" />
		</provides>
		<route>
			<service name="PCI"> <any-child /> </service>
			<any-service> <parent/> <any-child /> </any-service>
		</route>
	</start>
	<start name="fb_drv">
		<affinity xpos="1" ypos="0" width="1" height="1" />
		<resource name="RAM" quantum="4M"/>
		<provides><service name="Framebuffer"/></provides>
 		<config width="1280"
				height="800"
				depth="16"
				buffered="no"
				offset="yes"/>
	</start>
	<start name="usb_drv">
		<affinity xpos="1" ypos="0" width="1" height="1" />
		<resource name="RAM" quantum="12M"/>
		<provides><service name="Input"/></provides>
		<config ehci="yes" uhci="yes" xhci="yes"> <hid/> </config>
	</start>
	<start name="fb_switcher">
		<affinity xpos="1" ypos="0" width="1" height="1" />
		<resource name="RAM" quantum="4M"/>
		<provides>
			<service name="Input"/>
			<service name="Framebuffer"/>
		</provides>
		<route>
			<service name="Framebuffer"><child name="fb_drv" /></service>
			<service name="Input"><child name="usb_drv" /></service>
			<any-service><parent/><any-child/></any-service>
		</route>
	</start>
}

# Nitpicker configuration

append config {
	<start name="report_rom">
		<affinity xpos="1" ypos="0" width="1" height="1" />
		<resource name="RAM" quantum="1M"/>
		<provides> <service name="Report"/> <service name="ROM"/> </provides>
		<config>
			<rom>
				<policy label="status_bar -> focus" report="nitpicker -> focus"/>
			</rom>
		</config>
	</start>
	<start name="nitpicker">
		<affinity xpos="1" ypos="0" width="1" height="1" />
		<resource name="RAM" quantum="1M"/>
		<provides><service name="Nitpicker"/></provides>
		<config>
			<report focus="yes" />
			<domain name="pointer" layer="1" xray="no" origin="pointer" />
			<domain name="panel"   layer="2" xray="no" />
			<domain name=""        layer="3" ypos="18" height="-18" />

			<policy label="pointer"    domain="pointer"/>
			<policy label="status_bar" domain="panel"/>
			<policy label=""           domain=""/>

			<global-key name="KEY_SCROLLLOCK" operation="xray" />
			<global-key name="KEY_SYSRQ"      operation="kill" />
			<global-key name="KEY_PRINT"      operation="kill" />
			<global-key name="KEY_F11"        operation="kill" />
			<global-key name="KEY_F12"        operation="xray" />
		</config>
		<route>
			<service name="Framebuffer"><child name="fb_switcher" /></service>
			<service name="Input"><child name="fb_switcher" /></service>
			<any-service><parent/><any-child/></any-service>
		</route>
	</start>
	<start name="pointer">
		<affinity xpos="1" ypos="0" width="1" height="1" />
		<resource name="RAM" quantum="1M"/>
	</start>
	<start name="status_bar">
		<affinity xpos="1" ypos="0" width="1" height="1" />
		<resource name="RAM" quantum="1M"/>
		<route>
			<service name="ROM"> <child name="report_rom"/> </service>
			<any-service> <parent/> <any-child/> </any-service>
		</route>
	</start>
}

# Application configuration

append config {
	<start name="launchpad">
		<affinity xpos="1" ypos="0" width="1" height="1" />
		<resource name="RAM" quantum="64M" />
		<configfile name="launchpad.config" />
	</start>
	<start name="nitlog">
		<affinity xpos="1" ypos="0" width="1" height="1" />
		<resource name="RAM" quantum="4M" />
		<provides>
			<service name="LOG"/>
		</provides>
	</start>
}

# Android configuration

append config {
	<start name="rtc_drv">
		<affinity xpos="0" ypos="0" width="1" height="1" />
		<resource name="RAM" quantum="1M"/>
		<provides>
			<service name="Rtc"/>
		</provides>
	</start>
	<start name="virtualbox">
		<affinity xpos="0" ypos="0" width="1" height="1" />
		<resource name="RAM" quantum="1G"/>
		<config>
			<image type="iso" file="android.iso" />
			<libc stdout="/dev/log" stderr="/dev/log">
				<vfs>
					<dir name="dev"> <log/> </dir>
					<rom name="android.iso" />
				</vfs>
			</libc>
		</config>
		<route>
			<service name="LOG"><child name="nitlog" /></service>
			<service name="Framebuffer"><child name="fb_switcher" /></service>
			<service name="Input"><child name="fb_switcher" /></service>
			<any-service> <parent/> <any-child /> </any-service>
		</route>
	</start>
}

append config {
</config>
}

install_config $config

#
# Create launchpad configuration
#
set launchpad_config_fd [open "bin/launchpad.config" w]
puts $launchpad_config_fd {<config>
	<launcher name="testnit"   ram_quota="768K" />
	<launcher name="scout"     ram_quota="41M" />
	<launcher name="launchpad" ram_quota="6M">
		<configfile name="launchpad.config" />
	</launcher>
	<launcher name="nitlog"    ram_quota="1M" />
	<launcher name="liquid_fb" ram_quota="7M" />
		<config resize_handle="on" />
	<launcher name="nitpicker" ram_quota="1M" />
</config>}
close $launchpad_config_fd

#
# Boot modules
#

# generic modules
set boot_modules { core init timer }

# basic driver modules
append boot_modules { 
	acpi_drv pci_drv pci_device_pd 
	fb_drv
	usb_drv
	fb_switcher
}

# nitpicker modules
append boot_modules {
	nitpicker 
	pointer
	status_bar
	report_rom
}

# application modules 
append boot_modules {
	liquid_fb  
	scout
	testnit 
	nitlog
	launchpad launchpad.config 
}

# android modules 
append boot_modules {
	virtualbox android.iso
	rtc_drv
	liquid_fb
	ld.lib.so libc.lib.so 
	libm.lib.so pthread.lib.so
	libc_lock_pipe.lib.so libc_terminal.lib.so
	libiconv.lib.so
}

build_boot_image $boot_modules

#
# Execute test case
#

set builddir [pwd]
set tooldir [file dirname $argv0]

exec $tooldir/create_grub2_entry_nova.perl $builddir toughpad-android-demo
exec $tooldir/run_on_toughpad.sh $builddir toughpad-android-demo


More information about the users mailing list