Hello Christian,
On 09.11.2014 14:51, Alexander Boettcher wrote:
> The core services and init are running on the boot CPU. By moving all
> critical servers to another CPU (as done in your run script) you get a
> lot of cross CPU switching overhead, whenever the services call init or
> core.
>
> The better approach is to start VBox on another CPU instead, actually I
> doesn't know whether this is already works ...
please try following attached patch. With it VBox can be started also on
another CPU then the boot CPU.
Does it work for you ?
Alex.
diff --git a/repos/ports/run/virtualbox.run b/repos/ports/run/virtualbox.run
index 3c66a40..917c9da 100644
--- a/repos/ports/run/virtualbox.run
+++ b/repos/ports/run/virtualbox.run
@@ -19,6 +19,7 @@ create_boot_directory
set config {
<config prio_levels="4">
+ <affinity-space width="2" height="1" />
<parent-provides>
<service name="ROM"/>
<service name="RAM"/>
@@ -98,6 +99,7 @@ append_if [expr $use_net] config {
append config {
<start name="virtualbox" priority="-2">
+ <affinity xpos="1" ypos="0" width="1" height="1" />
<resource name="RAM" quantum="1G"/>
<config>
<image type="iso" file="test.iso" />
@@ -141,6 +143,6 @@ append_if [expr $use_net] boot_modules { nic_drv }
build_boot_image $boot_modules
append qemu_args " -m 512 "
-append qemu_args " -cpu phenom "
+append qemu_args " -cpu phenom -smp 2"
run_genode_until forever
diff --git a/repos/ports/src/virtualbox/thread.cc b/repos/ports/src/virtualbox/thread.cc
index d1719ca..d2f52a2 100644
--- a/repos/ports/src/virtualbox/thread.cc
+++ b/repos/ports/src/virtualbox/thread.cc
@@ -49,7 +49,10 @@ static Genode::Cpu_session * get_cpu_session(RTTHREADTYPE type) {
snprintf(data, 32, "vbox %u", type);
- con[type - 1] = new (env()->heap()) Cpu_connection(data, prio);
+ Affinity affinity(env()->cpu_session()->affinity_space(),
+ Affinity::Location());
+
+ con[type - 1] = new (env()->heap()) Cpu_connection(data, prio, affinity);
return con[type - 1];
}
@@ -79,10 +82,10 @@ extern "C" {
Assert(rtthread->enmType == RTTHREADTYPE_EMULATION);
if (rtthread->enmType == RTTHREADTYPE_EMULATION) {
- Genode::Cpu_session * cpu_session = get_cpu_session(RTTHREADTYPE_EMULATION);
- Genode::Affinity::Space cpu_space = cpu_session->affinity_space();
-/* Genode::Affinity::Location location = cpu_space.location_of_index(i); */
- Genode::Affinity::Location location;
+ Genode::Cpu_session * cpu_session = get_cpu_session(RTTHREADTYPE_EMULATION);
+ Genode::Affinity::Space cpu_space = cpu_session->affinity_space();
+ Genode::Affinity::Location location = cpu_space.location_of_index(0);
+
if (create_emt_vcpu(thread, stack_size, attr, start_routine, arg,
cpu_session, location))
return 0;
------------------------------------------------------------------------------
_______________________________________________
genode-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/genode-main