From 752f1c1fe9e74ebb0d373276b332b3242e589208 Mon Sep 17 00:00:00 2001 From: Mitch Hayenga Date: Thu, 21 Jul 2016 17:19:16 +0100 Subject: cpu: Fix Minor SMT WFI/drain interaction issues The behavior of WFI is to cause minor to cease evaluating pipeline logic until an interrupt is observed, however a user may wish to drain the system while a core is sleeping due to a WFI. This patch makes WFI drain. If an actual drain occurs during a WFI, the CPU is already drained and will immediately be ready for swapping, checkpointing, etc. This should not negatively impact performance as WFI instructions are 'stream-changing' (treated like unpredicted branches), so all remaining instructions are wrong-path and will be squashed rapidly. Change-Id: I63833d5acb53d8dde78f9f0c9611de0ece385e45 --- src/cpu/minor/fetch2.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/cpu/minor/fetch2.cc') diff --git a/src/cpu/minor/fetch2.cc b/src/cpu/minor/fetch2.cc index ae02b1c22..394fe8549 100644 --- a/src/cpu/minor/fetch2.cc +++ b/src/cpu/minor/fetch2.cc @@ -563,8 +563,7 @@ Fetch2::getScheduledThread() } for (auto tid : priority_list) { - if (cpu.getContext(tid)->status() == ThreadContext::Active && - getInput(tid) && !fetchInfo[tid].blocked) { + if (getInput(tid) && !fetchInfo[tid].blocked) { threadPriority = tid; return tid; } -- cgit v1.2.3