summaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorMel Gorman <mgorman@techsingularity.net>2016-05-19 20:14:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-05-19 22:12:14 -0400
commitbb552ac6c6b4f24e7a7b491286f87b63f9478d42 (patch)
treea261455af75121deaeed4c134cfb2498e05175f2 /mm/page_alloc.c
parent7bfec6f47bb0ffd207c7e813e819235e6c1c0f34 (diff)
mm, page_alloc: un-inline the bad part of free_pages_check
From: Vlastimil Babka <vbabka@suse.cz> !DEBUG_VM size and bloat-o-meter: add/remove: 1/0 grow/shrink: 0/2 up/down: 124/-370 (-246) function old new delta free_pages_check_bad - 124 +124 free_pcppages_bulk 1288 1171 -117 __free_pages_ok 948 695 -253 DEBUG_VM: add/remove: 1/0 grow/shrink: 0/1 up/down: 124/-214 (-90) function old new delta free_pages_check_bad - 124 +124 free_pages_prepare 1112 898 -214 [akpm@linux-foundation.org: fix whitespace] Signed-off-by: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Mel Gorman <mgorman@techsingularity.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 76a394812776..d51543de1813 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -806,18 +806,11 @@ static inline bool page_expected_state(struct page *page,
806 return true; 806 return true;
807} 807}
808 808
809static inline int free_pages_check(struct page *page) 809static void free_pages_check_bad(struct page *page)
810{ 810{
811 const char *bad_reason; 811 const char *bad_reason;
812 unsigned long bad_flags; 812 unsigned long bad_flags;
813 813
814 if (page_expected_state(page, PAGE_FLAGS_CHECK_AT_FREE)) {
815 page_cpupid_reset_last(page);
816 page->flags &= ~PAGE_FLAGS_CHECK_AT_PREP;
817 return 0;
818 }
819
820 /* Something has gone sideways, find it */
821 bad_reason = NULL; 814 bad_reason = NULL;
822 bad_flags = 0; 815 bad_flags = 0;
823 816
@@ -836,6 +829,18 @@ static inline int free_pages_check(struct page *page)
836 bad_reason = "page still charged to cgroup"; 829 bad_reason = "page still charged to cgroup";
837#endif 830#endif
838 bad_page(page, bad_reason, bad_flags); 831 bad_page(page, bad_reason, bad_flags);
832}
833
834static inline int free_pages_check(struct page *page)
835{
836 if (likely(page_expected_state(page, PAGE_FLAGS_CHECK_AT_FREE))) {
837 page_cpupid_reset_last(page);
838 page->flags &= ~PAGE_FLAGS_CHECK_AT_PREP;
839 return 0;
840 }
841
842 /* Something has gone sideways, find it */
843 free_pages_check_bad(page);
839 return 1; 844 return 1;
840} 845}
841 846