|
@@ -31,6 +31,7 @@
|
|
|
#include <linux/memcontrol.h>
|
|
|
#include <linux/gfp.h>
|
|
|
#include <linux/uio.h>
|
|
|
+#include <linux/hugetlb.h>
|
|
|
|
|
|
#include "internal.h"
|
|
|
|
|
@@ -75,7 +76,14 @@ static void __put_compound_page(struct page *page)
|
|
|
{
|
|
|
compound_page_dtor *dtor;
|
|
|
|
|
|
- __page_cache_release(page);
|
|
|
+ /*
|
|
|
+ * __page_cache_release() is supposed to be called for thp, not for
|
|
|
+ * hugetlb. This is because hugetlb page does never have PageLRU set
|
|
|
+ * (it's never listed to any LRU lists) and no memcg routines should
|
|
|
+ * be called for hugetlb (it has a separate hugetlb_cgroup.)
|
|
|
+ */
|
|
|
+ if (!PageHuge(page))
|
|
|
+ __page_cache_release(page);
|
|
|
dtor = get_compound_page_dtor(page);
|
|
|
(*dtor)(page);
|
|
|
}
|