X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=mm%2Fswap_state.c;h=5c8cfabbc9bc3abdbf7f342656ea8c58b727aae8;hb=HEAD;hp=e10f5833167f6d5b564a534484985dc3c7dee745;hpb=f43100ae39bfeb757b75835ef61f0c2c46c99348;p=mv-sheeva.git diff --git a/mm/swap_state.c b/mm/swap_state.c index e10f5833167..5c8cfabbc9b 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c @@ -157,6 +157,12 @@ int add_to_swap(struct page *page) if (!entry.val) return 0; + if (unlikely(PageTransHuge(page))) + if (unlikely(split_huge_page(page))) { + swapcache_free(entry, NULL); + return 0; + } + /* * Radix-tree node allocations from PF_MEMALLOC contexts could * completely exhaust the page allocator. __GFP_NOMEMALLOC