From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 30 17:28:35 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 B8AA51065670 for ; Wed, 30 Jul 2008 17:28:35 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.186]) by mx1.freebsd.org (Postfix) with ESMTP id 4F7C48FC16 for ; Wed, 30 Jul 2008 17:28:35 +0000 (UTC) (envelope-from max@love2party.net) Received: from vampire.homelinux.org (dslb-088-064-179-170.pools.arcor-ip.net [88.64.179.170]) by mrelayeu.kundenserver.de (node=mrelayeu7) with ESMTP (Nemesis) id 0ML2xA-1KOFTV3OjT-0004vc; Wed, 30 Jul 2008 19:28:34 +0200 Received: (qmail 28614 invoked from network); 30 Jul 2008 17:28:33 -0000 Received: from fbsd8.laiers.local (192.168.4.151) by laiers.local with SMTP; 30 Jul 2008 17:28:33 -0000 From: Max Laier Organization: FreeBSD To: "FreeBSD Hackers" Date: Wed, 30 Jul 2008 19:28:32 +0200 User-Agent: KMail/1.9.52 (FreeBSD/8.0-CURRENT; KDE/4.0.83; i386; ; ) References: <591f70e00807300459j74aac11eob0bea7cdf4b4dcd4@mail.gmail.com> <200807301536.23274.max@love2party.net> <591f70e00807300907n1a0585efr455bf1f8fc60b4e8@mail.gmail.com> In-Reply-To: <591f70e00807300907n1a0585efr455bf1f8fc60b4e8@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200807301928.32940.max@love2party.net> X-Provags-ID: V01U2FsdGVkX18/wMkS70Jpn3ynq8x5brOb43RH7Q9tT3zlSDW ESKrbxU59NXq+D845T+vk1wq1pdHvPtSEuGFKviB6vkapfAACR 08SX7gWv5nN/kv+oYM2dA== 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 17:28:35 -0000 On Wednesday 30 July 2008 18:07:51 FreeBSD Hackers wrote: > > 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? You should have quoted (and I suppose read) my entire message: > .. you need additional bookkeeping > to track that (see core map, free lists, ...) Wikipedia really does a good job explaining all this. -- /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News