Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761398AbXKPRMr (ORCPT ); Fri, 16 Nov 2007 12:12:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752258AbXKPRMk (ORCPT ); Fri, 16 Nov 2007 12:12:40 -0500 Received: from gw.goop.org ([64.81.55.164]:55794 "EHLO mail.goop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751809AbXKPRMj (ORCPT ); Fri, 16 Nov 2007 12:12:39 -0500 Message-ID: <473DCF73.4070401@goop.org> Date: Fri, 16 Nov 2007 09:12:19 -0800 From: Jeremy Fitzhardinge User-Agent: Thunderbird 2.0.0.5 (X11/20070727) MIME-Version: 1.0 To: Linus Torvalds CC: William Lee Irwin III , Andi Kleen , Ingo Molnar , Thomas Gleixner , Nick Piggin , "H. Peter Anvin" , Linux Kernel Mailing List Subject: Re: Why preallocate pmd in x86 32-bit PAE? References: <473CC0AC.3020500@goop.org> In-Reply-To: X-Enigmail-Version: 0.95.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1561 Lines: 36 Linus Torvalds wrote: > On Thu, 15 Nov 2007, Jeremy Fitzhardinge wrote: > >> Once difference is that 64-bit incrementally allocates all levels of the >> pagetable, whereas 32-bit PAE preallocates the 4 pmds when it allocates >> the pgd. What's the rationale for this? What pitfalls would there be >> in making them incrementally allocated? >> > > IIRC, the present bit is ignored in the magic 4-entry PGD. All entries > have to be present. > Hm, do you recall what processors that might affect? As far as I know, current processors will ignore non-present top-level entries. Anyway, we can point them not present to empty_zero_page, so testing the present bit will still be sufficient to tell if we need to allocate a new pmd, but if the hardware decides to follow the page reference there's no harm done. (Hm, unless the hardware decides it wants to set A or D bits in empty_zero_page for some reason...) > What earlier CPU's did was to basically load all four values into the CPU > when you loaded %cr3. There was no "three-level page table walker" at all: > it was still a two-level page table walker, there were just for magic > internal page tables that were indexed off the two high bits. > That just means we need to reload cr3 after populating the pgd with a new pmd, right? J - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/