cpu: some changes to switching
Review Request #1904 - Created June 7, 2013 and discarded
| Information | |
|---|---|
| Nilay Vaish | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 9748:5d7be2fc04c7 --------------------------- cpu: some changes to switching 1. The fetch stage, when it overtakes from another cpu, initializes its status variable to Running. When an o3 cpu is about to switch to another cpu, the fetch stage checks that its status should be Idle. Now suppose there are two processors in the system. The operating system has just started and it is running on cpu0. Then, cpu1 would not be actually doing anything. When trying to switch to another cpu, cpu1 gets stuck because there is nothing going on that will move it from Running to Idle. I think we should have the fetchStatus be initialized to Idle state. The o3 cpu will activate some context at point in future. When it does that, it calls the function wakeFromQuiesce() on the fetch stage. This function in turn changes the fetchStatus to Running. As of now, the function only does this for thread 0. I am proposing that we pass the thread id and do it for that particular thread. 2. The TimingSimpleCPU incorrectly tested its status when switching out. 3. The commit stage should check for the its status being Idle when testing whether it needs to drain itself. 4. The atomic cpu should test its status variable before checking any other variables for deciding on draining.
Issue Summary
4
4
0
0
| Description | From | Last Updated | Status |
|---|---|---|---|
| This breaks all the assumptions we make about a drained system. It doesn't matter if it is Idle or not, ... | Andreas Sandberg | June 10, 2013, 9:59 p.m. | Open |
| I'm not sure if this is actually correct. Isn't it possible for a CPU to be Idle and in microcode ... | Andreas Sandberg | June 10, 2013, 9:59 p.m. | Open |
| isDrained() should always be true, independent of the state, when we reach this code. Could you move it to a ... | Andreas Sandberg | June 10, 2013, 9:59 p.m. | Open |
| Same as for the atomic CPU. Should probably be something like this: assert(_statue == Running || _status == Idle); assert(isDrained()); | Andreas Sandberg | June 10, 2013, 9:59 p.m. | Open |
Posted (June 10, 2013, 9:59 p.m.)
I get the feeling that this will completely break all the assumptions we make about a drained system not executing microcode. You need to change that before committing, otherwise all KVM-related work will break.
-
src/cpu/o3/commit_impl.hh (Diff revision 1) -
This breaks all the assumptions we make about a drained system. It doesn't matter if it is Idle or not, as long as it is executing microcode, it isn't drained and will break things.
-
src/cpu/simple/atomic.cc (Diff revision 1) -
I'm not sure if this is actually correct. Isn't it possible for a CPU to be Idle and in microcode or something else that will break the assumptions we have about drained CPUs?
-
src/cpu/simple/atomic.cc (Diff revision 1) -
isDrained() should always be true, independent of the state, when we reach this code. Could you move it to a separate assert to make sure we better error messages if it explodes?
-
src/cpu/simple/timing.cc (Diff revision 1) -
Same as for the atomic CPU. Should probably be something like this: assert(_statue == Running || _status == Idle); assert(isDrained());
