cvs commit: src/sys/kern imgact_aout.c imgact_elf.c imgact_gzip.c
src/sys/vm vm_extern.h vm_glue.c
alc at FreeBSD.org
Thu Mar 16 00:25:33 UTC 2006
alc 2006-03-16 00:25:32 UTC
FreeBSD src repository
Modified files: (Branch: RELENG_6)
sys/kern imgact_aout.c imgact_elf.c imgact_gzip.c
sys/vm vm_extern.h vm_glue.c
kern/imgact_elf.c 1.167-1.172, 1.175
Use sf_buf_alloc() instead of vm_map_find() on exec_map to create
the ephemeral mappings that are used as the source for three copy
operations from kernel space to user space. There are two reasons
for making this change: (1) Under heavy load exec_map can fill up
causing vm_map_find() to fail. When it fails, the nascent process
is aborted (SIGABRT). Whereas, this reimplementation using
sf_buf_alloc() sleeps. (2) Although it is possible to sleep on
vm_map_find()'s failure until address space becomes available (see
kmem_alloc_wait()), using sf_buf_alloc() is faster. Furthermore,
the reimplementation uses a CPU private mapping, avoiding a TLB
shootdown on multiprocessors.
The second argument to vm_map_find() should be NULL instead of 0.
Correct a long-standing problem in elfN_map_insert(): In order to
copy a page to user space, the user space mapping must allow write
Eliminate an unneeded (vm_prot_t) parameter from two functions.
Eliminate unnecessary uses of a local variable.
Maintain the vnode lock throughout elfN_load_file() rather than
releasing it and reacquiring it in vrele(). Consequently, there is
no reason to increase the reference count on the vm object caching
the file's pages.
Eliminate unused parameters to elfN_load_file().
Maintain the lock on the vnode for most of exec_elfN_imgact().
Specifically, it is required for the I/O that may be performed by
Avoid an obscure deadlock in the a.out, elf, and gzip image
activators. Add a comment describing why the deadlock does not
occur in the common case and how it might occur in less usual
Eliminate an unused variable from exec_aout_imgact().
Avoid a vm object reference leak in a rarely used code path.
An executable contains at most one PT_INTERP program header.
Therefore, the loop that searches for it can terminate after it is
found rather than iterating over the entire set of program headers.
Eliminate an unneeded initialization.
Approved by: re (mux)
Revision Changes Path
22.214.171.124 +13 -2 src/sys/kern/imgact_aout.c
126.96.36.199 +97 -144 src/sys/kern/imgact_elf.c
188.8.131.52 +13 -0 src/sys/kern/imgact_gzip.c
184.108.40.206 +2 -0 src/sys/vm/vm_extern.h
220.127.116.11 +72 -0 src/sys/vm/vm_glue.c
More information about the cvs-src