From owner-freebsd-current Sun Jan 26 13:35:02 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id NAA25751 for current-outgoing; Sun, 26 Jan 1997 13:35:02 -0800 (PST) Received: from root.com (implode.root.com [198.145.90.17]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id NAA25732 for ; Sun, 26 Jan 1997 13:34:57 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by root.com (8.7.6/8.6.5) with SMTP id NAA08167; Sun, 26 Jan 1997 13:34:52 -0800 (PST) Message-Id: <199701262134.NAA08167@root.com> X-Authentication-Warning: implode.root.com: Host localhost [127.0.0.1] didn't use HELO protocol To: Steven Wallace cc: current@freebsd.org Subject: Re: exec bug In-reply-to: Your message of "Sun, 26 Jan 1997 11:25:46 PST." <199701261925.LAA06985@newport.ece.uci.edu> From: David Greenman Reply-To: dg@root.com Date: Sun, 26 Jan 1997 13:34:52 -0800 Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >> The only solution I can think of at the moment to this problem would be to >>change the code to do a read of the file header into a malloced buffer. The >>overhead for this would be very (unacceptably) high, however. > >What do you think of my alternate solution: > >When the first page of a program is mapped, it should be possible to determine >if this page exists already in physical memory. If it does, no problemo! >On the other hand, if it does not, immediately bring this page into memory >by reading from disk. If this read fails, then return an error condition. >Otherwise, we now know the page is resident in memory and there will be no >problems when the header is checked. > >The idea here is we do not need to wait for a page fault in exec_aout_imgact() >a few lines of code away. We know it will happen very soon so proceed >almost as if a fault had occurred by bringing the page into memory. >That way if it fails, we know where we are at so we can gracefully discontinue >exec rather than a panic. Yes, this is possible...see my reply to Bruce. The concern is the overhead for determining page residency. This isn't all that cheap of an operation, and it will have to happen for every exec. -DG David Greenman Core-team/Principal Architect, The FreeBSD Project