mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-13 10:02:38 +00:00
- 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.
This commit is contained in:
parent
093c05e39d
commit
fa9c971710
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=122848
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user