Merge tag 'v3.10.106' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / mm / swap.c
index ea58dbde788ed6fdee09243be247841f57a68da9..de77948c97195fa4995cc612f5d6f42b23250165 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -81,7 +81,7 @@ static void put_compound_page(struct page *page)
 {
        if (unlikely(PageTail(page))) {
                /* __split_huge_page_refcount can run under us */
-               struct page *page_head = compound_trans_head(page);
+               struct page *page_head = compound_head(page);
 
                if (likely(page != page_head &&
                           get_page_unless_zero(page_head))) {
@@ -219,7 +219,7 @@ bool __get_page_tail(struct page *page)
         */
        unsigned long flags;
        bool got = false;
-       struct page *page_head = compound_trans_head(page);
+       struct page *page_head = compound_head(page);
 
        if (likely(page != page_head && get_page_unless_zero(page_head))) {
                /* Ref to put_compound_page() comment. */
@@ -922,10 +922,14 @@ void __init swap_setup(void)
 #endif
 
        /* Use a smaller cluster for small-memory machines */
+#ifdef CONFIG_ZRAM
+       page_cluster = 0; // disable swap read-ahead
+#else  
        if (megs < 16)
                page_cluster = 2;
        else
                page_cluster = 3;
+#endif         
        /*
         * Right now other parts of the system means that we
         * _really_ don't want to cluster much more