Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1768866Ab2KOT2X (ORCPT ); Thu, 15 Nov 2012 14:28:23 -0500 Received: from mail-bk0-f46.google.com ([209.85.214.46]:36034 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1768796Ab2KOT2B (ORCPT ); Thu, 15 Nov 2012 14:28:01 -0500 MIME-Version: 1.0 In-Reply-To: References: <20121112193044.GA11615@phenom.dumpdata.com> <1352755122-25660-1-git-send-email-yinghai@kernel.org> <1352755122-25660-22-git-send-email-yinghai@kernel.org> <50A2A706.1090608@zytor.com> Date: Thu, 15 Nov 2012 11:28:00 -0800 X-Google-Sender-Auth: zvp8FSQcdrhlMoNMsoC8r59QBKI Message-ID: Subject: Re: [PATCH 21/46] x86, mm: setup page table in top-down From: Yinghai Lu To: "H. Peter Anvin" Cc: Stefano Stabellini , Thomas Gleixner , Ingo Molnar , Jacob Shin , Andrew Morton , Konrad Rzeszutek Wilk , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1830 Lines: 52 On Tue, Nov 13, 2012 at 12:36 PM, Yinghai Lu wrote: > On Tue, Nov 13, 2012 at 12:01 PM, H. Peter Anvin wrote: >> On 11/13/2012 11:59 AM, Yinghai Lu wrote: >>>> >>>> The changes to init_mem_mapping are a bit iffy but they aren't too >>>> unreasonable. >>>> Overall the patch is OK even though I would certainly appreciate more >>>> comments and better variable names (real_end?), see below. >>> >>> real_end is not good? >>> >>> xen put big reserved range between real_end and end. >>> >>> that real_end is some kind of end of real usable areas. >>> >>> so change to real_usable_end or usable_end? >>> >> >> A description of a variable that includes the words "some kind of" >> clearly indicates major confusion. We need to know what the semantics >> are, here. > > originally, we map range in this sequence: > 1. map [0, 1M], > 2. map 2M near max_pfn. and end is max_pfn< 3. use new mapped area, to map low range. > 4. change step size if more ram get mapped. > 5. goto 3, until reach 1M. > > now for xen, there is big chunk range under max_pfn and they are reserved > in memblock.reserved. > so even we map them, we still can not use them for page table. > > so 2 become: > 2a. find real_end under max_pfn that we can use it for page table > 2b, map [real_end - 2M, real_end) > > and need to add > 6. map [real_end, max_pfn<