HomeFreeBSD

REAP_KILL_PROC: kill processes in the threaded taskqueue context

Description

REAP_KILL_PROC: kill processes in the threaded taskqueue context

There is a problem still left after the fixes to REAP_KILL_PROC. The
handling of the stopping signals by sig_suspend_threads() can occur
outside the stopping process context by tdsendsignal(), and it uses
mostly the same mechanism of aborting sleeps as suspension. In other
words, it badly interacts with thread_single(SINGLE_ALLPROC).

But unlike single threading from the process context, we cannot wait by
sleep for other single threading requests to pass, because we own
spinlock(s).

Fix this by moving both the thread_single(p2, SINGLE_ALLPROC), and the
signalling, to the threaded taskqueue which cannot be single-threaded
itself.

Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D36207

Details

Provenance
kibAuthored on Aug 12 2022, 7:37 PM
Reviewer
markj
Differential Revision
D36207: Yet another round of fixes for REAP_KILL
Parents
rG5e9bba94bd7f: fork_norfproc(): unlock p1 before retrying
Branches
Unknown
Tags
Unknown