From owner-freebsd-current Fri Feb 6 19:50:40 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA00287 for current-outgoing; Fri, 6 Feb 1998 19:50:40 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from dyson.iquest.net (dyson.iquest.net [198.70.144.127]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA00260; Fri, 6 Feb 1998 19:50:29 -0800 (PST) (envelope-from toor@dyson.iquest.net) Received: (from root@localhost) by dyson.iquest.net (8.8.8/8.8.8) id WAA00681; Fri, 6 Feb 1998 22:50:01 -0500 (EST) (envelope-from toor) Message-Id: <199802070350.WAA00681@dyson.iquest.net> Subject: Re: Custom init(8) (and some ideas) In-Reply-To: <199802070332.TAA03469@dingo.cdrom.com> from Mike Smith at "Feb 6, 98 07:32:58 pm" To: mike@smith.net.au (Mike Smith) Date: Fri, 6 Feb 1998 22:50:01 -0500 (EST) Cc: abial@nask.pl, tlambert@primenet.com, freebsd-current@FreeBSD.ORG, jkh@FreeBSD.ORG From: "John S. Dyson" Reply-To: dyson@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL32 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG X-To-Unsubscribe: mail to majordomo@FreeBSD.org "unsubscribe current" Mike Smith said: > > > I had some ideas how to fix it, but the implementation of this is far > > beyond my knowledge: to modify imgact_gzip NOT to load the gzipped binary, > > but just to mmap it, and then unpack it. When I asked John Dyson he said > > that it would require a lot of work to change it... Pity. > > I'm not sure I follow you there. The imgact_gzip code doesn't load > the gzipped binary at all; it mmap's it one page at a time, > uncompressing it as it goes. > I think that I might have misinformed here. Gzipped binaries need swap backing store for each page in the image even for .text section, when physical memory space needs to be freed for another page. Non-gzipped binaries can depend on paging off of the a.out itself. Also, non-gzipped binaries don't have to page out the .text for the initial freeing of the .text space. Gzipped binaries need to page out the .text pages when they are individually freed due to pageout daemon activity. Also, gzipped binaries are not demand-loaded, but are loaded at startup. This guarantees that the entire image will have to be supported by either memory or swap space. During normal program execution (normal a.out, ELF, etc), the entire image doesn't have to be initially loaded, and you can get by with the size of the image being larger than the size of physical memory + swap space (of course, that is a special case need, but it is possible to do.) In the case of a gzipped binary, that isn't true. -- John | Never try to teach a pig to sing, dyson@freebsd.org | it just makes you look stupid, jdyson@nc.com | and it irritates the pig.