]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
AST: rework
authorKonstantin Belousov <kib@FreeBSD.org>
Mon, 18 Jul 2022 16:39:17 +0000 (19:39 +0300)
committerKonstantin Belousov <kib@FreeBSD.org>
Tue, 2 Aug 2022 18:11:09 +0000 (21:11 +0300)
commitc6d31b8306eb708441c61c33bcf886ecad268a16
tree3e61512a31b669d0e150722644eed72dd95516f5
parent4a5ec55af6d0bfa659f67483e346d55f90ba0856
AST: rework

Make most AST handlers dynamically registered.  This allows to have
subsystem-specific handler source located in the subsystem files,
instead of making subr_trap.c aware of it.  For instance, signal
delivery code on return to userspace is now moved to kern_sig.c.

Also, it allows to have some handlers designated as the cleanup (kclear)
type, which are called both at AST and on thread/process exit.  For
instance, ast(), exit1(), and NFS server no longer need to be aware
about UFS softdep processing.

The dynamic registration also allows third-party modules to register AST
handlers if needed.  There is one caveat with loadable modules: the
code does not make any effort to ensure that the module is not unloaded
before all threads processed through AST handler in it.  In fact, this
is already present behavior for hwpmc.ko and ufs.ko.  I do not think it
is worth the efforts and the runtime overhead to try to fix it.

Reviewed by: markj
Tested by: emaste (arm64), pho
Discussed with: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D35888
45 files changed:
sys/amd64/amd64/exception.S
sys/amd64/amd64/genassym.c
sys/amd64/include/vmm.h
sys/amd64/vmm/vmm.c
sys/arm/arm/exception.S
sys/arm/arm/genassym.c
sys/arm64/arm64/exception.S
sys/arm64/arm64/genassym.c
sys/compat/linux/linux_event.c
sys/compat/linux/linux_fork.c
sys/compat/linuxkpi/common/include/linux/sched.h
sys/dev/hwpmc/hwpmc_soft.c
sys/fs/nfsserver/nfs_nfsdkrpc.c
sys/geom/geom_event.c
sys/i386/i386/exception.s
sys/i386/i386/genassym.c
sys/kern/kern_clock.c
sys/kern/kern_event.c
sys/kern/kern_exit.c
sys/kern/kern_fork.c
sys/kern/kern_ktrace.c
sys/kern/kern_proc.c
sys/kern/kern_racct.c
sys/kern/kern_sig.c
sys/kern/kern_synch.c
sys/kern/kern_thr.c
sys/kern/kern_thread.c
sys/kern/sched_4bsd.c
sys/kern/sched_ule.c
sys/kern/subr_prof.c
sys/kern/subr_sleepqueue.c
sys/kern/subr_smp.c
sys/kern/subr_trap.c
sys/kern/sys_generic.c
sys/kern/sys_process.c
sys/powerpc/aim/trap_subr32.S
sys/powerpc/aim/trap_subr64.S
sys/powerpc/booke/trap_subr.S
sys/powerpc/powerpc/genassym.c
sys/riscv/riscv/exception.S
sys/riscv/riscv/genassym.c
sys/security/mac_lomac/mac_lomac.c
sys/sys/proc.h
sys/sys/racct.h
sys/ufs/ffs/ffs_softdep.c