From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) by kanga.kvack.org (Postfix) with ESMTP id 357566B0032 for ; Fri, 9 Jan 2015 20:06:52 -0500 (EST) Received: by mail-ie0-f182.google.com with SMTP id x19so17901592ier.13 for ; Fri, 09 Jan 2015 17:06:52 -0800 (PST) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org. [140.211.169.12]) by mx.google.com with ESMTPS id o17si335128igx.24.2015.01.09.17.06.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Jan 2015 17:06:51 -0800 (PST) Date: Fri, 9 Jan 2015 17:06:42 -0800 From: Andrew Morton Subject: Re: [PATCH] mm/page_alloc.c: drop dead destroy_compound_page() Message-Id: <20150109170642.14a01c7e.akpm@linux-foundation.org> In-Reply-To: <20150110004143.GA32424@node.dhcp.inet.fi> References: <1420458382-161038-1-git-send-email-kirill.shutemov@linux.intel.com> <20150107134039.25d4edfad92b62f3eee8b570@linux-foundation.org> <20150108141004.AB3461A2@black.fi.intel.com> <20150109162419.b52796aee45d6747399d2ebb@linux-foundation.org> <20150110004143.GA32424@node.dhcp.inet.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: "Kirill A. Shutemov" Cc: "Kirill A. Shutemov" , aarcange@redhat.com, linux-mm@kvack.org On Sat, 10 Jan 2015 02:41:43 +0200 "Kirill A. Shutemov" wrote: > On Fri, Jan 09, 2015 at 04:24:19PM -0800, Andrew Morton wrote: > > On Thu, 8 Jan 2015 16:10:04 +0200 (EET) "Kirill A. Shutemov" wrote: > > > > > Something like this? > > > > > > >From 5fd481c1c521112e9cea407f5a2644c9f93d0e14 Mon Sep 17 00:00:00 2001 > > > From: "Kirill A. Shutemov" > > > Date: Thu, 8 Jan 2015 15:59:23 +0200 > > > Subject: [PATCH] mm: more checks on free_pages_prepare() for tail pages > > > > > > Apart form being dead, destroy_compound_page() did some potentially > > > useful checks. Let's re-introduce them in free_pages_prepare(), where > > > they can be acctually triggered. > > > > > > compound_order() assert is already in free_pages_prepare(). We have few > > > checks for tail pages left. > > > > > > > I'm thinking we avoid the overhead unless CONFIG_DEBUG_VM? > > That's why there's "if (!IS_ENABLED(CONFIG_DEBUG_VM))". Is it wrong in > some way? > I didn't check, but I assume compiler is smart enough to get rid of > free_tail_pages_check() if CONFIG_DEBUG_VM is not defined. No? doh, OK. I updated the mm-more-checks-on-free_pages_prepare-for-tail-pages.patch changelog to reflect this and did --- a/mm/page_alloc.c~mm-more-checks-on-free_pages_prepare-for-tail-pages-fix +++ a/mm/page_alloc.c @@ -764,19 +764,18 @@ static void free_one_page(struct zone *z spin_unlock(&zone->lock); } -static int free_tail_pages_check(struct page *head_page, struct page *page) +static void free_tail_pages_check(struct page *head_page, struct page *page) { if (!IS_ENABLED(CONFIG_DEBUG_VM)) - return 0; + return; if (unlikely(!PageTail(page))) { bad_page(page, "PageTail not set", 0); - return 1; + return; } if (unlikely(page->first_page != head_page)) { bad_page(page, "first_page not consistent", 0); - return 1; + return; } - return 0; } static bool free_pages_prepare(struct page *page, unsigned int order) _ -- 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