mm: show message when updating min_free_kbytes in thp
authorHan Pingtian <hanpt@linux.vnet.ibm.com>
Thu, 23 Jan 2014 23:53:28 +0000 (15:53 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 24 Jan 2014 00:36:52 +0000 (16:36 -0800)
min_free_kbytes may be raised during THP's initialization.  Sometimes,
this will change the value which was set by the user.  Showing this
message will clarify this confusion.

Only show this message when changing a value which was set by the user
according to Michal Hocko's suggestion.

Show the old value of min_free_kbytes according to Dave Hansen's
suggestion.  This will give user the chance to restore old value of
min_free_kbytes.

Signed-off-by: Han Pingtian <hanpt@linux.vnet.ibm.com>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Cc: David Rientjes <rientjes@google.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/huge_memory.c
mm/internal.h
mm/page_alloc.c

index 25fab71..afe7383 100644 (file)
@@ -130,8 +130,14 @@ static int set_recommended_min_free_kbytes(void)
                              (unsigned long) nr_free_buffer_pages() / 20);
        recommended_min <<= (PAGE_SHIFT-10);
 
-       if (recommended_min > min_free_kbytes)
+       if (recommended_min > min_free_kbytes) {
+               if (user_min_free_kbytes >= 0)
+                       pr_info("raising min_free_kbytes from %d to %lu "
+                               "to help transparent hugepage allocations\n",
+                               min_free_kbytes, recommended_min);
+
                min_free_kbytes = recommended_min;
+       }
        setup_per_zone_wmarks();
        return 0;
 }
diff --cc mm/internal.h
Simple merge
diff --cc mm/page_alloc.c
Simple merge