diff options
Diffstat (limited to 'mm/swap_state.c')
-rw-r--r-- | mm/swap_state.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/swap_state.c b/mm/swap_state.c index e10f5833167f..5c8cfabbc9bc 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c | |||
@@ -157,6 +157,12 @@ int add_to_swap(struct page *page) | |||
157 | if (!entry.val) | 157 | if (!entry.val) |
158 | return 0; | 158 | return 0; |
159 | 159 | ||
160 | if (unlikely(PageTransHuge(page))) | ||
161 | if (unlikely(split_huge_page(page))) { | ||
162 | swapcache_free(entry, NULL); | ||
163 | return 0; | ||
164 | } | ||
165 | |||
160 | /* | 166 | /* |
161 | * Radix-tree node allocations from PF_MEMALLOC contexts could | 167 | * Radix-tree node allocations from PF_MEMALLOC contexts could |
162 | * completely exhaust the page allocator. __GFP_NOMEMALLOC | 168 | * completely exhaust the page allocator. __GFP_NOMEMALLOC |