From owner-freebsd-current@FreeBSD.ORG Tue Mar 8 21:17:33 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B42B516A4CE; Tue, 8 Mar 2005 21:17:33 +0000 (GMT) Received: from dglawrence.com (dsl-230-156.ipns.com [209.210.230.156]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3CA5C43D46; Tue, 8 Mar 2005 21:17:31 +0000 (GMT) (envelope-from dg@dglawrence.com) Received: from opteron.dglawrence.com (localhost [127.0.0.1]) by dglawrence.com (8.13.3/8.13.1) with ESMTP id j28LHU1t040443; Tue, 8 Mar 2005 13:17:30 -0800 (PST) (envelope-from dg@dglawrence.com) Received: (from dg@localhost) by opteron.dglawrence.com (8.13.3/8.13.1/Submit) id j28LHUXE040442; Tue, 8 Mar 2005 13:17:30 -0800 (PST) (envelope-from dg@dglawrence.com) Date: Tue, 8 Mar 2005 13:17:30 -0800 From: "David G. Lawrence" To: Kris Kennaway Message-ID: <20050308211730.GO2308@opteron.dglawrence.com> References: <20050308194832.GD30165@hub.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050308194832.GD30165@hub.freebsd.org> cc: alc@FreeBSD.org cc: current@FreeBSD.org Subject: Re: SIGABRT under load (tracked to vm_map_find() returning KERN_NO_SPACE) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2005 21:17:33 -0000 > 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.