From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755620Ab3AQW4K (ORCPT ); Thu, 17 Jan 2013 17:56:10 -0500 Received: from e34.co.us.ibm.com ([32.97.110.152]:36636 "EHLO e34.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754027Ab3AQWyR (ORCPT ); Thu, 17 Jan 2013 17:54:17 -0500 From: Cody P Schafer To: Linux MM , David Hansen Cc: LKML , Andrew Morton , Catalin Marinas , Cody P Schafer , Cody P Schafer Subject: [PATCH 4/9] mm/page_alloc: add a VM_BUG in __free_one_page() if the zone is uninitialized. Date: Thu, 17 Jan 2013 14:52:56 -0800 Message-Id: <1358463181-17956-5-git-send-email-cody@linux.vnet.ibm.com> X-Mailer: git-send-email 1.8.0.3 In-Reply-To: <1358463181-17956-1-git-send-email-cody@linux.vnet.ibm.com> References: <1358463181-17956-1-git-send-email-cody@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13011722-2876-0000-0000-0000043302F5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Cody P Schafer Freeing pages to uninitialized zones is not handled by __free_one_page(), and should never happen when the code is correct. Ran into this while writing some code that dynamically onlines extra zones. Signed-off-by: Cody P Schafer --- mm/page_alloc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index e2574ea..f8ed277 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -530,6 +530,8 @@ static inline void __free_one_page(struct page *page, unsigned long uninitialized_var(buddy_idx); struct page *buddy; + VM_BUG_ON(!zone_is_initialized(zone)); + if (unlikely(PageCompound(page))) if (unlikely(destroy_compound_page(page, order))) return; -- 1.8.0.3 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx157.postini.com [74.125.245.157]) by kanga.kvack.org (Postfix) with SMTP id EE5286B000A for ; Thu, 17 Jan 2013 17:54:15 -0500 (EST) Received: from /spool/local by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 17 Jan 2013 17:54:15 -0500 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 9FB8238C801C for ; Thu, 17 Jan 2013 17:54:12 -0500 (EST) Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r0HMsBK0349582 for ; Thu, 17 Jan 2013 17:54:12 -0500 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r0HMuQsP014319 for ; Thu, 17 Jan 2013 15:56:26 -0700 From: Cody P Schafer Subject: [PATCH 4/9] mm/page_alloc: add a VM_BUG in __free_one_page() if the zone is uninitialized. Date: Thu, 17 Jan 2013 14:52:56 -0800 Message-Id: <1358463181-17956-5-git-send-email-cody@linux.vnet.ibm.com> In-Reply-To: <1358463181-17956-1-git-send-email-cody@linux.vnet.ibm.com> References: <1358463181-17956-1-git-send-email-cody@linux.vnet.ibm.com> Sender: owner-linux-mm@kvack.org List-ID: To: Linux MM , David Hansen Cc: LKML , Andrew Morton , Catalin Marinas , Cody P Schafer , Cody P Schafer From: Cody P Schafer Freeing pages to uninitialized zones is not handled by __free_one_page(), and should never happen when the code is correct. Ran into this while writing some code that dynamically onlines extra zones. Signed-off-by: Cody P Schafer --- mm/page_alloc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index e2574ea..f8ed277 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -530,6 +530,8 @@ static inline void __free_one_page(struct page *page, unsigned long uninitialized_var(buddy_idx); struct page *buddy; + VM_BUG_ON(!zone_is_initialized(zone)); + if (unlikely(PageCompound(page))) if (unlikely(destroy_compound_page(page, order))) return; -- 1.8.0.3 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org