freebsd-src/sys/kern
Alan Cox 9e4e511499 Change the order in which the file name, arguments, environment, and
shell command are stored in exec*()'s demand-paged string buffer.  For
a "buildworld" on an 8GB amd64 multiprocessor, the new order reduces
the number of global TLB shootdowns by 31%.  It also eliminates about
330k page faults on the kernel address space.

Change exec_shell_imgact() to use "args->begin_argv" consistently as
the start of the argument and environment strings.  Previously, it
would sometimes use "args->buf", which is the start of the overall
buffer, but no longer the start of the argument and environment
strings.  While I'm here, eliminate unnecessary passing of "&length"
to copystr(), where we don't actually care about the length of the
copied string.

Clean up the initialization of the exec map.  In particular, use the
correct size for an entry, and express that size in the same way that
is used when an entry is allocated.  The old size was one page too
large.  (This discrepancy originated in 2004 when I rewrote
exec_map_first_page() to use sf_buf_alloc() instead of the exec map
for mapping the first page of the executable.)

Reviewed by:	kib
2010-07-25 17:43:38 +00:00
..
bus_if.m Virtualize pci_remap_msi_irq() call from general MSI code. It allows MSI 2010-06-14 07:10:37 +00:00
clock_if.m
cpufreq_if.m
device_if.m
genassym.sh
imgact_aout.c Reorganize syscall entry and leave handling. 2010-05-23 18:32:02 +00:00
imgact_elf.c Don't leak core_buf or gzfile if doing a compressed core file and we 2010-04-30 03:13:24 +00:00
imgact_elf32.c
imgact_elf64.c
imgact_gzip.c
imgact_shell.c Change the order in which the file name, arguments, environment, and 2010-07-25 17:43:38 +00:00
inflate.c
init_main.c Remove spurious '/*-' marks and fix some other style problems. 2010-07-22 05:42:29 +00:00
init_sysent.c Regenerate 2010-06-28 18:17:21 +00:00
kern_acct.c Use ISO C99 integer types in sys/kern where possible. 2010-06-21 09:55:56 +00:00
kern_alq.c - Rework the underlying ALQ storage to be a circular buffer, which amongst other 2010-04-26 13:48:22 +00:00
kern_clock.c - Simplify logic in handling ticks wrap-up 2010-07-07 12:00:11 +00:00
kern_clocksource.c Fix several un-/signedness bugs of r210290 and r210293. Add one more check. 2010-07-20 15:48:29 +00:00
kern_condvar.c
kern_conf.c Remove the unit argument from the recently added make_dev_p(). 2010-06-17 08:49:31 +00:00
kern_cons.c Allow multiple console devices per driver without insane code duplication. 2009-08-24 10:53:30 +00:00
kern_context.c Move prototypes for kern_sigtimedwait() and kern_sigprocmask() to 2010-06-30 18:03:42 +00:00
kern_cpu.c cpufreq: allocate long-lived buffer for handling of sysctl requests 2010-07-23 16:46:42 +00:00
kern_cpuset.c Another nit that both I and ispell missed. 2009-10-26 18:32:06 +00:00
kern_ctf.c
kern_descrip.c Remove one zero from the double-0. 2010-04-23 14:32:58 +00:00
kern_dtrace.c
kern_environment.c Merge change r198561 from projects/mips to head: 2010-01-10 22:34:18 +00:00
kern_et.c Use proper sysctl type (quad) for et_frequency. It fixes output on sparc64. 2010-07-21 12:23:49 +00:00
kern_event.c Defer freeing a kevent list until after dropping kqueue locks. 2010-03-30 18:31:55 +00:00
kern_exec.c Change the order in which the file name, arguments, environment, and 2010-07-25 17:43:38 +00:00
kern_exit.c Tweak the in-kernel API for sending signals to threads: 2010-06-29 20:41:52 +00:00
kern_fail.c Remove extraneous semicolons, no functional changes. 2010-01-07 21:01:37 +00:00
kern_fork.c Reintroduce the r196640, after fixing the problem with my testing. 2009-09-01 11:41:51 +00:00
kern_gzio.c Do not set IO_NODELOCKED while writing to vnodes as our consumers 2010-04-30 03:10:53 +00:00
kern_idle.c Split P_NOLOAD into a per-thread flag (TDF_NOLOAD). 2009-11-03 16:46:52 +00:00
kern_intr.c Store interrupt trap frame into struct thread. It allows interrupt handler 2010-06-10 16:14:05 +00:00
kern_jail.c Declare ip6 as (struct in6_addr *) instead of (struct in_addr *). This is 2010-06-04 14:38:24 +00:00
kern_kthread.c Allow a const char * to be passed as the process name to kproc_kthread_add() 2010-05-21 17:14:36 +00:00
kern_ktr.c Probabilly defaulting to KTR_GEN is not the right decision when KTR_MASK 2010-07-21 10:14:04 +00:00
kern_ktrace.c - Document layout of KTR_STRUCT payload in a comment. 2010-07-14 17:38:01 +00:00
kern_linker.c - Unbreak build with KLD_DEBUG defined 2009-11-17 21:56:12 +00:00
kern_lock.c Fix typos. 2010-01-07 01:24:09 +00:00
kern_lockf.c
kern_lockstat.c
kern_malloc.c Use ISO C99 integer types in sys/kern where possible. 2010-06-21 09:55:56 +00:00
kern_mbuf.c Use ISO C99 integer types in sys/kern where possible. 2010-06-21 09:55:56 +00:00
kern_mib.c When compat32 binary asks for the value of hw.machine_arch, report the 2010-07-22 09:13:49 +00:00
kern_module.c Use ISO C99 integer types in sys/kern where possible. 2010-06-21 09:55:56 +00:00
kern_mtxpool.c
kern_mutex.c Right now, WITNESS just blindly pipes all the output to the 2010-05-11 18:24:22 +00:00
kern_ntptime.c kern_ntptime: drop a comment that became stale after r207359 2010-04-29 09:18:36 +00:00
kern_osd.c
kern_physio.c
kern_pmc.c
kern_poll.c Rather than fix questionable ifnet list locking in the implementation of 2009-08-15 23:07:43 +00:00
kern_priv.c
kern_proc.c Add the support for reporting the NOCOREDUMP flag from 2010-05-27 08:10:12 +00:00
kern_prot.c Revert r210225 - turns out I was wrong; the "/*-" is not license-only 2010-07-18 20:57:53 +00:00
kern_resource.c Revert r210225 - turns out I was wrong; the "/*-" is not license-only 2010-07-18 20:57:53 +00:00
kern_rmlock.c Remove extra spaces (no functional change). 2009-12-25 21:14:05 +00:00
kern_rwlock.c Print the pointer to the lock with the panic message. The previous 2010-03-24 19:21:26 +00:00
kern_sdt.c Use ISO C99 integer types in sys/kern where possible. 2010-06-21 09:55:56 +00:00
kern_sema.c
kern_shutdown.c Fix compilation in the !SMP case. 2010-04-20 12:22:06 +00:00
kern_sig.c Fix function name in error messages. 2010-07-20 02:23:12 +00:00
kern_switch.c Update several places that iterate over CPUs to use CPU_FOREACH(). 2010-06-11 18:46:34 +00:00
kern_sx.c Fix a sign bug that caused adaptive spinning in sx_xlock() to not work 2010-06-08 16:17:47 +00:00
kern_synch.c Add new msleep(9) flag PBDY that shall be specified together with 2009-07-14 22:52:46 +00:00
kern_syscalls.c Count number of threads that enter and leave dynamically registered 2010-06-28 18:06:46 +00:00
kern_sysctl.c Make it possible to change the vnet sysctl variables on jails 2009-08-13 10:26:34 +00:00
kern_tc.c Revert r210225 - turns out I was wrong; the "/*-" is not license-only 2010-07-18 20:57:53 +00:00
kern_thr.c Tweak the in-kernel API for sending signals to threads: 2010-06-29 20:41:52 +00:00
kern_thread.c Retire td_syscalls now that it is no longer needed. 2010-07-15 20:24:37 +00:00
kern_time.c
kern_timeout.c Update several places that iterate over CPUs to use CPU_FOREACH(). 2010-06-11 18:46:34 +00:00
kern_umtx.c Use ISO C99 integer types in sys/kern where possible. 2010-06-21 09:55:56 +00:00
kern_uuid.c Rework global locks for interface list and index management, correcting 2009-08-23 20:40:19 +00:00
kern_xxx.c
ksched.c sched_getparam was just plain broke for time-share 2010-03-03 21:46:51 +00:00
link_elf.c Build on Jeff Roberson's linker-set based dynamic per-CPU allocator 2009-07-14 22:48:30 +00:00
link_elf_obj.c completely ignore zero-sized elf sections in modules of elf object type (amd64) 2010-07-23 17:07:51 +00:00
linker_if.m
Make.tags.inc
Makefile
makesyscalls.sh Count number of threads that enter and leave dynamically registered 2010-06-28 18:06:46 +00:00
md4c.c
md5c.c
p1003_1b.c
posix4_mib.c Add a facility to dynamically adjust or unconfigure p1003_1b mib. 2010-06-02 09:59:05 +00:00
sched_4bsd.c Update several places that iterate over CPUs to use CPU_FOREACH(). 2010-06-11 18:46:34 +00:00
sched_ule.c A cosmetic change - don't output empty <flags>. 2010-07-15 13:46:30 +00:00
serdev_if.m
stack_protector.c Random number generator initialization cleanup: 2009-10-20 16:36:51 +00:00
subr_acl_nfs4.c The acl_cnt field is unsigned; no point in checking if it's >= 0. 2010-06-03 13:41:55 +00:00
subr_acl_posix1e.c The 'acl_cnt' field is unsigned; no point in checking if it's >= 0. 2010-06-03 13:43:58 +00:00
subr_autoconf.c
subr_blist.c
subr_bufring.c Switch to our preferred 2-clause BSD license. 2010-05-05 20:39:02 +00:00
subr_bus.c Use ISO C99 integer types in sys/kern where possible. 2010-06-21 09:55:56 +00:00
subr_clock.c
subr_devstat.c Use ISO C99 integer types in sys/kern where possible. 2010-06-21 09:55:56 +00:00
subr_disk.c Revert r210225 - turns out I was wrong; the "/*-" is not license-only 2010-07-18 20:57:53 +00:00
subr_eventhandler.c Split eventhandler_register() into an internal part and a wrapper function 2010-03-19 19:51:03 +00:00
subr_fattime.c Use ISO C99 integer types in sys/kern where possible. 2010-06-21 09:55:56 +00:00
subr_firmware.c Bump up the firmware_table from 30 to 50. bwn needs more than 30, it 2010-03-07 22:37:35 +00:00
subr_hash.c Decompose the most lousy named file in sys/kern; kern_subr.c. 2010-02-21 19:53:33 +00:00
subr_hints.c
subr_kdb.c fix a few cases where a string is passed via format argument instead of 2010-06-11 19:27:21 +00:00
subr_kobj.c
subr_lock.c Use ISO C99 integer types in sys/kern where possible. 2010-06-21 09:55:56 +00:00
subr_log.c Make /dev/klog and kern.msgbuf* MPSAFE. 2009-11-03 21:06:19 +00:00
subr_mbpool.c
subr_mchain.c Use ISO C99 integer types in sys/kern where possible. 2010-06-21 09:55:56 +00:00
subr_module.c Use ISO C99 integer types in sys/kern where possible. 2010-06-21 09:55:56 +00:00
subr_msgbuf.c
subr_param.c Reverse the logic of the if statement that sets the default value of 2010-06-24 00:27:20 +00:00
subr_pcpu.c Update several places that iterate over CPUs to use CPU_FOREACH(). 2010-06-11 18:46:34 +00:00
subr_power.c
subr_prf.c Use type-specific inline function imax() instead of deprecated macro MAX(). 2010-07-12 15:32:45 +00:00
subr_prof.c Revert r210225 - turns out I was wrong; the "/*-" is not license-only 2010-07-18 20:57:53 +00:00
subr_rman.c
subr_rtc.c
subr_sbuf.c
subr_scanf.c
subr_sglist.c This patch fixes two bugs in sglist(9) and improves robustness of the API via 2009-08-21 02:59:07 +00:00
subr_sleepqueue.c Update comment for tdsignal() -> tdsendsignal() rename. Forgot to include 2010-06-30 18:00:45 +00:00
subr_smp.c Update several places that iterate over CPUs to use CPU_FOREACH(). 2010-06-11 18:46:34 +00:00
subr_stack.c
subr_taskqueue.c Remove unused variable that snuck in during development. 2010-07-22 17:23:43 +00:00
subr_trap.c Retire td_syscalls now that it is no longer needed. 2010-07-15 20:24:37 +00:00
subr_turnstile.c Introduce the new kernel thread called "deadlock resolver". 2010-01-09 01:46:38 +00:00
subr_uio.c Push down the page queues into vm_page_cache(), vm_page_try_to_cache(), and 2010-05-08 20:34:01 +00:00
subr_unit.c Remove redundant high >= 0. 2010-07-09 10:57:55 +00:00
subr_witness.c "time lock" is no longer a spin-lock since r209371. 2010-06-21 21:15:51 +00:00
sys_generic.c Send SIGPIPE to the thread that issued the offending system call 2010-06-29 20:44:19 +00:00
sys_pipe.c Update a comment: It no longer makes sense to talk about the page queues 2010-05-08 23:01:47 +00:00
sys_process.c Extend ptrace(PT_LWPINFO) to report siginfo for the signal that caused 2010-07-04 11:48:30 +00:00
sys_socket.c Send SIGPIPE to the thread that issued the offending system call 2010-06-29 20:44:19 +00:00
syscalls.c Regenerate 2010-06-28 18:17:21 +00:00
syscalls.master Count number of threads that enter and leave dynamically registered 2010-06-28 18:06:46 +00:00
systrace_args.c Use ISO C99 integer types in sys/kern where possible. 2010-06-21 09:55:56 +00:00
sysv_ipc.c Move SysV IPC freebsd32 compat shims helpers from freebsd32_misc.c to 2010-03-19 11:01:51 +00:00
sysv_msg.c Move SysV IPC freebsd32 compat shims from freebsd32_misc.c to corresponding 2010-03-19 11:04:42 +00:00
sysv_sem.c In another move to join with the age of the Fruitbat, increase SYSV 2010-06-11 09:27:33 +00:00
sysv_shm.c If i is going to be used in the loop unconditionally the declaration 2010-06-29 01:04:24 +00:00
tty.c Fix a race condition, where a TTY could be destroyed twice. 2010-07-06 08:56:34 +00:00
tty_compat.c Make TIOCSTI work again. 2010-01-04 20:59:52 +00:00
tty_info.c
tty_inq.c Remove statistics from the TTY queues. 2010-02-07 15:42:15 +00:00
tty_outq.c Remove statistics from the TTY queues. 2010-02-07 15:42:15 +00:00
tty_pts.c Do not leak master pty or ptmx vnode. 2010-04-08 08:58:18 +00:00
tty_tty.c
tty_ttydisc.c Print backspaces after echoing an EOF. 2009-10-17 08:59:41 +00:00
uipc_accf.c (S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument. 2009-12-28 22:56:30 +00:00
uipc_cow.c Remove page queues locking from all sf_buf_mext()-like functions. The page 2010-05-06 17:43:41 +00:00
uipc_debug.c
uipc_domain.c When registering a protocol to an existing protocol domain via 2009-08-24 10:03:41 +00:00
uipc_mbuf.c Revert r210225 - turns out I was wrong; the "/*-" is not license-only 2010-07-18 20:57:53 +00:00
uipc_mbuf2.c Use ISO C99 integer types in sys/kern where possible. 2010-06-21 09:55:56 +00:00
uipc_mqueue.c Use ISO C99 integer types in sys/kern where possible. 2010-06-21 09:55:56 +00:00
uipc_sem.c Add a facility to dynamically adjust or unconfigure p1003_1b mib. 2010-06-02 09:59:05 +00:00
uipc_shm.c Minimize the use of the page queues lock for synchronizing access to the 2010-06-02 15:46:37 +00:00
uipc_sockbuf.c
uipc_socket.c When close() is called on a connected socket pair, SO_ISCONNECTED might be 2010-05-27 15:27:31 +00:00
uipc_syscalls.c Send SIGPIPE to the thread that issued the offending system call 2010-06-29 20:44:19 +00:00
uipc_usrreq.c Remove spurious '/*-' marks and fix some other style problems. 2010-07-22 05:42:29 +00:00
vfs_acl.c The 'acl_cnt' field is unsigned; no point in checking if it's >= 0. 2010-06-03 13:45:27 +00:00
vfs_aio.c Convert aio syscall registration to SYSCALL_INIT_HELPER. 2010-03-19 11:11:34 +00:00
vfs_bio.c Make lorunningspace catch up with hirunningspace. 2010-07-23 12:30:29 +00:00
vfs_cache.c Use ISO C99 integer types in sys/kern where possible. 2010-06-21 09:55:56 +00:00
vfs_cluster.c
vfs_default.c Add VOP_ADVLOCKPURGE so that the file system is called when purging 2010-05-12 21:24:46 +00:00
vfs_export.c Set the prison in NFS anon and GSS SVC creds. 2009-09-28 18:07:16 +00:00
vfs_extattr.c Revert r210225 - turns out I was wrong; the "/*-" is not license-only 2010-07-18 20:57:53 +00:00
vfs_hash.c
vfs_init.c
vfs_lookup.c Support only LOOKUP operation for "/" in relookup() because lookup() 2010-03-26 11:33:12 +00:00
vfs_mount.c - Reduce scope of vnode lock. vfs_mount_alloc() doesn't need vnode to be 2010-02-18 22:22:45 +00:00
vfs_subr.c Use ISO C99 integer types in sys/kern where possible. 2010-06-21 09:55:56 +00:00
vfs_syscalls.c In revoke(), verify that VCHR vnode indeed belongs to devfs. 2010-07-06 18:20:49 +00:00
vfs_vnops.c Correct arguments order. 2010-06-26 21:44:45 +00:00
vnode_if.src Add VOP_ADVLOCKPURGE so that the file system is called when purging 2010-05-12 21:24:46 +00:00