From owner-freebsd-stable@FreeBSD.ORG Wed May 13 19:28:10 2009 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BAB21065693; Wed, 13 May 2009 19:28:10 +0000 (UTC) (envelope-from tijl@ulyssis.org) Received: from mailrelay012.isp.belgacom.be (mailrelay012.isp.belgacom.be [195.238.6.179]) by mx1.freebsd.org (Postfix) with ESMTP id D65A18FC18; Wed, 13 May 2009 19:28:09 +0000 (UTC) (envelope-from tijl@ulyssis.org) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkkFACe0CkpR927y/2dsb2JhbACBUM5JhAIF Received: from 242.110-247-81.adsl-dyn.isp.belgacom.be (HELO kalimero.kotnet.org) ([81.247.110.242]) by relay.skynet.be with ESMTP; 13 May 2009 20:58:26 +0200 Received: from kalimero.kotnet.org (kalimero.kotnet.org [127.0.0.1]) by kalimero.kotnet.org (8.14.3/8.14.3) with ESMTP id n4DIwQZV006056; Wed, 13 May 2009 20:58:26 +0200 (CEST) (envelope-from tijl@ulyssis.org) From: Tijl Coosemans To: freebsd-stable@freebsd.org, John Baldwin , dikshie Date: Wed, 13 May 2009 20:58:24 +0200 User-Agent: KMail/1.9.10 References: <910e60e80905130410h38a1dc70y23a26275dac51a31@mail.gmail.com> <200905131011.44391.jhb@freebsd.org> In-Reply-To: <200905131011.44391.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200905132058.25782.tijl@ulyssis.org> Cc: Subject: Re: maximum mmap() X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2009 19:28:11 -0000 On Wednesday 13 May 2009 16:11:44 John Baldwin wrote: > On Wednesday 13 May 2009 7:10:29 am dikshie wrote: >> i found that my rrdtool does not work with mmap() with rra files >> size more than 2GB. >> my question: on i386 arch, what's maximum size of file to be able >> to mmap() ? do i have to change from i386 to amd64? or added 4GB >> RAM? > > The amount of RAM is not the issue, it is the size of the virtual > address space. You can lower maxdsiz on i386 to leave more room for > mmap, and you can also change KVA_PAGES in the kernel to leave more > address space for userland than for the kernel perhaps, but you won't > get a whole lot more space that way (you might be able to map 2.5GB > or so). Moving to amd64 gives you a 64-bit virtual address space and > you will be able to easily mmap() much, much more than 4GB out of the > box. On a default i386 system it should be possible to mmap files larger then 2GiB, but for some reason mmap treats sizes above 0x7fffffff as an error and returns EINVAL: if ((ssize_t) uap->len < 0 || ((flags & MAP_ANON) && uap->fd != -1)) return (EINVAL); The only way around this is to mmap the entire file with two mmap calls.