scheduler_affine: Use global core heap and per-core CPU heaps

There is a global heap of cores, where the key is the highest priority
of threads running on that core. Moreover, for each core there is
a heap of logical processors on this core where the key is the priority
of currently running thread.

The per-core heap is used for load balancing among logical processors
on that core. The global heap is used in initial decision where to put
the thread (note that the algorithm that makes this decision is not
complete yet).
This commit is contained in:
Pawel Dziepak
2013-10-17 02:11:28 +02:00
parent 3ec1d8da42
commit 278c9784a1
2 changed files with 204 additions and 82 deletions
+5 -9
View File
@@ -79,7 +79,7 @@ public:
inline Element* PeekRoot();
inline const Key& GetKey(Element* element) const;
static const Key& GetKey(Element* element);
inline void ModifyKey(Element* element, Key newKey);
@@ -96,9 +96,8 @@ private:
int fLastElement;
int fSize;
Compare sCompare;
GetLink sGetLink;
static Compare sCompare;
static GetLink sGetLink;
};
@@ -187,12 +186,9 @@ HEAP_CLASS_NAME::PeekRoot()
HEAP_TEMPLATE_LIST
const Key&
HEAP_CLASS_NAME::GetKey(Element* element) const
HEAP_CLASS_NAME::GetKey(Element* element)
{
HeapLink<Element, Key>* link = sGetLink(element);
ASSERT(link->fIndex >= 0 && link->fIndex < fLastElement);
return link->fKey;
return sGetLink(element)->fKey;
}