amd64: stop nesting preemption counter in spinlock_enter
Discussed with: jhb
This commit is contained in:
parent
fe7979a12c
commit
ca0227933e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=325734
@ -1853,9 +1853,9 @@ spinlock_enter(void)
|
||||
flags = intr_disable();
|
||||
td->td_md.md_spinlock_count = 1;
|
||||
td->td_md.md_saved_flags = flags;
|
||||
critical_enter();
|
||||
} else
|
||||
td->td_md.md_spinlock_count++;
|
||||
critical_enter();
|
||||
}
|
||||
|
||||
void
|
||||
@ -1865,11 +1865,12 @@ spinlock_exit(void)
|
||||
register_t flags;
|
||||
|
||||
td = curthread;
|
||||
critical_exit();
|
||||
flags = td->td_md.md_saved_flags;
|
||||
td->td_md.md_spinlock_count--;
|
||||
if (td->td_md.md_spinlock_count == 0)
|
||||
if (td->td_md.md_spinlock_count == 0) {
|
||||
critical_exit();
|
||||
intr_restore(flags);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user