From owner-cvs-all@FreeBSD.ORG Thu Mar 16 00:25:33 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 72C6416A422; Thu, 16 Mar 2006 00:25:33 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2205743D46; Thu, 16 Mar 2006 00:25:33 +0000 (GMT) (envelope-from alc@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k2G0PWQe006617; Thu, 16 Mar 2006 00:25:33 GMT (envelope-from alc@repoman.freebsd.org) Received: (from alc@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k2G0PWKZ006616; Thu, 16 Mar 2006 00:25:32 GMT (envelope-from alc) Message-Id: <200603160025.k2G0PWKZ006616@repoman.freebsd.org> From: Alan Cox Date: Thu, 16 Mar 2006 00:25:32 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: RELENG_6 Cc: Subject: cvs commit: src/sys/kern imgact_aout.c imgact_elf.c imgact_gzip.c src/sys/vm vm_extern.h vm_glue.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Mar 2006 00:25:33 -0000 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 Log: MFC File Revisions kern/imgact_aout.c 1.100 kern/imgact_elf.c 1.167-1.172, 1.175 kern/imgact_gzip.c 1.55 vm/vm_extern.h 1.77 vm/vm_glue.c 1.214 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 access. 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 elfN_load_section(). 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 circumstances. 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 1.99.2.1 +13 -2 src/sys/kern/imgact_aout.c 1.162.2.3 +97 -144 src/sys/kern/imgact_elf.c 1.54.2.1 +13 -0 src/sys/kern/imgact_gzip.c 1.76.2.1 +2 -0 src/sys/vm/vm_extern.h 1.213.2.1 +72 -0 src/sys/vm/vm_glue.c