Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753898Ab0ALNgR (ORCPT ); Tue, 12 Jan 2010 08:36:17 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753834Ab0ALNgQ (ORCPT ); Tue, 12 Jan 2010 08:36:16 -0500 Received: from mga09.intel.com ([134.134.136.24]:15340 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753312Ab0ALNgP (ORCPT ); Tue, 12 Jan 2010 08:36:15 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.49,262,1262592000"; d="scan'208";a="483337453" Date: Tue, 12 Jan 2010 21:35:56 +0800 From: Wu Fengguang To: KAMEZAWA Hiroyuki Cc: "Zheng, Shaohui" , "linux-mm@kvack.org" , "akpm@linux-foundation.org" , "linux-kernel@vger.kernel.org" , "ak@linux.intel.com" , "y-goto@jp.fujitsu.com" , Dave Hansen , "x86@kernel.org" , Yinghai Lu Subject: Re: [PATCH - resend] Memory-Hotplug: Fix the bug on interface /dev/mem for 64-bit kernel(v1) Message-ID: <20100112133556.GB7647@localhost> References: <20100108124851.GB6153@localhost> <20100111124303.GA21408@localhost> <20100112093031.0fc6877f.kamezawa.hiroyu@jp.fujitsu.com> <20100112023307.GA16661@localhost> <20100112113903.89163c46.kamezawa.hiroyu@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100112113903.89163c46.kamezawa.hiroyu@jp.fujitsu.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1631 Lines: 56 On Tue, Jan 12, 2010 at 10:39:03AM +0800, KAMEZAWA Hiroyuki wrote: > On Tue, 12 Jan 2010 10:33:08 +0800 > Wu Fengguang wrote: > > > Sure, here it is :) > > --- > > x86: use the generic page_is_ram() > > > > The generic resource based page_is_ram() works better with memory > > hotplug/hotremove. So switch the x86 e820map based code to it. > > > > CC: Andi Kleen > > CC: KAMEZAWA Hiroyuki > > Signed-off-by: Wu Fengguang > > Ack. Thank you. > > > +#ifdef CONFIG_X86 > > + /* > > + * A special case is the first 4Kb of memory; > > + * This is a BIOS owned area, not kernel ram, but generally > > + * not listed as such in the E820 table. > > + */ > > + if (pfn == 0) > > + return 0; > > + > > + /* > > + * Second special case: Some BIOSen report the PC BIOS > > + * area (640->1Mb) as ram even though it is not. > > + */ > > + if (pfn >= (BIOS_BEGIN >> PAGE_SHIFT) && > > + pfn < (BIOS_END >> PAGE_SHIFT)) > > + return 0; > > +#endif > > I'm glad if this part is sorted out in clean way ;) Two possible solutions are: - to exclude the above two ranges directly in e820 map; - to not add the above two ranges into iomem_resource. Yinghai, do you have any suggestions? We want to get rid of the two explicit tests from page_is_ram(). Thanks, Fengguang -- 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/