Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751680AbWJGNGC (ORCPT ); Sat, 7 Oct 2006 09:06:02 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751712AbWJGNGB (ORCPT ); Sat, 7 Oct 2006 09:06:01 -0400 Received: from mail.suse.de ([195.135.220.2]:22928 "EHLO mx1.suse.de") by vger.kernel.org with ESMTP id S1751680AbWJGNF6 (ORCPT ); Sat, 7 Oct 2006 09:05:58 -0400 From: Nick Piggin To: Linux Memory Management , Andrew Morton Cc: Linux Kernel , Nick Piggin Message-Id: <20061007105815.14024.99053.sendpatchset@linux.site> In-Reply-To: <20061007105758.14024.70048.sendpatchset@linux.site> References: <20061007105758.14024.70048.sendpatchset@linux.site> Subject: [patch 2/3] mm: locks_freed fix Date: Sat, 7 Oct 2006 15:05:54 +0200 (CEST) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2089 Lines: 59 Move the lock debug checks below the page reserved checks. Also, having debug_check_no_locks_freed in kernel_map_pages is wrong. Signed-off-by: Nick Piggin Index: linux-2.6/include/linux/mm.h =================================================================== --- linux-2.6.orig/include/linux/mm.h 2006-10-06 11:59:47.000000000 +1000 +++ linux-2.6/include/linux/mm.h 2006-10-06 12:00:02.000000000 +1000 @@ -1038,12 +1038,7 @@ static inline void vm_stat_account(struc #ifndef CONFIG_DEBUG_PAGEALLOC static inline void -kernel_map_pages(struct page *page, int numpages, int enable) -{ - if (!PageHighMem(page) && !enable) - debug_check_no_locks_freed(page_address(page), - numpages * PAGE_SIZE); -} +kernel_map_pages(struct page *page, int numpages, int enable) {} #endif extern struct vm_area_struct *get_gate_vma(struct task_struct *tsk); Index: linux-2.6/mm/page_alloc.c =================================================================== --- linux-2.6.orig/mm/page_alloc.c 2006-10-06 11:59:47.000000000 +1000 +++ linux-2.6/mm/page_alloc.c 2006-10-06 12:01:52.000000000 +1000 @@ -443,15 +443,13 @@ static void __free_pages_ok(struct page int i; int reserved = 0; - if (!PageHighMem(page)) - debug_check_no_locks_freed(page_address(page), - PAGE_SIZE<