diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-05-06 14:00:52 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-05-07 17:54:30 +1000 |
commit | 0a3e75d5988c334197d4cb27d92acb901605019a (patch) | |
tree | 28e2da85cb532958da5ca62dbee8176109f11c04 /include/cpu.h | |
parent | 00f469a5f9231c50d478407ae7d42fcbad942fc0 (diff) | |
download | skiboot-0a3e75d5988c334197d4cb27d92acb901605019a.zip skiboot-0a3e75d5988c334197d4cb27d92acb901605019a.tar.gz skiboot-0a3e75d5988c334197d4cb27d92acb901605019a.tar.bz2 |
Add global CPU job queue
When we have multiple systems trying to start concurrent jobs on different
CPUs, they typically pick the first available (operating) CPU to schedule
the job on. This works fine when there's only one set of jobs or when we
want to bind jobs to specific CPUs.
When we have jobs such as asynchronously loading LIDs and scanning PHBs,
we don't care which CPUs they run on, we care more that they are not
scheduled on CPUs that have existing tasks.
This patch adds a global queue of jobs which secondary CPUs will look
at for work (if idle).
This leads to simplified callers, which just need to queue jobs to NULL
(no specific CPU) and then call a magic function that will run the
CPU job queue if we don't have secondary CPUs.
Additionally, we add a const char *name to cpu_job just to aid with
debugging.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'include/cpu.h')
-rw-r--r-- | include/cpu.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/cpu.h b/include/cpu.h index 168714a..2bf15ea 100644 --- a/include/cpu.h +++ b/include/cpu.h @@ -197,14 +197,16 @@ void cpu_disable_all_threads(struct cpu_thread *cpu); /* Allocate & queue a job on target CPU */ extern struct cpu_job *__cpu_queue_job(struct cpu_thread *cpu, + const char *name, void (*func)(void *data), void *data, bool no_return); static inline struct cpu_job *cpu_queue_job(struct cpu_thread *cpu, + const char *name, void (*func)(void *data), void *data) { - return __cpu_queue_job(cpu, func, data, false); + return __cpu_queue_job(cpu, name, func, data, false); } @@ -222,6 +224,8 @@ extern void cpu_free_job(struct cpu_job *job); /* Called by init to process jobs */ extern void cpu_process_jobs(void); +/* Fallback to running jobs synchronously for global jobs */ +extern void cpu_process_local_jobs(void); static inline void cpu_give_self_os(void) { |