Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758070Ab0G2Qrd (ORCPT ); Thu, 29 Jul 2010 12:47:33 -0400 Received: from smtp110.prem.mail.ac4.yahoo.com ([76.13.13.93]:20833 "HELO smtp110.prem.mail.ac4.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754695Ab0G2Qrc (ORCPT ); Thu, 29 Jul 2010 12:47:32 -0400 X-Yahoo-SMTP: _Dag8S.swBC1p4FJKLCXbs8NQzyse1SYSgnAbY0- X-YMail-OSG: lVTCpO0VM1nQippHLLz9ldEN3qcZfD.FO8nN5QpIrkqvCxK 4moVGxg6AM9CDRlQMGvAJz2LwWniUuG84nZefMHi7ChY496Vdz.lY4DjW85. AABTur_IjD8S4qFJZjbNzcHpyj.to6OviBXHxDuCfr1cIKoQ.54pLcfX8Txk pIUm.lLeAg9m55HqLGctCggw9ldnbhYwL4.sodtWpb4Avx5gCnNpULsKlVcw Q X-Yahoo-Newman-Property: ymail-3 Date: Thu, 29 Jul 2010 11:47:26 -0500 (CDT) From: Christoph Lameter X-X-Sender: cl@router.home To: Minchan Kim cc: KAMEZAWA Hiroyuki , Milton Miller , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Russell King , Mel Gorman , Johannes Weiner , Kukjin Kim Subject: Re: [PATCH] Tight check of pfn_valid on sparsemem - v4 In-Reply-To: <20100729161856.GA16420@barrios-desktop> Message-ID: References: <20100727171351.98d5fb60.kamezawa.hiroyu@jp.fujitsu.com> <20100728155617.GA5401@barrios-desktop> <20100728225756.GA6108@barrios-desktop> <20100729161856.GA16420@barrios-desktop> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1561 Lines: 30 On Fri, 30 Jul 2010, Minchan Kim wrote: > The thing is valid section also have a invalid memmap. Oww... . A valid section points to a valid memmap memory block (the page structs) but the underlying memory pages may not present. So you can check the (useless) page structs for the page state of the not present pages in the memory map. If the granularity of the sparsemem mapping is not sufficient for your purpose then you can change the sparsemem config (configuration is in arch//include/asm/sparsemem.h but does not exist for arm). > It means section 0 is an incompletely filled section. > Nontheless, current pfn_valid of sparsemem checks pfn loosely. > It checks only mem_section's validation but ARM can free mem_map on hole > to save memory space. So in above case, pfn on 0x25000000 can pass pfn_valid's > validation check. It's not what we want. IMHO ARM should not poke holes in the memmap sections. The guarantee of the full presence of the section is intentional to avoid having to do these checks that you are proposing. The page allocator typically expects to be able to check all page structs in one basic allocation unit. Also pfn_valid then does not have to touch the pag struct to perform its function as long as we guarantee the presence of the memmap section. -- 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/