Page MenuHomeFreeBSD

Set TDP_KTHREAD before calling cpu_fork() and cpu_copy_thread().
ClosedPublic

Authored by jhb on Mar 10 2021, 10:13 PM.

Details

Summary

This permits these routines to use special logic for initializing MD
kthread state.

For the kproc case, this required moving the logic to set these flags
from kproc_create() into do_fork().

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

sys/kern/kern_fork.c
508

Note that code for DROPSIG_CAUGHT above is accurate to lock p2 ps_mtx around p_sigacts manipulations (even if only for asserts). I think it is better to be consistent both by style and formal requirements and lock ps_mtx if (FR2_DROPSIG_CAUGHT | FR2_KPROC).

jhb marked an inline comment as done.Mar 11 2021, 10:36 PM
This revision is now accepted and ready to land.Mar 12 2021, 12:46 PM