From owner-freebsd-hackers@FreeBSD.ORG Mon Mar 12 10:33:14 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 76D0E16A402 for ; Mon, 12 Mar 2007 10:33:14 +0000 (UTC) (envelope-from citrin@citrin.ru) Received: from mail.classis.ru (classis.ru [213.248.60.120]) by mx1.freebsd.org (Postfix) with ESMTP id 3A9E713C457 for ; Mon, 12 Mar 2007 10:33:14 +0000 (UTC) (envelope-from citrin@citrin.ru) Received: from citrin (unknown [81.19.65.95]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: citrin.citrin.ru) by mail.classis.ru (Postfix) with ESMTP id 9FBA41227A80 for ; Mon, 12 Mar 2007 13:11:26 +0300 (MSK) Date: Mon, 12 Mar 2007 13:10:34 +0300 From: Anton Yuzhaninov X-Mailer: The Bat! (v3.62.14) Professional Organization: Rambler X-Priority: 3 (Normal) Message-ID: <782951585.20070312131034@citrin.ru> To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Why max mmap size limited to half of virtual address space? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2007 10:33:14 -0000 Hello, Why max mmap size limited to half virtual address space? On i386 it limited to 2 Gb: /sys/vm/vm_mmap.c /* make sure mapping fits into numeric range etc */ if ((ssize_t) uap->len < 0 || ((flags & MAP_ANON) && uap->fd != -1)) return (EINVAL); (ssize_t) uap->len < 0 limit maximum value for uap->len to SIZE_T_MAX/2 May be this check can be removed? It test it on FreeBSD 6.2 i386 - without this check a can map 2400 Mb file. Also mmap man page say, that 2 Gb limit was a documentation bug, but this limit still exist on i386. -- Anton Yuzhaninov.