xref: /haiku/src/system/kernel/scheduler/scheduler_common.h (revision cbe0a0c436162d78cc3f92a305b64918c839d079)
1 /*
2  * Copyright 2013, Paweł Dziepak, pdziepak@quarnos.org.
3  * Copyright 2011, Ingo Weinhold, ingo_weinhold@gmx.de.
4  * Distributed under the terms of the MIT License.
5  */
6 #ifndef KERNEL_SCHEDULER_COMMON_H
7 #define KERNEL_SCHEDULER_COMMON_H
8 
9 
10 #include <algorithm>
11 
12 #include <debug.h>
13 #include <kscheduler.h>
14 #include <load_tracking.h>
15 #include <smp.h>
16 #include <thread.h>
17 #include <user_debugger.h>
18 #include <util/MinMaxHeap.h>
19 
20 #include "RunQueue.h"
21 
22 
23 //#define TRACE_SCHEDULER
24 #ifdef TRACE_SCHEDULER
25 #	define TRACE(...) dprintf_no_syslog(__VA_ARGS__)
26 #else
27 #	define TRACE(...) do { } while (false)
28 #endif
29 
30 
31 namespace Scheduler {
32 
33 
34 class CPUEntry;
35 class CoreEntry;
36 
37 const int kLowLoad = kMaxLoad * 20 / 100;
38 const int kTargetLoad = kMaxLoad * 55 / 100;
39 const int kHighLoad = kMaxLoad * 70 / 100;
40 const int kMediumLoad = (kHighLoad + kTargetLoad) / 2;
41 const int kVeryHighLoad = (kMaxLoad + kHighLoad) / 2;
42 
43 const int kLoadDifference = kMaxLoad * 20 / 100;
44 
45 extern bool gSingleCore;
46 extern bool gTrackCoreLoad;
47 extern bool gTrackCPULoad;
48 
49 
50 void init_debug_commands();
51 
52 
53 }	// namespace Scheduler
54 
55 
56 #endif	// KERNEL_SCHEDULER_COMMON_H
57 
58