Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Feb 1998 22:50:01 -0500 (EST)
From:      "John S. Dyson" <dyson@FreeBSD.ORG>
To:        mike@smith.net.au (Mike Smith)
Cc:        abial@nask.pl, tlambert@primenet.com, freebsd-current@FreeBSD.ORG, jkh@FreeBSD.ORG
Subject:   Re: Custom init(8) (and some ideas)
Message-ID:  <199802070350.WAA00681@dyson.iquest.net>
In-Reply-To: <199802070332.TAA03469@dingo.cdrom.com> from Mike Smith at "Feb 6, 98 07:32:58 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199802070350.WAA00681>