Express affinities via Cartesian coordinates

This patch introduces new types for expressing CPU affinities. Instead
of dealing with physical CPU numbers, affinities are expressed as
rectangles in a grid of virtual CPU nodes. This clears the way to
conveniently assign sets of adjacent CPUs to subsystems, each of them
managing their respective viewport of the coordinate space.

By using 2D Cartesian coordinates, the locality of CPU nodes can be
modeled for different topologies such as SMP (simple Nx1 grid), grids of
NUMA nodes, or ring topologies.
This commit is contained in:
Norman Feske
2013-08-07 22:16:58 +02:00
parent fa7329a3e6
commit 5fe29e8e4a
49 changed files with 445 additions and 239 deletions

View File

@@ -134,12 +134,12 @@ namespace Genode {
/**
* Set the executing CPU for this thread
*/
void affinity(unsigned cpu);
void affinity(Affinity::Location) { }
/**
* Get the executing CPU for this thread
*/
unsigned affinity();
Affinity::Location affinity() { return Affinity::Location(); }
/**
* Get thread name

View File

@@ -27,19 +27,6 @@ using namespace Genode;
using namespace Codezero;
void Platform_thread::affinity(unsigned int cpu_no)
{
PDBG("'%s' not yet implemented", __PRETTY_FUNCTION__);
}
unsigned Platform_thread::affinity()
{
PDBG("'%s' not yet implemented", __PRETTY_FUNCTION__);
return 0;
}
int Platform_thread::start(void *ip, void *sp, unsigned int cpu_no)
{
Native_thread_id pager = _pager ? _pager->cap().dst() : THREAD_INVALID;