linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Wu Fengguang <fengguang.wu@intel.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [RFC][PATCH] proc: export more page flags in /proc/kpageflags (take 3)
Date: Thu, 23 Apr 2009 19:21:24 +0800	[thread overview]
Message-ID: <20090423112124.GA20425@localhost> (raw)
In-Reply-To: <20090423085405.GL13896@one.firstfloor.org>

On Thu, Apr 23, 2009 at 04:54:06PM +0800, Andi Kleen wrote:
> > Good idea.
> > 
> > Would you recommend a good way to identify huge pages?
> > Test by page order, or by (dtor == free_huge_page)?      
> 
> That doesn't work for GB pages. The best way would be to make
> slub stop using it and then check for compound, but I don't know what 
> this implies. Otherwise would need some other way, perhaps a new
> flag?

Or play the following trick? :-)

This helps hide the internal compound page consumers(SLAB/SLUB/... and
loads of device drivers) to user space. However there are still huge
pages of different orders(IA64?). Does this make a good reason for
exporting both HEAD/TAIL flags, instead of a combined COMPOUND flag?

Thanks,
Fengguang
---

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index c722aa6..7d0bd0d 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -298,6 +298,14 @@ void prep_compound_page(struct page *page, unsigned long order)
 	}
 }
 
+/*
+ * This function helps distinguish gigantic pages from normal compound pages.
+ */
+static void free_gigantic_page(struct page *page)
+{
+	__free_pages_ok(page, compound_order(page));
+}
+
 #ifdef CONFIG_HUGETLBFS
 void prep_compound_gigantic_page(struct page *page, unsigned long order)
 {
@@ -305,7 +313,7 @@ void prep_compound_gigantic_page(struct page *page, unsigned long order)
 	int nr_pages = 1 << order;
 	struct page *p = page + 1;
 
-	set_compound_page_dtor(page, free_compound_page);
+	set_compound_page_dtor(page, free_gigantic_page);
 	set_compound_order(page, order);
 	__SetPageHead(page);
 	for (i = 1; i < nr_pages; i++, p = mem_map_next(p, page, i)) {

--
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:[~2009-04-23 11:21 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-14  4:22 [RFC][PATCH] proc: export more page flags in /proc/kpageflags Wu Fengguang
2009-04-14  4:36 ` Wu Fengguang
2009-04-14  4:37 ` KOSAKI Motohiro
2009-04-14  6:41   ` Wu Fengguang
2009-04-14  6:54     ` KOSAKI Motohiro
2009-04-14  7:11       ` Andi Kleen
2009-04-14  7:17         ` KOSAKI Motohiro
2009-04-15 13:18         ` Wu Fengguang
2009-04-15 13:57           ` Andi Kleen
2009-04-16  2:41             ` Wu Fengguang
2009-04-16  3:54               ` Andi Kleen
2009-04-16  4:43                 ` Wu Fengguang
2009-04-16  2:26           ` KOSAKI Motohiro
2009-04-16  3:49             ` Wu Fengguang
2009-04-16  6:30               ` Wu Fengguang
2009-04-23  2:26             ` [RFC][PATCH] proc: export more page flags in /proc/kpageflags (take 3) Wu Fengguang
2009-04-23  7:48               ` Andi Kleen
2009-04-23  8:10                 ` Wu Fengguang
2009-04-23  8:54                   ` Andi Kleen
2009-04-23 11:21                     ` Wu Fengguang [this message]
2009-04-25  1:59               ` Wu Fengguang
2009-04-14  7:22       ` [RFC][PATCH] proc: export more page flags in /proc/kpageflags Wu Fengguang
2009-04-14  7:42         ` KOSAKI Motohiro

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=20090423112124.GA20425@localhost \
    --to=fengguang.wu@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --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).