diff options
author | jeff <jeff@FreeBSD.org> | 2003-11-17 08:27:11 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2003-11-17 08:27:11 +0000 |
commit | 71a2f6d14698b35350148cb96e1da0939b08ccb2 (patch) | |
tree | 6fc90c6b4183da58259a9767b9afa4739afe73b6 | |
parent | a6911261a373739555e9a4ae0e3829f789884278 (diff) | |
download | FreeBSD-src-71a2f6d14698b35350148cb96e1da0939b08ccb2.zip FreeBSD-src-71a2f6d14698b35350148cb96e1da0939b08ccb2.tar.gz |
- Mark ksq_assigned as volatile so that when this code is used without
sched_lock we can be sure that we'll pick up the new value.
-rw-r--r-- | sys/kern/sched_ule.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 357d607..b42be6d 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -219,7 +219,7 @@ struct kseq { int ksq_load_transferable; /* kses that may be migrated. */ int ksq_idled; int ksq_cpus; /* Count of CPUs in this kseq. */ - struct kse *ksq_assigned; /* assigned by another CPU. */ + volatile struct kse *ksq_assigned; /* assigned by another CPU. */ #endif }; @@ -486,7 +486,7 @@ kseq_assign(struct kseq *kseq) struct kse *ke; do { - ke = kseq->ksq_assigned; + (volatile struct kse *)ke = kseq->ksq_assigned; } while(!atomic_cmpset_ptr(&kseq->ksq_assigned, ke, NULL)); for (; ke != NULL; ke = nke) { nke = ke->ke_assign; @@ -510,7 +510,7 @@ kseq_notify(struct kse *ke, int cpu) * Place a KSE on another cpu's queue and force a resched. */ do { - ke->ke_assign = kseq->ksq_assigned; + (volatile struct kse *)ke->ke_assign = kseq->ksq_assigned; } while(!atomic_cmpset_ptr(&kseq->ksq_assigned, ke->ke_assign, ke)); pcpu = pcpu_find(cpu); td = pcpu->pc_curthread; |