[Skiboot] [PATCH] cpu: Ensure no-return flag is updated for current cpu_thread
Vaibhav Jain
vaibhav at linux.ibm.com
Fri Jul 6 17:09:13 AEST 2018
Presently in case a cpu_thread queues a non returning job on itself,
the variable cpu_thread.job_has_no_return is never updated and other
cpu_threads can still queue a job on it without triggering any
warnings.
So this patch updates __cpu_queue_job() to ensure that
job_has_no_return is updated on the current cpu_thread before it
branches to the job->func(). So if the current job is non-returning
then other cpu_threads queuing a job on this cpu will trigger a
warning. This should aid in debugging some skiboot deadlocks.
Signed-off-by: Vaibhav Jain <vaibhav at linux.ibm.com>
---
core/cpu.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/core/cpu.c b/core/cpu.c
index a8936fab..84d900d8 100644
--- a/core/cpu.c
+++ b/core/cpu.c
@@ -204,6 +204,8 @@ struct cpu_job *__cpu_queue_job(struct cpu_thread *cpu,
/* Can't be scheduled, run it now */
if (cpu == NULL) {
+ if (!this_cpu()->job_has_no_return)
+ this_cpu()->job_has_no_return = no_return;
func(data);
job->complete = true;
return job;
--
2.17.1
More information about the Skiboot
mailing list