Skip to contentSkip to conversation

+ page-owners-correct-page-order-when-to-free-page.patch added to -mm tree

PATCH [email protected] 1 participant 1 message Mar 12, 2014

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

Subject: + page-owners-correct-page-order-when-to-free-page.patch added to -mm tree
To: [email protected],[email protected],[email protected]
From: [email protected]
Date: Wed, 12 Mar 2014 13:03:50 -0700

The patch titled

     Subject: page owners: correct page->order when to free page

has been added to the -mm tree. Its filename is
page-owners-correct-page-order-when-to-free-page.patch

This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/page-owners-correct-page-order-when-to-free-page.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/page-owners-correct-page-order-when-to-free-page.patch

Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated there every 3-4 working days

------------------------------------------------------
From: Jungsoo Son <[email protected]>
Subject: page owners: correct page->order when to free page

When I use PAGE_OWNER in mmotm tree, I found a problem that mismatches the number of allocated pages. When I investigate, the problem is that set_page_order is called for only a head page if freed page is merged to a higher order page in the buddy allocator so tail pages of the higher order page couldn't be reset to page->order = -1.

It means when we do 'cat /proc/page-owner', it could show wrong information.

So page->order should be set to -1 for all the tail pages as well as the first page before buddy allocator merges them.

This patch is for clearing page->order of all the tail pages in free_pages_prepare() when to free page.

---

 mm/page_alloc.c |    7 +++++++
 1 file changed, 7 insertions(+)
mm/page_alloc.c renamed from mm/page_alloc.c~page-owners-correct-page-order-when-to-free-page +7 -0
diff -puN mm/page_alloc.c~page-owners-correct-page-order-when-to-free-page mm/page_alloc.c
@@ -742,6 +742,13 @@ static bool free_pages_prepare(struct pa
 	if (bad)
 		return false;
 
+#ifdef CONFIG_PAGE_OWNER
+	for (i = 0; i < (1 << order); i++) {
+		struct page *p = (page + i);
+		p->order = -1;
+	}
+#endif
+
 	if (!PageHighMem(page)) {
 		debug_check_no_locks_freed(page_address(page),
 					   PAGE_SIZE << order);

_

Patches currently in -mm which might be from [email protected] are

page-owners-correct-page-order-when-to-free-page.patch