From owner-freebsd-current Wed Sep 2 08:20:15 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA05478 for freebsd-current-outgoing; Wed, 2 Sep 1998 08:20:15 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from ns1.yes.no (ns1.yes.no [195.119.24.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA05471 for ; Wed, 2 Sep 1998 08:20:12 -0700 (PDT) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [195.204.143.218]) by ns1.yes.no (8.9.1a/8.9.1) with ESMTP id RAA18318; Wed, 2 Sep 1998 17:19:10 +0200 (CEST) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id RAA00965; Wed, 2 Sep 1998 17:19:08 +0200 (MET DST) Message-ID: <19980902171903.50388@follo.net> Date: Wed, 2 Sep 1998 17:19:03 +0200 From: Eivind Eklund To: Bruce Evans Cc: current@FreeBSD.ORG Subject: Re: ELF binaries size References: <199809021348.XAA08775@godzilla.zeta.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89.1i In-Reply-To: <199809021348.XAA08775@godzilla.zeta.org.au>; from Bruce Evans on Wed, Sep 02, 1998 at 11:48:09PM +1000 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, Sep 02, 1998 at 11:48:09PM +1000, Bruce Evans wrote: > >> Nah. The dual mapping is precisely what costs a full page of real memory. > > > >Does this mean we have two copies instead of two mappings? If we had > > Yes, there are 2 copies after the first data page is written to. The data > page becomes disassociated from the file. This is normal for copy-on- > write pages. Ah, got it. Stupid me. In case there are anybody left that didn't think hard enough: 00000000|11111111|22222222 (Page numbers) | | TTTTTTT |DDDDDDD | Under a.out non-overflow - always 2 pages | | V| | Under ELF - 2 pages unless marked spot is TTTTTTTD|DDDDDD | written, then 3 pages - 1 page wasted. | | TTTTTTT |DDDDDDDD|D Under a.out overflow - 3 pages | | V| | TTTTTTTD|DDDDDDDD| Under ELF - 2 pages unless marked spot is | | written, then 3 pages. Gives 1 wasted page in 50% of the cases iff the section that is shared with the text gets written. Does anybody have any statistics on how often COW is invoked on the "overlapping" segments? Each time COW is not invoked in the a.out overflow case will give ELF one won page compared to a.out (to offset the losses for the non-overflow case...) Eivind. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message