Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Mar 2005 13:17:30 -0800
From:      "David G. Lawrence" <dg@dglawrence.com>
To:        Kris Kennaway <kris@FreeBSD.org>
Cc:        current@FreeBSD.org
Subject:   Re: SIGABRT under load (tracked to vm_map_find() returning KERN_NO_SPACE)
Message-ID:  <20050308211730.GO2308@opteron.dglawrence.com>
In-Reply-To: <20050308194832.GD30165@hub.freebsd.org>
References:  <20050308194832.GD30165@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> i.e. __elfN(load_section) is returning EINVAL.
> 
> I instrumented the three places this is possible in
> __elfN(load_section) and found the failure occurs here:
> 
>                 rv = vm_map_find(exec_map,

   Yeah, that's a bug. As Alan pointed out, exec_map is sized to limit the
total number of simultaneous execs to 16 in order to keep kernel memory
usage under control. You're hitting this size limit occasionally and the
code in imgact_elf.c isn't behaving correctly in this case (it should
block when there is no exec_map space).
   Unfortunately, I don't think you can use kmem_alloc_wait() to fix this
because the code relies on the mapping of the object page into the map, so
demand-zero space isn't what you want.
   A fix for this is going to need to vm_map_unlock_and_wait() and retry
in a loop like kmem_alloc_wait() does when there is no space. Patches left
as an exercise to the reader. :-)

-DG

David G. Lawrence
President
Download Technologies, Inc. - http://www.downloadtech.com - (866) 399 8500
TeraSolutions, Inc. - http://www.terasolutions.com - (888) 346 7175
The FreeBSD Project - http://www.freebsd.org
Pave the road of life with opportunities.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050308211730.GO2308>