Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755363AbYC1B0d (ORCPT ); Thu, 27 Mar 2008 21:26:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753573AbYC1B0Y (ORCPT ); Thu, 27 Mar 2008 21:26:24 -0400 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:48782 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753521AbYC1B0Y (ORCPT ); Thu, 27 Mar 2008 21:26:24 -0400 Date: Fri, 28 Mar 2008 10:27:19 +0900 From: KAMEZAWA Hiroyuki To: Jeremy Fitzhardinge Cc: Ingo Molnar , LKML , Rusty Russell , Yasunori Goto , Christoph Lameter , Dave Hansen , Andrew Morton Subject: Re: [PATCH 2 of 4] hotplug-memory: adding non-section-aligned memory is bad Message-Id: <20080328102719.3ab9162b.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: References: Organization: Fujitsu X-Mailer: Sylpheed 2.4.2 (GTK+ 2.10.11; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1274 Lines: 38 On Thu, 27 Mar 2008 17:28:38 -0700 Jeremy Fitzhardinge wrote: > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -784,6 +784,9 @@ > #define PAGES_PER_SECTION (1UL << PFN_SECTION_SHIFT) > #define PAGE_SECTION_MASK (~(PAGES_PER_SECTION-1)) > > +#define SECTION_SIZE (1UL << SECTION_SIZE_BITS) > +#define SECTION_SIZE_MASK (SECTION_SIZE - 1) > + > #define SECTION_BLOCKFLAGS_BITS \ > ((1UL << (PFN_SECTION_SHIFT - pageblock_order)) * NR_PAGEBLOCK_BITS) > > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > --- a/mm/memory_hotplug.c > +++ b/mm/memory_hotplug.c > @@ -300,6 +300,11 @@ > int ret; > u64 start = res->start; > u64 size = res->end - res->start + 1; > + > + /* Adding non-section-aligned memory will give unexpected > + and unintuitive results. */ > + WARN_ON((start & SECTION_SIZE_MASK) != 0); > + WARN_ON((size & SECTION_SIZE_MASK) != 0); > Why just WARNING ? not BUG_ON? Thanks, -Kame -- 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/