]> git.ipfire.org Git - thirdparty/kernel/linux.git/blobdiff - mm/page_alloc.c
mm: rename and change semantics of nr_indirectly_reclaimable_bytes
[thirdparty/kernel/linux.git] / mm / page_alloc.c
index 747031c2352db1a7fe51ddd2549af4a3215bdce8..20f25d06c00c14dd3a83cd9e21bb8680cd00135c 100644 (file)
@@ -4701,6 +4701,7 @@ long si_mem_available(void)
        unsigned long pagecache;
        unsigned long wmark_low = 0;
        unsigned long pages[NR_LRU_LISTS];
+       unsigned long reclaimable;
        struct zone *zone;
        int lru;
 
@@ -4726,19 +4727,13 @@ long si_mem_available(void)
        available += pagecache;
 
        /*
-        * Part of the reclaimable slab consists of items that are in use,
-        * and cannot be freed. Cap this estimate at the low watermark.
+        * Part of the reclaimable slab and other kernel memory consists of
+        * items that are in use, and cannot be freed. Cap this estimate at the
+        * low watermark.
         */
-       available += global_node_page_state(NR_SLAB_RECLAIMABLE) -
-                    min(global_node_page_state(NR_SLAB_RECLAIMABLE) / 2,
-                        wmark_low);
-
-       /*
-        * Part of the kernel memory, which can be released under memory
-        * pressure.
-        */
-       available += global_node_page_state(NR_INDIRECTLY_RECLAIMABLE_BYTES) >>
-               PAGE_SHIFT;
+       reclaimable = global_node_page_state(NR_SLAB_RECLAIMABLE) +
+                       global_node_page_state(NR_KERNEL_MISC_RECLAIMABLE);
+       available += reclaimable - min(reclaimable / 2, wmark_low);
 
        if (available < 0)
                available = 0;