svn commit: r368122 - in stable/12/sys: kern sys
Konstantin Belousov
kib at FreeBSD.org
Sat Nov 28 10:36:21 UTC 2020
Author: kib
Date: Sat Nov 28 10:36:19 2020
New Revision: 368122
URL: https://svnweb.freebsd.org/changeset/base/368122
Log:
MFC r367918, r367919:
Stop using eventhandler to invoke umtx_exec hook.
Modified:
stable/12/sys/kern/kern_exec.c
stable/12/sys/kern/kern_umtx.c
stable/12/sys/sys/umtx.h
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/sys/kern/kern_exec.c
==============================================================================
--- stable/12/sys/kern/kern_exec.c Sat Nov 28 09:06:51 2020 (r368121)
+++ stable/12/sys/kern/kern_exec.c Sat Nov 28 10:36:19 2020 (r368122)
@@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$");
#include <sys/sysctl.h>
#include <sys/sysent.h>
#include <sys/sysproto.h>
+#include <sys/umtx.h>
#include <sys/vnode.h>
#include <sys/wait.h>
#ifdef KTRACE
@@ -1106,7 +1107,8 @@ exec_new_vmspace(struct image_params *imgp, struct sys
imgp->vmspace_destroyed = 1;
imgp->sysent = sv;
- /* May be called with Giant held */
+ umtx_exec(p);
+
EVENTHANDLER_DIRECT_INVOKE(process_exec, p, imgp);
/*
Modified: stable/12/sys/kern/kern_umtx.c
==============================================================================
--- stable/12/sys/kern/kern_umtx.c Sat Nov 28 09:06:51 2020 (r368121)
+++ stable/12/sys/kern/kern_umtx.c Sat Nov 28 10:36:19 2020 (r368122)
@@ -281,8 +281,6 @@ static void umtx_pi_free(struct umtx_pi *pi);
static int do_unlock_pp(struct thread *td, struct umutex *m, uint32_t flags,
bool rb);
static void umtx_thread_cleanup(struct thread *td);
-static void umtx_exec_hook(void *arg __unused, struct proc *p __unused,
- struct image_params *imgp __unused);
SYSINIT(umtx, SI_SUB_EVENTHANDLER+1, SI_ORDER_MIDDLE, umtxq_sysinit, NULL);
#define umtxq_signal(key, nwake) umtxq_signal_queue((key), (nwake), UMTX_SHARED_QUEUE)
@@ -450,8 +448,6 @@ umtxq_sysinit(void *arg __unused)
umtx_init_profiling();
#endif
mtx_init(&umtx_lock, "umtx lock", NULL, MTX_DEF);
- EVENTHANDLER_REGISTER(process_exec, umtx_exec_hook, NULL,
- EVENTHANDLER_PRI_ANY);
umtx_shm_init();
}
@@ -4492,12 +4488,11 @@ umtx_thread_alloc(struct thread *td)
* exec() hook.
*
* Clear robust lists for all process' threads, not delaying the
- * cleanup to thread_exit hook, since the relevant address space is
+ * cleanup to thread exit, since the relevant address space is
* destroyed right now.
*/
-static void
-umtx_exec_hook(void *arg __unused, struct proc *p,
- struct image_params *imgp __unused)
+void
+umtx_exec(struct proc *p)
{
struct thread *td;
@@ -4519,7 +4514,7 @@ umtx_exec_hook(void *arg __unused, struct proc *p,
}
/*
- * thread_exit() hook.
+ * thread exit hook.
*/
void
umtx_thread_exit(struct thread *td)
Modified: stable/12/sys/sys/umtx.h
==============================================================================
--- stable/12/sys/sys/umtx.h Sat Nov 28 09:06:51 2020 (r368121)
+++ stable/12/sys/sys/umtx.h Sat Nov 28 10:36:19 2020 (r368122)
@@ -188,6 +188,7 @@ umtx_key_match(const struct umtx_key *k1, const struct
}
int umtx_copyin_timeout(const void *, struct timespec *);
+void umtx_exec(struct proc *p);
int umtx_key_get(const void *, int, int, struct umtx_key *);
void umtx_key_release(struct umtx_key *);
struct umtx_q *umtxq_alloc(void);
More information about the svn-src-stable-12
mailing list