From owner-freebsd-current@FreeBSD.ORG Thu Sep 23 13:21:55 2004 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 468C916A4CE for ; Thu, 23 Sep 2004 13:21:55 +0000 (GMT) Received: from dglawrence.com (c-24-21-223-117.client.comcast.net [24.21.223.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8C84D43D49 for ; Thu, 23 Sep 2004 13:21:54 +0000 (GMT) (envelope-from dg@nexus.dglawrence.com) Received: from nexus.dglawrence.com (localhost [127.0.0.1]) by dglawrence.com (8.12.10/8.12.6) with ESMTP id i8NCQKrW013240; Thu, 23 Sep 2004 05:26:20 -0700 (PDT) (envelope-from dg@nexus.dglawrence.com) Received: (from dg@localhost) by nexus.dglawrence.com (8.12.10/8.12.3/Submit) id i8NCQKpo013239; Thu, 23 Sep 2004 05:26:20 -0700 (PDT) Date: Thu, 23 Sep 2004 05:26:20 -0700 From: "David G. Lawrence" To: Juha Saarinen Message-ID: <20040923122620.GW16205@nexus.dglawrence.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: cc: freebsd-current@freebsd.org Subject: Re: Could ARG_MAX be increased? 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: Thu, 23 Sep 2004 13:21:55 -0000 > Currently, ARG_MAX is set to: > > $ getconf ARG_MAX > 65536 > > in syslimits.h. This is quite low compared to other OS (SunOS has 1MB > IIRC, and OpenBSD 3.5 256K) and causes the "argument list too long" > issues when for instance grep'ing in directories with lots of files. > > Last time the limit was upped was ten years ago: > > "Revision 1.4 / (download) - annotate - [select for diffs], Mon Aug 8 > 09:12:43 1994 UTC (10 years, 1 month ago) by davidg > Branch: MAIN > Changes since 1.3: +2 -2 lines > Diff to previous 1.3 (colored) > > Increased ARG_MAX even further...to 64k bytes." > > Is there a reason for keeping ARG_MAX so low, or could it be increased > to eg. 262,144 bytes? I feel compelled to respond since you mentioned me above and since I wrote most of the code involved... :-) The main issue with increasing the size of ARG_MAX is that it will result in more kernel virtual memory being reserved for temporary storage of the args. This used to be a much larger problem when KVM was scarce, but less of a problem now with 1GB or more of KVM. The args temporary space is allocated out of exec_map (a submap of kernel_map), which is sized to be about 16 * ARG_MAX. The '16' is to allow up to 16 processes to simultaneously exec until additional execs are blocked waiting for KVM to become available. Anyway, increasing ARG_MAX to 256K (roughly 4MB of KVM) should be okay on most systems. -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.