Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754583Ab0GaKkI (ORCPT ); Sat, 31 Jul 2010 06:40:08 -0400 Received: from caramon.arm.linux.org.uk ([78.32.30.218]:52842 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751710Ab0GaKkG (ORCPT ); Sat, 31 Jul 2010 06:40:06 -0400 Date: Sat, 31 Jul 2010 11:38:49 +0100 From: Russell King - ARM Linux To: Minchan Kim Cc: Dave Hansen , Christoph Lameter , KAMEZAWA Hiroyuki , Milton Miller , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Mel Gorman , Johannes Weiner , Kukjin Kim Subject: Re: [PATCH] Tight check of pfn_valid on sparsemem - v4 Message-ID: <20100731103849.GH23886@n2100.arm.linux.org.uk> References: <20100728225756.GA6108@barrios-desktop> <20100729161856.GA16420@barrios-desktop> <20100729170313.GB16420@barrios-desktop> <20100729183320.GH18923@n2100.arm.linux.org.uk> <1280436919.16922.11246.camel@nimitz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1053 Lines: 22 On Fri, Jul 30, 2010 at 06:32:04PM +0900, Minchan Kim wrote: > On Fri, Jul 30, 2010 at 5:55 AM, Dave Hansen wrote: > > If you free up parts of the mem_map[] array, how does the buddy > > allocator still work? ?I thought we required at 'struct page's to be > > contiguous and present for at least 2^MAX_ORDER-1 pages in one go. (Dave, I don't seem to have your mail to reply to.) What you say is correct, and memory banks as a rule of thumb tend to be powers of two. We do have the ability to change MAX_ORDER (which we need to do for some platforms where there's only 1MB of DMA-able memory.) However, in the case of two 512KB banks, the buddy allocator won't try to satisfy a 1MB request as it'll only have two separate 2x512K free 'pages' to deal with, and 0x1M free 'pages'. -- 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/