summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2013-05-24 20:24:05 +0200
committerRichard Braun <rbraun@sceen.net>2013-05-24 20:25:24 +0200
commit7070de3e09c0c25d1edd189a310eafa707518270 (patch)
tree88b09ed5eca15d59257c5a3d4663cb668468d01a
parent4b7bab60037521dee5f1338db809a22a9fd8acd0 (diff)
kern/llsync: minor refactoring
Move code handling the unregistration of the last processor in the global checkpoint processing function, where list management actually occurs.
-rw-r--r--kern/llsync.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/kern/llsync.c b/kern/llsync.c
index 7204c438..d2471b4e 100644
--- a/kern/llsync.c
+++ b/kern/llsync.c
@@ -179,6 +179,12 @@ llsync_process_global_checkpoint(unsigned int cpu)
nr_cpus = cpu_count();
bitmap_copy(llsync_pending_checkpoints, llsync_registered_cpus, nr_cpus);
llsync_nr_pending_checkpoints = llsync_nr_registered_cpus;
+
+ if (llsync_nr_registered_cpus == 0) {
+ list_concat(&llsync_list1, &llsync_list0);
+ list_init(&llsync_list0);
+ }
+
list_concat(&llsync_list2, &llsync_list1);
list_set_head(&llsync_list1, &llsync_list0);
list_init(&llsync_list0);
@@ -244,13 +250,7 @@ llsync_unregister_cpu(unsigned int cpu)
bitmap_clear(llsync_registered_cpus, cpu);
llsync_nr_registered_cpus--;
- if (llsync_nr_registered_cpus != 0)
- llsync_commit_checkpoint_common(cpu);
- else {
- list_concat(&llsync_list1, &llsync_list0);
- list_init(&llsync_list0);
- llsync_process_global_checkpoint(cpu);
- }
+ llsync_commit_checkpoint_common(cpu);
spinlock_unlock_intr_restore(&llsync_lock, flags);
}