From 5588cf81b95d9a940040d16e995e07738c8af0d4 Mon Sep 17 00:00:00 2001 From: Nick Bofferding Date: Thu, 14 Mar 2019 23:51:12 -0500 Subject: Fix bug where task migrates away from pinned CPU unexpectedly This commit fixes a bug wherein, if a task was pinned and then migrated to master, a page fault to load any instructions after the migrate but before the unpin, could cause the task to migrate away unexpectedly, causing a range of symptoms such as not being able to find the master core. Change-Id: I596f67d678f7641bb51ab9a9a3ae2b3ab65ae9b9 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/73390 Reviewed-by: Michael Baiocchi Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: FSP CI Jenkins Reviewed-by: Matthew Raybuck Tested-by: Jenkins OP HW Reviewed-by: Daniel M. Crowell --- src/kernel/msghandler.C | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/kernel') diff --git a/src/kernel/msghandler.C b/src/kernel/msghandler.C index 8e7244d2b..200f9c028 100644 --- a/src/kernel/msghandler.C +++ b/src/kernel/msghandler.C @@ -165,7 +165,10 @@ int MessageHandler::recvMessage(msg_t* i_msg) { // Successful response, resume task. - if (!restored_task) // Immediately execute first deferred task. + // Immediately execute first deferred task unless it is pinned, + // in which case it must go back onto the queue of the CPU it's + // pinned to (and may take slightly longer to dispatch) + if (!restored_task && !deferred_task->affinity_pinned) { restored_task = true; TaskManager::setCurrentTask(deferred_task); -- cgit v1.2.3