From owner-svn-src-stable-8@FreeBSD.ORG Wed Jun 8 03:45:41 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B7CB106566C; Wed, 8 Jun 2011 03:45:41 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56CB58FC19; Wed, 8 Jun 2011 03:45:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p583jf47013024; Wed, 8 Jun 2011 03:45:41 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p583jfE0013001; Wed, 8 Jun 2011 03:45:41 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201106080345.p583jfE0013001@svn.freebsd.org> From: Dmitry Chagin Date: Wed, 8 Jun 2011 03:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222846 - in stable/8/sys: amd64/amd64 amd64/linux32 arm/arm compat/ia32 compat/linux compat/svr4 i386/i386 i386/ibcs2 i386/linux ia64/ia64 kern mips/mips powerpc/powerpc sparc64/sparc6... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2011 03:45:41 -0000 Author: dchagin Date: Wed Jun 8 03:45:40 2011 New Revision: 222846 URL: http://svn.freebsd.org/changeset/base/222846 Log: MFC r219405: Extend struct sysvec with new method sv_schedtail, which is used for an explicit process at fork trampoline path instead of eventhadler(schedtail) invocation for each child process. Remove eventhandler(schedtail) code and change linux ABI to use newly added sysvec method. While here replace explicit comparing of module sysentvec structure with the newly created process sysentvec to detect the linux ABI. MFC r219421: Remove bogus since r219405 check of the Linux ABI. Modified: stable/8/sys/amd64/amd64/elf_machdep.c stable/8/sys/amd64/linux32/linux32_sysvec.c stable/8/sys/arm/arm/elf_machdep.c stable/8/sys/compat/ia32/ia32_sysvec.c stable/8/sys/compat/linux/linux_emul.c stable/8/sys/compat/linux/linux_emul.h stable/8/sys/compat/svr4/svr4_sysvec.c stable/8/sys/i386/i386/elf_machdep.c stable/8/sys/i386/ibcs2/ibcs2_sysvec.c stable/8/sys/i386/linux/linux_sysvec.c stable/8/sys/ia64/ia64/elf_machdep.c stable/8/sys/kern/imgact_aout.c stable/8/sys/kern/init_main.c stable/8/sys/kern/kern_fork.c stable/8/sys/mips/mips/elf64_machdep.c stable/8/sys/mips/mips/elf_machdep.c stable/8/sys/powerpc/powerpc/elf_machdep.c stable/8/sys/sparc64/sparc64/elf_machdep.c stable/8/sys/sys/eventhandler.h stable/8/sys/sys/param.h stable/8/sys/sys/sysent.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/elf_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/elf_machdep.c Wed Jun 8 03:02:11 2011 (r222845) +++ stable/8/sys/amd64/amd64/elf_machdep.c Wed Jun 8 03:45:40 2011 (r222846) @@ -79,6 +79,7 @@ struct sysentvec elf64_freebsd_sysvec = .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, + .sv_schedtail = NULL, }; static Elf64_Brandinfo freebsd_brand_info = { Modified: stable/8/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/8/sys/amd64/linux32/linux32_sysvec.c Wed Jun 8 03:02:11 2011 (r222845) +++ stable/8/sys/amd64/linux32/linux32_sysvec.c Wed Jun 8 03:45:40 2011 (r222846) @@ -128,7 +128,6 @@ static void linux32_fixlimit(struct rlim static boolean_t linux32_trans_osrel(const Elf_Note *note, int32_t *osrel); static eventhandler_tag linux_exit_tag; -static eventhandler_tag linux_schedtail_tag; static eventhandler_tag linux_exec_tag; /* @@ -1073,6 +1072,7 @@ struct sysentvec elf_linux_sysvec = { .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = linux32_fetch_syscall_args, .sv_syscallnames = NULL, + .sv_schedtail = linux_schedtail, }; static char GNU_ABI_VENDOR[] = "GNU"; @@ -1166,8 +1166,6 @@ linux_elf_modevent(module_t mod, int typ mtx_init(&futex_mtx, "ftllk", NULL, MTX_DEF); linux_exit_tag = EVENTHANDLER_REGISTER(process_exit, linux_proc_exit, NULL, 1000); - linux_schedtail_tag = EVENTHANDLER_REGISTER(schedtail, - linux_schedtail, NULL, 1000); linux_exec_tag = EVENTHANDLER_REGISTER(process_exec, linux_proc_exec, NULL, 1000); linux_szplatform = roundup(strlen(linux_platform) + 1, @@ -1199,7 +1197,6 @@ linux_elf_modevent(module_t mod, int typ sx_destroy(&emul_shared_lock); mtx_destroy(&futex_mtx); EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag); - EVENTHANDLER_DEREGISTER(schedtail, linux_schedtail_tag); EVENTHANDLER_DEREGISTER(process_exec, linux_exec_tag); linux_osd_jail_deregister(); if (bootverbose) Modified: stable/8/sys/arm/arm/elf_machdep.c ============================================================================== --- stable/8/sys/arm/arm/elf_machdep.c Wed Jun 8 03:02:11 2011 (r222845) +++ stable/8/sys/arm/arm/elf_machdep.c Wed Jun 8 03:45:40 2011 (r222846) @@ -78,6 +78,7 @@ struct sysentvec elf32_freebsd_sysvec = .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = NULL, /* XXXKIB */ .sv_syscallnames = syscallnames, + .sv_schedtail = NULL, }; static Elf32_Brandinfo freebsd_brand_info = { Modified: stable/8/sys/compat/ia32/ia32_sysvec.c ============================================================================== --- stable/8/sys/compat/ia32/ia32_sysvec.c Wed Jun 8 03:02:11 2011 (r222845) +++ stable/8/sys/compat/ia32/ia32_sysvec.c Wed Jun 8 03:45:40 2011 (r222846) @@ -141,6 +141,7 @@ struct sysentvec ia32_freebsd_sysvec = { .sv_set_syscall_retval = ia32_set_syscall_retval, .sv_fetch_syscall_args = ia32_fetch_syscall_args, .sv_syscallnames = freebsd32_syscallnames, + .sv_schedtail = NULL, }; Modified: stable/8/sys/compat/linux/linux_emul.c ============================================================================== --- stable/8/sys/compat/linux/linux_emul.c Wed Jun 8 03:02:11 2011 (r222845) +++ stable/8/sys/compat/linux/linux_emul.c Wed Jun 8 03:45:40 2011 (r222846) @@ -300,14 +300,14 @@ linux_proc_exec(void *arg __unused, stru } void -linux_schedtail(void *arg __unused, struct proc *p) +linux_schedtail(struct thread *td) { struct linux_emuldata *em; + struct proc *p; int error = 0; int *child_set_tid; - if (__predict_true(p->p_sysent != &elf_linux_sysvec)) - return; + p = td->td_proc; /* find the emuldata */ em = em_find(p, EMUL_DOLOCK); Modified: stable/8/sys/compat/linux/linux_emul.h ============================================================================== --- stable/8/sys/compat/linux/linux_emul.h Wed Jun 8 03:02:11 2011 (r222845) +++ stable/8/sys/compat/linux/linux_emul.h Wed Jun 8 03:45:40 2011 (r222846) @@ -82,7 +82,7 @@ struct linux_emuldata *em_find(struct pr int linux_proc_init(struct thread *, pid_t, int); void linux_proc_exit(void *, struct proc *); -void linux_schedtail(void *, struct proc *); +void linux_schedtail(struct thread *); void linux_proc_exec(void *, struct proc *, struct image_params *); void linux_kill_threads(struct thread *, int); Modified: stable/8/sys/compat/svr4/svr4_sysvec.c ============================================================================== --- stable/8/sys/compat/svr4/svr4_sysvec.c Wed Jun 8 03:02:11 2011 (r222845) +++ stable/8/sys/compat/svr4/svr4_sysvec.c Wed Jun 8 03:45:40 2011 (r222846) @@ -195,6 +195,7 @@ struct sysentvec svr4_sysvec = { .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = NULL, + .sv_schedtail = NULL, }; const char svr4_emul_path[] = "/compat/svr4"; Modified: stable/8/sys/i386/i386/elf_machdep.c ============================================================================== --- stable/8/sys/i386/i386/elf_machdep.c Wed Jun 8 03:02:11 2011 (r222845) +++ stable/8/sys/i386/i386/elf_machdep.c Wed Jun 8 03:45:40 2011 (r222846) @@ -78,6 +78,7 @@ struct sysentvec elf32_freebsd_sysvec = .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, + .sv_schedtail = NULL, }; static Elf32_Brandinfo freebsd_brand_info = { Modified: stable/8/sys/i386/ibcs2/ibcs2_sysvec.c ============================================================================== --- stable/8/sys/i386/ibcs2/ibcs2_sysvec.c Wed Jun 8 03:02:11 2011 (r222845) +++ stable/8/sys/i386/ibcs2/ibcs2_sysvec.c Wed Jun 8 03:45:40 2011 (r222846) @@ -90,6 +90,7 @@ struct sysentvec ibcs2_svr3_sysvec = { .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = NULL, + .sv_schedtail = NULL, }; static int Modified: stable/8/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/8/sys/i386/linux/linux_sysvec.c Wed Jun 8 03:02:11 2011 (r222845) +++ stable/8/sys/i386/linux/linux_sysvec.c Wed Jun 8 03:45:40 2011 (r222846) @@ -112,7 +112,6 @@ static int linux_szplatform; const char *linux_platform; static eventhandler_tag linux_exit_tag; -static eventhandler_tag linux_schedtail_tag; static eventhandler_tag linux_exec_tag; /* @@ -1004,6 +1003,7 @@ struct sysentvec linux_sysvec = { .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = linux_fetch_syscall_args, .sv_syscallnames = NULL, + .sv_schedtail = linux_schedtail, }; struct sysentvec elf_linux_sysvec = { @@ -1038,6 +1038,7 @@ struct sysentvec elf_linux_sysvec = { .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = linux_fetch_syscall_args, .sv_syscallnames = NULL, + .sv_schedtail = linux_schedtail, }; static char GNU_ABI_VENDOR[] = "GNU"; @@ -1131,8 +1132,6 @@ linux_elf_modevent(module_t mod, int typ mtx_init(&futex_mtx, "ftllk", NULL, MTX_DEF); linux_exit_tag = EVENTHANDLER_REGISTER(process_exit, linux_proc_exit, NULL, 1000); - linux_schedtail_tag = EVENTHANDLER_REGISTER(schedtail, linux_schedtail, - NULL, 1000); linux_exec_tag = EVENTHANDLER_REGISTER(process_exec, linux_proc_exec, NULL, 1000); linux_get_machine(&linux_platform); @@ -1165,7 +1164,6 @@ linux_elf_modevent(module_t mod, int typ sx_destroy(&emul_shared_lock); mtx_destroy(&futex_mtx); EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag); - EVENTHANDLER_DEREGISTER(schedtail, linux_schedtail_tag); EVENTHANDLER_DEREGISTER(process_exec, linux_exec_tag); linux_osd_jail_deregister(); if (bootverbose) Modified: stable/8/sys/ia64/ia64/elf_machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/elf_machdep.c Wed Jun 8 03:02:11 2011 (r222845) +++ stable/8/sys/ia64/ia64/elf_machdep.c Wed Jun 8 03:45:40 2011 (r222846) @@ -85,6 +85,7 @@ struct sysentvec elf64_freebsd_sysvec = .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, + .sv_schedtail = NULL, }; static Elf64_Brandinfo freebsd_brand_info = { Modified: stable/8/sys/kern/imgact_aout.c ============================================================================== --- stable/8/sys/kern/imgact_aout.c Wed Jun 8 03:02:11 2011 (r222845) +++ stable/8/sys/kern/imgact_aout.c Wed Jun 8 03:45:40 2011 (r222846) @@ -93,6 +93,7 @@ struct sysentvec aout_sysvec = { .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, + .sv_schedtail = NULL, }; static int Modified: stable/8/sys/kern/init_main.c ============================================================================== --- stable/8/sys/kern/init_main.c Wed Jun 8 03:02:11 2011 (r222845) +++ stable/8/sys/kern/init_main.c Wed Jun 8 03:45:40 2011 (r222846) @@ -375,6 +375,7 @@ struct sysentvec null_sysvec = { .sv_set_syscall_retval = null_set_syscall_retval, .sv_fetch_syscall_args = null_fetch_syscall_args, .sv_syscallnames = NULL, + .sv_schedtail = NULL, }; /* Modified: stable/8/sys/kern/kern_fork.c ============================================================================== --- stable/8/sys/kern/kern_fork.c Wed Jun 8 03:02:11 2011 (r222845) +++ stable/8/sys/kern/kern_fork.c Wed Jun 8 03:45:40 2011 (r222846) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -870,7 +871,8 @@ fork_exit(callout, arg, frame) } mtx_assert(&Giant, MA_NOTOWNED); - EVENTHANDLER_INVOKE(schedtail, p); + if (p->p_sysent->sv_schedtail != NULL) + (p->p_sysent->sv_schedtail)(td); } /* Modified: stable/8/sys/mips/mips/elf64_machdep.c ============================================================================== --- stable/8/sys/mips/mips/elf64_machdep.c Wed Jun 8 03:02:11 2011 (r222845) +++ stable/8/sys/mips/mips/elf64_machdep.c Wed Jun 8 03:45:40 2011 (r222846) @@ -82,6 +82,7 @@ struct sysentvec elf64_freebsd_sysvec = .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = NULL, /* XXXKIB */ .sv_syscallnames = NULL, + .sv_schedtail = NULL, }; static Elf64_Brandinfo freebsd_brand_gnutools_info64 = { Modified: stable/8/sys/mips/mips/elf_machdep.c ============================================================================== --- stable/8/sys/mips/mips/elf_machdep.c Wed Jun 8 03:02:11 2011 (r222845) +++ stable/8/sys/mips/mips/elf_machdep.c Wed Jun 8 03:45:40 2011 (r222846) @@ -79,6 +79,7 @@ struct sysentvec elf64_freebsd_sysvec = .sv_fixlimit = NULL, .sv_maxssiz = NULL, .sv_flags = SV_ABI_FREEBSD | SV_LP64 + .sv_schedtail = NULL, }; static Elf64_Brandinfo freebsd_brand_info = { @@ -134,6 +135,7 @@ struct sysentvec elf32_freebsd_sysvec = .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = NULL, /* XXXKIB */ .sv_syscallnames = syscallnames, + .sv_schedtail = NULL, }; static Elf32_Brandinfo freebsd_brand_info = { Modified: stable/8/sys/powerpc/powerpc/elf_machdep.c ============================================================================== --- stable/8/sys/powerpc/powerpc/elf_machdep.c Wed Jun 8 03:02:11 2011 (r222845) +++ stable/8/sys/powerpc/powerpc/elf_machdep.c Wed Jun 8 03:45:40 2011 (r222846) @@ -80,6 +80,7 @@ struct sysentvec elf32_freebsd_sysvec = .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, + .sv_schedtail = NULL, }; static Elf32_Brandinfo freebsd_brand_info = { Modified: stable/8/sys/sparc64/sparc64/elf_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/elf_machdep.c Wed Jun 8 03:02:11 2011 (r222845) +++ stable/8/sys/sparc64/sparc64/elf_machdep.c Wed Jun 8 03:45:40 2011 (r222846) @@ -86,6 +86,7 @@ static struct sysentvec elf64_freebsd_sy .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, + .sv_schedtail = NULL, }; static Elf64_Brandinfo freebsd_brand_info = { Modified: stable/8/sys/sys/eventhandler.h ============================================================================== --- stable/8/sys/sys/eventhandler.h Wed Jun 8 03:02:11 2011 (r222845) +++ stable/8/sys/sys/eventhandler.h Wed Jun 8 03:45:40 2011 (r222846) @@ -237,6 +237,4 @@ typedef void (*uma_zone_chfn)(void *); EVENTHANDLER_DECLARE(nmbclusters_change, uma_zone_chfn); EVENTHANDLER_DECLARE(maxsockets_change, uma_zone_chfn); -typedef void(*schedtail_fn)(void *, struct proc *); -EVENTHANDLER_DECLARE(schedtail, schedtail_fn); #endif /* SYS_EVENTHANDLER_H */ Modified: stable/8/sys/sys/param.h ============================================================================== --- stable/8/sys/sys/param.h Wed Jun 8 03:02:11 2011 (r222845) +++ stable/8/sys/sys/param.h Wed Jun 8 03:45:40 2011 (r222846) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 802507 /* Master, propagated to newvers */ +#define __FreeBSD_version 802508 /* Master, propagated to newvers */ #ifdef _KERNEL #define P_OSREL_SIGSEGV 700004 Modified: stable/8/sys/sys/sysent.h ============================================================================== --- stable/8/sys/sys/sysent.h Wed Jun 8 03:02:11 2011 (r222845) +++ stable/8/sys/sys/sysent.h Wed Jun 8 03:45:40 2011 (r222846) @@ -108,6 +108,7 @@ struct sysentvec { int (*sv_fetch_syscall_args)(struct thread *, struct syscall_args *); const char **sv_syscallnames; + void (*sv_schedtail)(struct thread *); }; #define SV_ILP32 0x000100