linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: aarcange@redhat.com, linux-mm@kvack.org
Subject: Re: [PATCH] mm/page_alloc.c: drop dead destroy_compound_page()
Date: Fri, 9 Jan 2015 16:24:19 -0800	[thread overview]
Message-ID: <20150109162419.b52796aee45d6747399d2ebb@linux-foundation.org> (raw)
In-Reply-To: <20150108141004.AB3461A2@black.fi.intel.com>

On Thu,  8 Jan 2015 16:10:04 +0200 (EET) "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> wrote:

> Something like this?
> 
> >From 5fd481c1c521112e9cea407f5a2644c9f93d0e14 Mon Sep 17 00:00:00 2001
> From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
> 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?


From: Andrew Morton <akpm@linux-foundation.org>
Subject: mm-more-checks-on-free_pages_prepare-for-tail-pages-fix

Make it conditional on CONFIG_DEBUG_VM, make free_tail_pages_check()
return void.

Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/page_alloc.c |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff -puN mm/page_alloc.c~mm-more-checks-on-free_pages_prepare-for-tail-pages-fix mm/page_alloc.c
--- a/mm/page_alloc.c~mm-more-checks-on-free_pages_prepare-for-tail-pages-fix
+++ a/mm/page_alloc.c
@@ -764,20 +764,26 @@ 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)
+#ifdef CONFIG_DEBUG_VM
+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;
 }
+#else
+static inline void free_tail_pages_check(struct page *head_page,
+					 struct page *page)
+{
+}
+#endif
 
 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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2015-01-10  0:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-05 11:46 [PATCH] mm/page_alloc.c: drop dead destroy_compound_page() Kirill A. Shutemov
2015-01-06 17:43 ` Vlastimil Babka
2015-01-06 18:29   ` Kirill A. Shutemov
2015-01-07 21:40 ` Andrew Morton
2015-01-08 14:10   ` Kirill A. Shutemov
2015-01-10  0:24     ` Andrew Morton [this message]
2015-01-10  0:41       ` Kirill A. Shutemov
2015-01-10  1:06         ` Andrew Morton
2015-01-10  1:15           ` Kirill A. Shutemov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150109162419.b52796aee45d6747399d2ebb@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=aarcange@redhat.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).