CPU affinity configuration fixes

- if no affinity was set for a new thread before calling
  Cpu_session::start(), the CPU session's affinity gets set for this
  thread
- documentation fix: <affinity_space> -> <affinity-space>

Fixes #873.
This commit is contained in:
Christian Prochaska 2013-08-28 18:51:30 +02:00 committed by Norman Feske
parent 2501cb189e
commit 3e8e55ec16
4 changed files with 22 additions and 3 deletions

View File

@ -114,8 +114,20 @@ namespace Genode {
}
const char *name() { return _name; }
/**
* Set the executing CPU for this thread
*
* SMP is currently not directly supported on Genode/Linux
* (but indirectly by the Linux kernel).
*/
void affinity(Affinity::Location) { }
/**
* Request the affinity of this thread
*/
Affinity::Location affinity() { return Affinity::Location(); }
/**
* Register process ID and thread ID of thread
*/

View File

@ -122,6 +122,13 @@ int Cpu_session_component::start(Thread_capability thread_cap,
*/
thread->update_exception_sigh();
/*
* If no affinity location was set for this specific thread before,
* we set the one which was defined for the whole CPU session.
*/
if (!thread->platform_thread()->affinity().valid())
thread->platform_thread()->affinity(_location);
return thread->platform_thread()->start((void *)ip, (void *)sp);
}

View File

@ -564,7 +564,7 @@ declaration describes an affinity space of 4x2:
! <config>
! ...
! <affinity_space width="4" height="2" />
! <affinity-space width="4" height="2" />
! ...
! </config>

View File

@ -263,7 +263,7 @@ example, the following declaration describes an affinity space of 4x2:
! <config>
! ...
! <affinity_space width="4" height="2" />
! <affinity-space width="4" height="2" />
! ...
! </config>