aboutsummaryrefslogtreecommitdiff
path: root/hw/chiptod.c
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2015-05-06 14:00:52 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-05-07 17:54:30 +1000
commit0a3e75d5988c334197d4cb27d92acb901605019a (patch)
tree28e2da85cb532958da5ca62dbee8176109f11c04 /hw/chiptod.c
parent00f469a5f9231c50d478407ae7d42fcbad942fc0 (diff)
downloadskiboot-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 'hw/chiptod.c')
-rw-r--r--hw/chiptod.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/hw/chiptod.c b/hw/chiptod.c
index e5c3a22..18c4847 100644
--- a/hw/chiptod.c
+++ b/hw/chiptod.c
@@ -970,7 +970,8 @@ void chiptod_init(void)
/* Schedule master sync */
sres = false;
- cpu_wait_job(cpu_queue_job(cpu0, chiptod_sync_master, &sres), true);
+ cpu_wait_job(cpu_queue_job(cpu0, "chiptod_sync_master",
+ chiptod_sync_master, &sres), true);
if (!sres) {
op_display(OP_FATAL, OP_MOD_CHIPTOD, 2);
abort();
@@ -986,7 +987,8 @@ void chiptod_init(void)
/* Queue job */
sres = false;
- cpu_wait_job(cpu_queue_job(cpu, chiptod_sync_slave, &sres),
+ cpu_wait_job(cpu_queue_job(cpu, "chiptod_sync_slave",
+ chiptod_sync_slave, &sres),
true);
if (!sres) {
op_display(OP_WARN, OP_MOD_CHIPTOD, 3|(cpu->pir << 8));
@@ -1002,7 +1004,8 @@ void chiptod_init(void)
/* Only do primaries, not threads */
if (cpu->is_secondary)
continue;
- cpu_wait_job(cpu_queue_job(cpu, chiptod_print_tb, NULL), true);
+ cpu_wait_job(cpu_queue_job(cpu, "chiptod_print_tb",
+ chiptod_print_tb, NULL), true);
}
op_display(OP_LOG, OP_MOD_CHIPTOD, 4);