Commit Graph

48221 Commits

Author SHA1 Message Date
Pawel Dziepak
8235bbc996 scheduler: Improve thread creation performance 2014-01-06 01:22:53 +01:00
Pawel Dziepak
cb66faef24 scheduler: Work around GCC2 limitations in function inlining
GCC2 won't inline a function if it is used before its definition.
2014-01-06 01:22:53 +01:00
Pawel Dziepak
9e99bf6085 scheduler: SCHEDULER_EXIT_FUNCTION() is not needed 2014-01-03 20:15:13 +01:00
Pawel Dziepak
81e04d7b97 kernel: Remove cpu_info::load
This field forces kernel to track each CPU load all the time. It is not
a problem with the current scheduler on a multicore systems, but on
single core machnies or with any other future scheduler this field may
become just an unnecessary burden. It isn't difficult for an application
to compute CPU load by itself when it needs it.
2014-01-03 19:44:57 +01:00
Pawel Dziepak
e4ea637227 scheduler: Disable load tracking when not needed 2014-01-03 19:44:56 +01:00
Pawel Dziepak
db1ddabfd0 scheduler: Thread can not stay on CPU if it has been disabled 2013-12-31 04:49:45 +01:00
Pawel Dziepak
135bb9c959 kernel: Do not attempt to interrupt a thread that is not waiting 2013-12-31 03:53:56 +01:00
Pawel Dziepak
2d52abbd5d scheduler: Inherit penalty and core from creator thread 2013-12-31 03:53:55 +01:00
Pawel Dziepak
7c92dffeef scheduler: Fix order of the includes
Thanks Jérôme!
2013-12-31 03:53:55 +01:00
Pawel Dziepak
265927509d scheduler: Protect per CPU run queue with its own lock 2013-12-31 03:53:55 +01:00
Pawel Dziepak
1524fbf742 scheduler: Fix divide error in _RequestPerformanceLevel 2013-12-30 06:10:14 +01:00
Pawel Dziepak
046af755d0 x86: Fix stack corruption in cache topology detection 2013-12-30 06:10:14 +01:00
Pawel Dziepak
8aa1539bb0 scheduler: Strengthen CoreEntry::GetLoad() assertion 2013-12-30 06:10:14 +01:00
Pawel Dziepak
15a7f2046a kernel: Return CPU load in cpu_info 2013-12-29 22:47:06 +01:00
Pawel Dziepak
ba4cf03951 apps: Pulse: Initialize per CPU fields properly 2013-12-29 22:47:06 +01:00
Pawel Dziepak
c69bd82c31 apps: ProcessController: Initialize per CPU fields properly 2013-12-29 22:47:05 +01:00
Pawel Dziepak
e46f284adc kernel/util: MinMaxHeap: Fix unused variable warnings 2013-12-29 22:47:05 +01:00
Pawel Dziepak
56c0f467b0 scheduler: Fix unused variable warnings 2013-12-29 22:47:05 +01:00
Pawel Dziepak
a47974dd06 scheduler: Use heap to determine highest priority thread 2013-12-29 19:24:01 +01:00
Pawel Dziepak
484e5c737f scheduler: profiler: Compare types larger than int properly 2013-12-29 19:19:21 +01:00
Pawel Dziepak
ef8e55a1d0 scheduler: Use single ended heap for CPU heap 2013-12-28 21:47:35 +01:00
Pawel Dziepak
712f37e19e scheduler: profiler: Use nanosecond as a main time unit 2013-12-28 21:03:43 +01:00
Pawel Dziepak
ca9137de37 scheduler: Profile RunQueue implementation 2013-12-28 20:46:22 +01:00
Pawel Dziepak
4c25fcab38 scheduler: Fix double release of run queue lock 2013-12-28 20:11:30 +01:00
Pawel Dziepak
f68a486001 scheduler: Ignore time used by the profiler implementation 2013-12-28 18:55:39 +01:00
Pawel Dziepak
65d28952ae scheduler: Make sure RunQueueLink::{fPrevious, fNext} are valid 2013-12-26 22:07:26 +01:00
Pawel Dziepak
335c60552c scheduler: Remove CPUEntry::IncreaseActiveTime() 2013-12-26 19:56:50 +01:00
Pawel Dziepak
9a6868d565 x86: Fix build with kernel debugging disabled 2013-12-26 19:55:33 +01:00
Pawel Dziepak
96dcc73b39 scheduler: Add scheduler profiler
A bit hackish implementation of a profiler for the scheduler.
SCHEDULER_ENTER_FUNCTION at the begining of each function aren't nice and
usage of __PRETTY_FUNCTION__ isn't any better (both gcc and clang support
it though), but it was quick to implement and doesn't lose information
on inlined functions. It's just a tool, not an integral part of the kernal
anyway.
2013-12-26 19:40:50 +01:00
Pawel Dziepak
ebe5420f84 scheduler: No need for gQuantumLengths to be global 2013-12-26 19:40:50 +01:00
Pawel Dziepak
cf4984f645 scheduler: Use precomputed time slice lengths 2013-12-23 22:49:12 +01:00
Pawel Dziepak
ede552ab25 scheduler: Keep thread effective priority cached 2013-12-23 22:06:33 +01:00
Pawel Dziepak
b24ea642d7 scheduler: Encapsulate ThreadData fields 2013-12-23 21:32:21 +01:00
Pawel Dziepak
a08b40d408 scheduler: Encapsulate CPUEntry fields 2013-12-23 20:15:16 +01:00
Pawel Dziepak
e1e7235c60 scheduler: Encapsulate CoreEntry fields 2013-12-23 18:27:10 +01:00
Pawel Dziepak
3309bf33c7 kernel/util: Make MinMaxHeap::Peek*() const 2013-12-23 03:52:13 +01:00
Pawel Dziepak
5a69ffc01e scheduler: Remove RunQueue::PeekSecondMaximum() 2013-12-23 03:51:02 +01:00
Pawel Dziepak
60e198f2cb scheduler: Encapsulate PackageEntry fields
Apart from the refactoring this commit takes the opportunity and removes
unnecessary read locks when choosing a package and a core from idle lists.
The data structures are accessed in a thread safe way and it does not really
matter whether the obtained data becomes outdated just when we release the
lock or during our search for the appropriate package/core.
2013-12-23 00:56:44 +01:00
Pawel Dziepak
cf21c40b50 x86: Fix style
Thanks Axel.
2013-12-23 00:09:03 +01:00
Pawel Dziepak
b89b5d3826 x86: Make arch/smp.h a C++ only header 2013-12-20 22:05:26 +01:00
Pawel Dziepak
9116eec24c scheduler: Allow calling UpdatePriority() for disabled CPU 2013-12-20 05:40:59 +01:00
Pawel Dziepak
b4552fcf9b x86: Remove debug message 2013-12-20 05:40:59 +01:00
Pawel Dziepak
73363f8dde kernel/vm: Fix unsigned/signed comparison warning 2013-12-20 05:40:59 +01:00
Pawel Dziepak
c08ed2db65 scheduler: Try to keep thread on the same logical CPU
Some SMT implementations (e.g. recent AMD microarchitectures) have
separate L1d cache for each SMT thread (which AMD decides to call "cores").
This means that we shouldn't move threads to another logical processor too
often even if it belongs to the same core. We aren't very strict about
this as it would complicate load balancing, but we try to reduce unnecessary
migrations.
2013-12-20 03:36:01 +01:00
Pawel Dziepak
ad6b9a1df8 scheduler: Use sequential locks instead of atomic 64 bit access 2013-12-20 02:18:44 +01:00
Pawel Dziepak
b258298c70 kernel: Protect cpu_ent::active_time with sequential lock
atomic_{get, set}64() are problematic on architectures without 64 bit
compare and swap.
Also, using sequential lock instead of atomic access ensures that
any reads from cpu_ent::active_time won't require any writes to shared
memory.
2013-12-20 01:31:32 +01:00
Pawel Dziepak
6639514437 x86[_64]: Support assigning MSI IRQs to arbitrary CPU 2013-12-20 01:07:08 +01:00
Pawel Dziepak
caf1b0dffb intel_cstates: Computing C-state requires constant time step 2013-12-19 20:47:22 +01:00
Pawel Dziepak
3add52e8ba kernel: Fix topology node count being decreased twice per node 2013-12-19 20:24:34 +01:00
Pawel Dziepak
e3d001ff02 x86: Implement multicast ICIs 2013-12-19 19:35:44 +01:00