From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 30 16:07:51 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1E7C1065674 for ; Wed, 30 Jul 2008 16:07:51 +0000 (UTC) (envelope-from ml.freebsd.hackers@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.233]) by mx1.freebsd.org (Postfix) with ESMTP id 9975F8FC21 for ; Wed, 30 Jul 2008 16:07:51 +0000 (UTC) (envelope-from ml.freebsd.hackers@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so115278rvf.43 for ; Wed, 30 Jul 2008 09:07:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=ZzZM9XUsM4n1kY4j8PfVm8LCpcVoxkiHFbL1m+Pie9g=; b=XEBq28BX5EgMWKpVLq1wclgg6nMtfUWmBCvSHHpW/KyeFMVz2KsT0jcLj/4TFP2sGG XPbr2QrtPLSv+HGDyX7sRi6HLKsfGnFmQzqSGl/OPi4Gul6XP9AMNOCAmGP21QMoHMPw MA4QosxHpq7nKdTK5jtZPMtaL48BhmhkYx8dE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=SWa25xBqXfQfACZ8y4n90MX93VX6gyciMG3qGv/wCnVewit1VoiMIqcS0xn011F+xJ WtBs/dU/MN9Agflc7NZQIfKMyOuipm9OnwTsi4OXy0yYhHAkZypUXbjK4PAqUmuCJPCN n8LfPMQ6aURriXMT58ImGytZ+nxxmdDOccIhQ= Received: by 10.140.170.12 with SMTP id s12mr4473763rve.101.1217434071136; Wed, 30 Jul 2008 09:07:51 -0700 (PDT) Received: by 10.141.115.8 with HTTP; Wed, 30 Jul 2008 09:07:51 -0700 (PDT) Message-ID: <591f70e00807300907n1a0585efr455bf1f8fc60b4e8@mail.gmail.com> Date: Wed, 30 Jul 2008 12:07:51 -0400 From: "FreeBSD Hackers" To: "Max Laier" In-Reply-To: <200807301536.23274.max@love2party.net> MIME-Version: 1.0 References: <591f70e00807300459j74aac11eob0bea7cdf4b4dcd4@mail.gmail.com> <200807301536.23274.max@love2party.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org Subject: Re: General questions about virtual memory X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jul 2008 16:07:51 -0000 > > This suggest that you don't understand virtual memory at all. Go back to > the > start of the chapter and re-read. The page directories and page tables > describe a *virtual* address space. For a given architecture the *virtual* > address space has a fixed size (4GB for i386), so the page table structure > is > always the same size (though it might be sparsely populated). Inside the > page Ack! As soon as I read this I realized the mistake I had made in my thinking. This was a dumb question, and I knew better than to ask. Somehow I had confused myself. ----- 8< ----- If a read request is made to a virtual address who's data has been swapped out, the CPU traps to the OS to fix the problem. Assuming there are no free page frames for the new data, a page frame is selected and evicted to make room for the new page. Whatever page was chosen belongs to a process somewhere in the system. When that page frame gets swapped, the PTE pointing to that page frame must be updated to indicate that that data is no longer in RAM. How does the OS find that PTE? Does it search through every entry of every page table for every process in the system until it finds it? Kevin