summaryrefslogtreecommitdiffstats
path: root/mm/page_owner.c
diff options
context:
space:
mode:
authorJoonsoo Kim <iamjoonsoo.kim@lge.com>2016-07-26 18:23:49 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-07-26 19:19:19 -0400
commita9627bc5e34e79ae80a33241b8a1501cc498e191 (patch)
treef3ecdabcbbbcbcc5b53c1aef2a24d3feab3be0d4 /mm/page_owner.c
parenta8efe1c982a22c95884dee1ddf2e721567d1f483 (diff)
mm/page_owner: introduce split_page_owner and replace manual handling
split_page() calls set_page_owner() to set up page_owner to each pages. But, it has a drawback that head page and the others have different stacktrace because callsite of set_page_owner() is slightly differnt. To avoid this problem, this patch copies head page's page_owner to the others. It needs to introduce new function, split_page_owner() but it also remove the other function, get_page_owner_gfp() so looks good to do. Link: http://lkml.kernel.org/r/1464230275-25791-4-git-send-email-iamjoonsoo.kim@lge.com Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com> Acked-by: Vlastimil Babka <vbabka@suse.cz> Cc: Mel Gorman <mgorman@techsingularity.net> Cc: Minchan Kim <minchan@kernel.org> Cc: Alexander Potapenko <glider@google.com> Cc: Hugh Dickins <hughd@google.com> Cc: Michal Hocko <mhocko@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_owner.c')
-rw-r--r--mm/page_owner.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/mm/page_owner.c b/mm/page_owner.c
index 437877f5b774..31b69437a3d6 100644
--- a/mm/page_owner.c
+++ b/mm/page_owner.c
@@ -94,17 +94,17 @@ void __set_page_owner_migrate_reason(struct page *page, int reason)
94 page_ext->last_migrate_reason = reason; 94 page_ext->last_migrate_reason = reason;
95} 95}
96 96
97gfp_t __get_page_owner_gfp(struct page *page) 97void __split_page_owner(struct page *page, unsigned int order)
98{ 98{
99 int i;
99 struct page_ext *page_ext = lookup_page_ext(page); 100 struct page_ext *page_ext = lookup_page_ext(page);
101
100 if (unlikely(!page_ext)) 102 if (unlikely(!page_ext))
101 /* 103 return;
102 * The caller just returns 0 if no valid gfp
103 * So return 0 here too.
104 */
105 return 0;
106 104
107 return page_ext->gfp_mask; 105 page_ext->order = 0;
106 for (i = 1; i < (1 << order); i++)
107 __copy_page_owner(page, page + i);
108} 108}
109 109
110void __copy_page_owner(struct page *oldpage, struct page *newpage) 110void __copy_page_owner(struct page *oldpage, struct page *newpage)