]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Merge td_epochnest with td_no_sleeping.
authorglebius <glebius@FreeBSD.org>
Tue, 29 Oct 2019 17:28:25 +0000 (17:28 +0000)
committerglebius <glebius@FreeBSD.org>
Tue, 29 Oct 2019 17:28:25 +0000 (17:28 +0000)
commit8bb52bf9209fa537c4f7f5a32d44079a8bfcfe3b
treeffa770650db53de6a61f2f1e195f06dec102b96b
parent426fb7a9acab5234a4850926810420534694ba26
Merge td_epochnest with td_no_sleeping.

Epoch itself doesn't rely on the counter and it is provided
merely for sleeping subsystems to check it.

- In functions that sleep use THREAD_CAN_SLEEP() to assert
  correctness.  With EPOCH_TRACE compiled print epoch info.
- _sleep() was a wrong place to put the assertion for epoch,
  right place is sleepq_add(), as there ways to call the
  latter bypassing _sleep().
- Do not increase td_no_sleeping in non-preemptible epochs.
  The critical section would trigger all possible safeguards,
  no sleeping counter is extraneous.

Reviewed by: kib
sys/kern/genoffset.c
sys/kern/kern_malloc.c
sys/kern/kern_synch.c
sys/kern/subr_epoch.c
sys/kern/subr_sleepqueue.c
sys/kern/subr_trap.c