From owner-svn-src-head@freebsd.org Sat Nov 21 10:32:41 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6DD1D2EA96F; Sat, 21 Nov 2020 10:32:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CdV9P2ZZGz4XrG; Sat, 21 Nov 2020 10:32:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B32C26BBB; Sat, 21 Nov 2020 10:32:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ALAWfka058190; Sat, 21 Nov 2020 10:32:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ALAWevY058187; Sat, 21 Nov 2020 10:32:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202011211032.0ALAWevY058187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 21 Nov 2020 10:32:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367918 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 367918 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Nov 2020 10:32:41 -0000 Author: kib Date: Sat Nov 21 10:32:40 2020 New Revision: 367918 URL: https://svnweb.freebsd.org/changeset/base/367918 Log: Stop using eventhandler to invoke umtx_exec hook. There is no point in dynamic registration, umtx hook is there always. Reviewed by: mjg Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D27303 Modified: head/sys/kern/kern_exec.c head/sys/kern/kern_umtx.c head/sys/sys/umtx.h Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Sat Nov 21 03:27:32 2020 (r367917) +++ head/sys/kern/kern_exec.c Sat Nov 21 10:32:40 2020 (r367918) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #ifdef KTRACE @@ -1047,8 +1048,8 @@ exec_new_vmspace(struct image_params *imgp, struct sys imgp->sysent = sv; sigfastblock_clear(td); + umtx_exec(p); - /* May be called with Giant held */ EVENTHANDLER_DIRECT_INVOKE(process_exec, p, imgp); /* Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Sat Nov 21 03:27:32 2020 (r367917) +++ head/sys/kern/kern_umtx.c Sat Nov 21 10:32:40 2020 (r367918) @@ -446,8 +446,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(); } @@ -4356,12 +4354,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; @@ -4383,7 +4380,7 @@ umtx_exec_hook(void *arg __unused, struct proc *p, } /* - * thread_exit() hook. + * thread exit hook. */ void umtx_thread_exit(struct thread *td) Modified: head/sys/sys/umtx.h ============================================================================== --- head/sys/sys/umtx.h Sat Nov 21 03:27:32 2020 (r367917) +++ head/sys/sys/umtx.h Sat Nov 21 10:32:40 2020 (r367918) @@ -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);