Hello Andreas Sandberg,
I'd like you to do a code review. Please visit
https://gem5-review.googlesource.com/3970
to review the following change.
Change subject: cpu,o3: Fixed checkpointing bug occuring in the o3 CPU
......................................................................
cpu,o3: Fixed checkpointing bug occuring in the o3 CPU
Checkpointing a system with out-of-order CPUs might get stuck if
one of the CPUs has been put to sleep. The quiesce instruction
cannot get drained hence checkpointing never finishes.
This commit resolves that by activating all suspended thread
contexts when draining the system.
Change-Id: I817ab1672b4ead777bd8e12a0445829481c46fdc
Reviewed-by: Sascha Bischoff <[email protected]>
Reviewed-by: Andreas Sandberg <[email protected]>
---
M src/cpu/o3/cpu.cc
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc
index 8146c68..f40017c 100644
--- a/src/cpu/o3/cpu.cc
+++ b/src/cpu/o3/cpu.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2012, 2014, 2016 ARM Limited
+ * Copyright (c) 2011-2012, 2014, 2016, 2017 ARM Limited
* Copyright (c) 2013 Advanced Micro Devices, Inc.
* All rights reserved
*
@@ -1070,6 +1070,17 @@
// Wake the CPU and record activity so everything can drain out if
// the CPU was not able to immediately drain.
if (!isDrained()) {
+ // If a thread is suspended, wake it up so it can be drained
+ for (auto t : threadContexts) {
+ if (t->status() == ThreadContext::Suspended){
+ DPRINTF(Drain, "Currently suspended so activate %i \n",
+ t->threadId());
+ t->activate();
+ // As the thread is now active, change the power state as
well
+ activateContext(t->threadId());
+ }
+ }
+
wakeCPU();
activityRec.activity();
--
To view, visit https://gem5-review.googlesource.com/3970
To unsubscribe, visit https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I817ab1672b4ead777bd8e12a0445829481c46fdc
Gerrit-Change-Number: 3970
Gerrit-PatchSet: 1
Gerrit-Owner: Anouk Van Laer <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev