Commit 68e4838b authored by Mel Gorman's avatar Mel Gorman Committed by james toy

When a page is freed with the PG_mlocked set, it is considered an

unexpected but recoverable situation.  A counter records how often this
event happens but it is easy to miss that this event has occured at
all.  This patch warns once when PG_mlocked is set to prompt debuggers
to check the counter to see how often it is happening.
Signed-off-by: default avatarMel Gorman <mel@csn.ul.ie>
Reviewed-by: default avatarChristoph Lameter <cl@linux-foundation.org>
Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 1a9aa809
...@@ -495,6 +495,11 @@ static inline void __free_one_page(struct page *page, ...@@ -495,6 +495,11 @@ static inline void __free_one_page(struct page *page,
*/ */
static inline void free_page_mlock(struct page *page) static inline void free_page_mlock(struct page *page)
{ {
WARN_ONCE(1, KERN_WARNING
"Page flag mlocked set for process %s at pfn:%05lx\n"
"page:%p flags:%#lx\n",
current->comm, page_to_pfn(page),
page, page->flags|__PG_MLOCKED);
__dec_zone_page_state(page, NR_MLOCK); __dec_zone_page_state(page, NR_MLOCK);
__count_vm_event(UNEVICTABLE_MLOCKFREED); __count_vm_event(UNEVICTABLE_MLOCKFREED);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment