From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 1 12:34:36 2015 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95A845DC for ; Wed, 1 Apr 2015 12:34:36 +0000 (UTC) Received: from mailuogwdur.emc.com (mailuogwdur.emc.com [128.221.224.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailuogwprd51.lss.emc.com", Issuer "RSA Corporate Server CA v2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 434BD781 for ; Wed, 1 Apr 2015 12:34:35 +0000 (UTC) Received: from maildlpprd56.lss.emc.com (maildlpprd56.lss.emc.com [10.106.48.160]) by mailuogwprd53.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id t31CYRuw028381 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 1 Apr 2015 08:34:32 -0400 X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd53.lss.emc.com t31CYRuw028381 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=isilon.com; s=jan2013; t=1427891674; bh=6cYeZs2bleX1ouk+4UZHbPW+p0U=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:Content-Transfer-Encoding:MIME-Version; b=m7n2NDBAkQ5bTxkp+v4ypLWUnFGCaxyjVyOrXVx6pwUTmK5bU3/d4kNfxXiRntvSp F9IbPGIuL6MjYIhMudyAaBznbvuAd5tIfxv3bpQnZ7PYKDWJ/jas3M9vBMhb7Al6aO iVPgR6w3ggFNoxKKcc7ZyovYRIZbQD85OUEbR1tg= X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd53.lss.emc.com t31CYRuw028381 Received: from mailusrhubprd51.lss.emc.com (mailusrhubprd51.lss.emc.com [10.106.48.24]) by maildlpprd56.lss.emc.com (RSA Interceptor); Wed, 1 Apr 2015 08:33:50 -0400 Received: from mxhub09.corp.emc.com (mxhub09.corp.emc.com [10.254.92.104]) by mailusrhubprd51.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id t31CYARp027043 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Wed, 1 Apr 2015 08:34:11 -0400 Received: from MXHUB101.corp.emc.com (10.253.50.15) by mxhub09.corp.emc.com (10.254.92.104) with Microsoft SMTP Server (TLS) id 8.3.327.1; Wed, 1 Apr 2015 08:32:49 -0400 Received: from MX103CL02.corp.emc.com ([169.254.6.202]) by MXHUB101.corp.emc.com ([::1]) with mapi id 14.03.0224.002; Wed, 1 Apr 2015 08:34:10 -0400 From: "Meyer, Conrad" To: Garrett Cooper , "Gumpula, Suresh" Subject: RE: BSD 8.1 and 9.1 memory increase Thread-Topic: BSD 8.1 and 9.1 memory increase Thread-Index: AQHQYN1kO9bXTk+QcE+8E2hd8pdV+Z0hK5sAgBZxt4CAADccAIAAWDtE Date: Wed, 1 Apr 2015 12:34:09 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.13.36.127] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Sentrion-Hostname: mailusrhubprd51.lss.emc.com X-RSA-Classifications: public Cc: "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2015 12:34:36 -0000 > On Mar 31, 2015, at 17:54, Gumpula, Suresh wr= ote:=0A= >=0A= > Still trying to find out the reason for more memory foot print on 9.1=0A= > compared to 8.1 .=0A= > Does some thing like clustering changes in page fault handling cause=0A= > memory foot print ?=0A= > https://svnweb.freebsd.org/base?view=3Drevision&revision=3D235876=0A= >=0A= > Copying Alan Cox , if could throw some inputs on this.=0A= =0A= Superpages and how FreeBSD does its best to put runtime libraries in superp= age-able comes to mind..=0A= =0A= The VMEM for libraries is what caught us off guard last year when dealing w= ith applications -- more libraries =3D=3D greater footprint past either 8.0= or 9.0 because of changes to VM/rtld.=0A= =0A= Conrad Meyer had a change out to reduce the footprint for libraries, but it= was racy/incomplete unfortunately :/..=0A= =0A= Hope that maybe helps...=0A= =0A= -----------------------------------=0A= =0A= Right. So the linker and RTLD map each binary segment with 2MB virtual page= s, because that way you only need one mapping / TLB entry per segment (or a= t least, up to 2MB... most libraries are much smaller than this). This is a= performance optimization. The discussion around unmapping unused portions = of the 2MB range can be found here: https://reviews.freebsd.org/D1263 .=0A= =0A= To summarize: larger-than-necessary superpage mappings affect only vmem acc= ounting; actually use less resources (PTE's and any additional per-PTE vm a= ccounting) than 4k pages; and use fewer TLB entries. Unmapping the unused p= ortions is useless even if you get it right.=0A= =0A= Are you actually seeing greater memory footprint, or just greater vmem foot= print? I don't actually use FreeBSD8 or 9.=0A= =0A= Cheers,=0A= Conrad=