]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Use sf_buf_alloc() instead of vm_map_find() on exec_map to create the
authorAlan Cox <alc@FreeBSD.org>
Fri, 16 Dec 2005 18:34:14 +0000 (18:34 +0000)
committerAlan Cox <alc@FreeBSD.org>
Fri, 16 Dec 2005 18:34:14 +0000 (18:34 +0000)
commitda61b9a69efce729d27cb9882c32c74d01cfebf0
treeaa11bb9f1f197a97830817243044264d50c17670
parent6ba9ec2d090f762965de08dfc0dcbe0f6a19145d
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.

Problem uncovered by: kris@
Reviewed by: tegge@
MFC after: 3 weeks
sys/kern/imgact_elf.c
sys/vm/vm_extern.h
sys/vm/vm_glue.c