HomeFreeBSD

jail: Handle jail removal in a dedicated thread

Description

jail: Handle jail removal in a dedicated thread

Otherwise a deadlock is possible: the system taskqueue thread removes a
prison and calls vnet_destroy(), vnet_vlan_uninit() destroys the if_vlan
cloner, the vlan_clone_destroy() callback calls taskqueue_drain() on the
thread taskqueue.

Fix the problem by introducing a new thread for jail removals.

Ideally, the taskqueue interface would let consumers define queues
without having to map them to threads, as that'd make it possible to
avoid such deadlocks without extra threads; for now, this is the only
solution.

Reviewed by: jamie
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D47991

(cherry picked from commit 8cf955f3f48a45db22a3cc3ad89a22b543fa38ce)

Details

Provenance
markjAuthored on Sat, Dec 21, 7:23 PM
Reviewer
jamie
Differential Revision
D47991: jail: Handle jail removal in a dedicated thread
Parents
rGf9275f94f33b: riscv: Permit spurious faults in kernel mode
Branches
Unknown
Tags
Unknown