diff mbox series

[v1,4/6] core/cpu: move cpu_wake out of job_lock

Message ID 20210811054851.861482-5-npiggin@gmail.com
State Superseded
Headers show
Series idle synchronisation improvements | expand

Commit Message

Nicholas Piggin Aug. 11, 2021, 5:48 a.m. UTC
There is no need to keep the IPI initiation under the job_lock.
If the target does wake after the job is queued and before we can
send the IPI, it will check for new jobs.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 core/cpu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/core/cpu.c b/core/cpu.c
index d77ab7c93..0b05d28c6 100644
--- a/core/cpu.c
+++ b/core/cpu.c
@@ -192,8 +192,9 @@  static void queue_job_on_cpu(struct cpu_thread *cpu, struct cpu_job *job)
 		cpu->job_has_no_return = true;
 	else
 		cpu->job_count++;
-	cpu_wake(cpu);
 	unlock(&cpu->job_lock);
+
+	cpu_wake(cpu);
 }
 
 struct cpu_job *__cpu_queue_job(struct cpu_thread *cpu,