mm: reference totalram_pages and managed_pages once per function
[linux] / net / dccp / proto.c
index 2cc5fbb..ff727ff 100644 (file)
@@ -1131,6 +1131,7 @@ EXPORT_SYMBOL_GPL(dccp_debug);
 static int __init dccp_init(void)
 {
        unsigned long goal;
+       unsigned long nr_pages = totalram_pages;
        int ehash_order, bhash_order, i;
        int rc;
 
@@ -1157,10 +1158,10 @@ static int __init dccp_init(void)
         *
         * The methodology is similar to that of the buffer cache.
         */
-       if (totalram_pages >= (128 * 1024))
-               goal = totalram_pages >> (21 - PAGE_SHIFT);
+       if (nr_pages >= (128 * 1024))
+               goal = nr_pages >> (21 - PAGE_SHIFT);
        else
-               goal = totalram_pages >> (23 - PAGE_SHIFT);
+               goal = nr_pages >> (23 - PAGE_SHIFT);
 
        if (thash_entries)
                goal = (thash_entries *