scheduler: Add {CPU,Core,Package}Entry constructors
This commit is contained in:
parent
e1c40769d3
commit
8818c942dd
@ -84,6 +84,8 @@ static bool (*sShouldRebalance)(Thread* thread);
|
|||||||
// the core the only real concern is to make lower priority threads give way to
|
// the core the only real concern is to make lower priority threads give way to
|
||||||
// the higher priority threads.
|
// the higher priority threads.
|
||||||
struct CPUEntry : public MinMaxHeapLinkImpl<CPUEntry, int32> {
|
struct CPUEntry : public MinMaxHeapLinkImpl<CPUEntry, int32> {
|
||||||
|
CPUEntry();
|
||||||
|
|
||||||
int32 fCPUNumber;
|
int32 fCPUNumber;
|
||||||
|
|
||||||
bigtime_t fMeasureActiveTime;
|
bigtime_t fMeasureActiveTime;
|
||||||
@ -97,6 +99,8 @@ static CPUEntry* sCPUEntries;
|
|||||||
static CPUHeap* sCPUPriorityHeaps;
|
static CPUHeap* sCPUPriorityHeaps;
|
||||||
|
|
||||||
struct CoreEntry : public DoublyLinkedListLinkImpl<CoreEntry> {
|
struct CoreEntry : public DoublyLinkedListLinkImpl<CoreEntry> {
|
||||||
|
CoreEntry();
|
||||||
|
|
||||||
HeapLink<CoreEntry, int32> fPriorityHeapLink;
|
HeapLink<CoreEntry, int32> fPriorityHeapLink;
|
||||||
MinMaxHeapLink<CoreEntry, int> fLoadHeapLink;
|
MinMaxHeapLink<CoreEntry, int> fLoadHeapLink;
|
||||||
|
|
||||||
@ -134,6 +138,8 @@ static CoreLoadHeap* sCoreHighLoadHeap;
|
|||||||
// idle are stored in sPackageIdleList (in LIFO manner).
|
// idle are stored in sPackageIdleList (in LIFO manner).
|
||||||
struct PackageEntry : public MinMaxHeapLinkImpl<PackageEntry, int32>,
|
struct PackageEntry : public MinMaxHeapLinkImpl<PackageEntry, int32>,
|
||||||
DoublyLinkedListLinkImpl<PackageEntry> {
|
DoublyLinkedListLinkImpl<PackageEntry> {
|
||||||
|
PackageEntry();
|
||||||
|
|
||||||
int32 fPackageID;
|
int32 fPackageID;
|
||||||
|
|
||||||
DoublyLinkedList<CoreEntry> fIdleCores;
|
DoublyLinkedList<CoreEntry> fIdleCores;
|
||||||
@ -189,6 +195,31 @@ struct scheduler_thread_data {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
CPUEntry::CPUEntry()
|
||||||
|
:
|
||||||
|
fMeasureActiveTime(0),
|
||||||
|
fMeasureTime(0),
|
||||||
|
fLoad(0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CoreEntry::CoreEntry()
|
||||||
|
:
|
||||||
|
fActiveTime(0),
|
||||||
|
fLoad(0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PackageEntry::PackageEntry()
|
||||||
|
:
|
||||||
|
fIdleCoreCount(0),
|
||||||
|
fCoreCount(0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
scheduler_thread_data::Init()
|
scheduler_thread_data::Init()
|
||||||
{
|
{
|
||||||
@ -1746,8 +1777,6 @@ _scheduler_init()
|
|||||||
|
|
||||||
for (int32 i = 0; i < coreCount; i++) {
|
for (int32 i = 0; i < coreCount; i++) {
|
||||||
sCoreEntries[i].fCoreID = i;
|
sCoreEntries[i].fCoreID = i;
|
||||||
sCoreEntries[i].fActiveTime = 0;
|
|
||||||
sCoreEntries[i].fLoad = 0;
|
|
||||||
|
|
||||||
status_t result = sCoreLoadHeap->Insert(&sCoreEntries[i], 0);
|
status_t result = sCoreLoadHeap->Insert(&sCoreEntries[i], 0);
|
||||||
if (result != B_OK)
|
if (result != B_OK)
|
||||||
@ -1767,10 +1796,6 @@ _scheduler_init()
|
|||||||
for (int32 i = 0; i < cpuCount; i++) {
|
for (int32 i = 0; i < cpuCount; i++) {
|
||||||
sCPUEntries[i].fCPUNumber = i;
|
sCPUEntries[i].fCPUNumber = i;
|
||||||
|
|
||||||
sCPUEntries[i].fMeasureActiveTime = 0;
|
|
||||||
sCPUEntries[i].fMeasureTime = 0;
|
|
||||||
sCPUEntries[i].fLoad = 0;
|
|
||||||
|
|
||||||
int32 core = sCPUToCore[i];
|
int32 core = sCPUToCore[i];
|
||||||
|
|
||||||
int32 package = sCPUToPackage[i];
|
int32 package = sCPUToPackage[i];
|
||||||
|
Loading…
Reference in New Issue
Block a user