linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [BUGFIX][PATCH] fix is_mem_section_removable() page_order BUG_ON check.
@ 2010-10-25  6:37 KAMEZAWA Hiroyuki
  2010-10-25  7:49 ` Wu Fengguang
  2010-10-25 17:03 ` Mel Gorman
  0 siblings, 2 replies; 6+ messages in thread
From: KAMEZAWA Hiroyuki @ 2010-10-25  6:37 UTC (permalink / raw)
  To: linux-mm@kvack.org
  Cc: akpm@linux-foundation.org, Michal Hocko, fengguang.wu, Mel Gorman

I wonder this should be for stable tree...but want to hear opinions before.
==
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

page_order() is called by memory hotplug's user interface to check 
the section is removable or not. (is_mem_section_removable())

It calls page_order() withoug holding zone->lock.
So, even if the caller does

	if (PageBuddy(page))
		ret = page_order(page) ...
The caller may hit BUG_ON().

For fixing this, there are 2 choices.
  1. add zone->lock.
  2. remove BUG_ON().

is_mem_section_removable() is used for some "advice" and doesn't need
to be 100% accurate. This is_removable() can be called via user program..
We don't want to take this important lock for long by user's request.
So, this patch removes BUG_ON().

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
---
 mm/internal.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: mmotm-1024/mm/internal.h
===================================================================
--- mmotm-1024.orig/mm/internal.h
+++ mmotm-1024/mm/internal.h
@@ -62,7 +62,7 @@ extern bool is_free_buddy_page(struct pa
  */
 static inline unsigned long page_order(struct page *page)
 {
-	VM_BUG_ON(!PageBuddy(page));
+	/* PageBuddy() must be checked by the caller */
 	return page_private(page);
 }
 

--
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>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-10-25 21:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-25  6:37 [BUGFIX][PATCH] fix is_mem_section_removable() page_order BUG_ON check KAMEZAWA Hiroyuki
2010-10-25  7:49 ` Wu Fengguang
2010-10-25 13:10   ` Michal Hocko
2010-10-25 13:16     ` Wu Fengguang
2010-10-25 21:24     ` Andrew Morton
2010-10-25 17:03 ` Mel Gorman

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).