diff options
author | Xishi Qiu <qiuxishi@huawei.com> | 2015-02-11 18:25:07 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-11 20:06:01 -0500 |
commit | 23f086f962e67a1b8a508c0d8e86b7833c941564 (patch) | |
tree | e76cfd9b87fe025fde008bbc3d8520cc7184a96c /mm/page_alloc.c | |
parent | 91fbdc0f89807bb97792ea6893717a8d3154b871 (diff) |
kmemcheck: move hook into __alloc_pages_nodemask() for the page allocator
Now kmemcheck_pagealloc_alloc() is only called by __alloc_pages_slowpath().
__alloc_pages_nodemask()
__alloc_pages_slowpath()
kmemcheck_pagealloc_alloc()
And the page will not be tracked by kmemcheck in the following path.
__alloc_pages_nodemask()
get_page_from_freelist()
So move kmemcheck_pagealloc_alloc() into __alloc_pages_nodemask(),
like this:
__alloc_pages_nodemask()
...
get_page_from_freelist()
if (!page)
__alloc_pages_slowpath()
kmemcheck_pagealloc_alloc()
...
Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
Cc: Vegard Nossum <vegard.nossum@oracle.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Li Zefan <lizefan@huawei.com>
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.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 1c7d90f7a84a..a88cb0cbf352 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -2842,11 +2842,7 @@ retry: | |||
2842 | 2842 | ||
2843 | nopage: | 2843 | nopage: |
2844 | warn_alloc_failed(gfp_mask, order, NULL); | 2844 | warn_alloc_failed(gfp_mask, order, NULL); |
2845 | return page; | ||
2846 | got_pg: | 2845 | got_pg: |
2847 | if (kmemcheck_enabled) | ||
2848 | kmemcheck_pagealloc_alloc(page, order, gfp_mask); | ||
2849 | |||
2850 | return page; | 2846 | return page; |
2851 | } | 2847 | } |
2852 | 2848 | ||
@@ -2916,6 +2912,9 @@ retry_cpuset: | |||
2916 | preferred_zone, classzone_idx, migratetype); | 2912 | preferred_zone, classzone_idx, migratetype); |
2917 | } | 2913 | } |
2918 | 2914 | ||
2915 | if (kmemcheck_enabled && page) | ||
2916 | kmemcheck_pagealloc_alloc(page, order, gfp_mask); | ||
2917 | |||
2919 | trace_mm_page_alloc(page, order, alloc_mask, migratetype); | 2918 | trace_mm_page_alloc(page, order, alloc_mask, migratetype); |
2920 | 2919 | ||
2921 | out: | 2920 | out: |