diff options
author | Richard Braun <rbraun@sceen.net> | 2013-05-24 20:23:56 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2013-05-24 20:25:39 +0200 |
commit | 47713dee27ac3fee0d8a6dee1c104fa48b88c299 (patch) | |
tree | b9214edd2b90b86c05afc648690875f7cc5c1def /kern/llsync.c | |
parent | 7070de3e09c0c25d1edd189a310eafa707518270 (diff) |
kern/llsync: fix first processor registration
Intuitively, registering the first processor should trigger a global
checkpoint to get the lockless synchronization system started. It is
possible, however, that this case occurs frequently on idle systems,
where processors are normally not registered, and only perform load
balancing. It can also happen that a processor determines itself as
the only registered one whereas reset interrupts have not yet been
processed, in which case a global checkpoint should just not occur.
The real condition for a global checkpoint is the number of pending
checkpoints reaching 0.
Diffstat (limited to 'kern/llsync.c')
-rw-r--r-- | kern/llsync.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kern/llsync.c b/kern/llsync.c index d2471b4e..aa5ac346 100644 --- a/kern/llsync.c +++ b/kern/llsync.c @@ -210,7 +210,8 @@ llsync_register_cpu(unsigned int cpu) bitmap_set(llsync_registered_cpus, cpu); llsync_nr_registered_cpus++; - if (llsync_nr_registered_cpus == 1) + if ((llsync_nr_registered_cpus == 1) + && (llsync_nr_pending_checkpoints == 0)) llsync_process_global_checkpoint(cpu); assert(!llsync_cpus[cpu].registered); |