amd64: stop nesting preemption counter in spinlock_enter
Discussed with: jhb
This commit is contained in:
parent
b77ed9cba6
commit
3552994d2f
@ -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…
x
Reference in New Issue
Block a user