From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 11 10:05:55 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF634106566B for ; Tue, 11 Oct 2011 10:05:55 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 3702A8FC0C for ; Tue, 11 Oct 2011 10:05:55 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RDZDd-0002YV-8C for freebsd-hackers@freebsd.org; Tue, 11 Oct 2011 12:05:53 +0200 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 11 Oct 2011 12:05:53 +0200 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 11 Oct 2011 12:05:53 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Date: Tue, 11 Oct 2011 12:05:39 +0200 Lines: 56 Message-ID: References: <20111006160159.GQ1511@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig275D6CCC01AF46E6D4CD92E6" X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111004 Thunderbird/7.0.1 In-Reply-To: X-Enigmail-Version: 1.1.2 Subject: Re: mmap performance and memory use 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: Tue, 11 Oct 2011 10:05:55 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig275D6CCC01AF46E6D4CD92E6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/10/2011 19:13, Alan Cox wrote: > On Thu, Oct 6, 2011 at 11:01 AM, Kostik Belousov w= rote: >> For one thing, this indeed causes more memory use for the OS. This is >> somewhat mitigated by automatic use of superpages. Superpage promotion= >> still keeps the 4KB page table around, so most savings from the >> superpages are due to more efficient use of TLB. >> >> > You are correct about the page table page. However, a superpage mappin= g > consumes a single PV entry, in place of 512 or 1024 PV entries. This w= inds > up saving about three physical pages worth of memory for every superpag= e > mapping. But wouldn't the "conservative" superpages policy make it difficult in the OPs case to ever get promotions to superpages if he's touching pages almost randomly? > Similarly, mmap(..., MAP_PREFAULT_READ) on a large, memory resident fil= e may pre-map the file using superpage mappings.=20 grep doesn't find this symbol in the sys src tree in 8-STABLE - nor it seems in /usr/include. But anyway, is there a mechanism which gives more guarantees than "may" (i.e. which forces this) - or if not, how hard would it be to add one? Some Linux-based "enterprise" software (including Java) use Linux-specific calls to allocate large pages directly. --------------enig275D6CCC01AF46E6D4CD92E6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk6UFPMACgkQldnAQVacBcjZYgCguCpgO/ThrKRZW83MIhhncDps jkkAn0jcCgePAs5SOlPjJJjvmYkhm9FC =Nxox -----END PGP SIGNATURE----- --------------enig275D6CCC01AF46E6D4CD92E6--