HomeFreeBSD

mpi3mr: Reduce the scope of the reset_mutext

Description

mpi3mr: Reduce the scope of the reset_mutext

Reduce the scope of reset_mutext to protect the msleep in the watch dog
thread as well as the MPI3MR_FLAGS_SHUTDOWN bit. Use it to protect the
wakeup in mpi3mr_detach so this thread can exit sooner when we're trying
to do an orderly shutdown. Optimize the flow to check the sleep and
other conditions before going to sleep.

It's an open question if this should protect sc->unrecoverable, and if
we should wakeup the watchdog thread when we set it. We might also want
to move too booleans for the three flags that we have now in
mpi3mr_flags. There are a number of U8s that should really be bools and
we might want to also group them together to pack softc better.

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D42539

(cherry picked from commit 7c4913093a759adf2e4c7d65535aee04aadee4df)

Details

Provenance
impAuthored on Nov 29 2023, 1:49 AM
mavCommitted on Jan 19 2024, 5:16 PM
Reviewer
mav
Differential Revision
D42539: mpi3mr: Reduce the scope of the reset_mutext
Parents
rGe82c6e941e6a: mpi3mr: Remove unused fields in struct mpi3mr_cmd
Branches
Unknown
Tags
Unknown