From b2f0bc0c21b906e134a373bb2a9bad8f25f30dc7 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 7 Jan 2014 12:29:08 -0800 Subject: [PATCH] Client: fix bug that caused lots of spurious "no shared memory segment" msgs ACTIVE_TASK_SET::suspend_all() originally skipped tasks in states other than PROCESS_EXECUTING. I took this out in commit 47b4d6b because - for example - a GPU task might be suspended due to CPU throttling, and therefore left in memory, but if it's then suspended for some other reason, it must be removed from memory. However, this change was overkill - it causes tasks for which no process exists to be suspended, resulting in the spurious msgs. Solution: skip tasks in states other than PROCESS_EXECUTING and PROCESS_SUSPENDED. --- client/app_control.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/client/app_control.cpp b/client/app_control.cpp index c4d7bf7a15..9b77f39aec 100644 --- a/client/app_control.cpp +++ b/client/app_control.cpp @@ -1056,6 +1056,23 @@ void ACTIVE_TASK_SET::suspend_all(int reason) { for (unsigned int i=0; itask_state()) { + case PROCESS_EXECUTING: + case PROCESS_SUSPENDED: + break; + default: + continue; + } + // handle CPU throttling separately // if (reason == SUSPEND_REASON_CPU_THROTTLE) { @@ -1484,4 +1501,3 @@ void ACTIVE_TASK::read_task_state_file() { } } } -