hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/lib/show_mem.c
....@@ -1,14 +1,13 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Generic show_mem() implementation
34 *
45 * Copyright (C) 2008 Johannes Weiner <hannes@saeurebad.de>
5
- * All code subject to the GPL version 2.
66 */
77
88 #include <linux/mm.h>
9
-#include <linux/quicklist.h>
109 #include <linux/cma.h>
11
-
10
+#include <trace/hooks/mm.h>
1211 void show_mem(unsigned int filter, nodemask_t *nodemask)
1312 {
1413 pg_data_t *pgdat;
....@@ -18,22 +17,19 @@
1817 show_free_areas(filter, nodemask);
1918
2019 for_each_online_pgdat(pgdat) {
21
- unsigned long flags;
2220 int zoneid;
2321
24
- pgdat_resize_lock(pgdat, &flags);
2522 for (zoneid = 0; zoneid < MAX_NR_ZONES; zoneid++) {
2623 struct zone *zone = &pgdat->node_zones[zoneid];
2724 if (!populated_zone(zone))
2825 continue;
2926
3027 total += zone->present_pages;
31
- reserved += zone->present_pages - zone->managed_pages;
28
+ reserved += zone->present_pages - zone_managed_pages(zone);
3229
3330 if (is_highmem_idx(zoneid))
3431 highmem += zone->present_pages;
3532 }
36
- pgdat_resize_unlock(pgdat, &flags);
3733 }
3834
3935 printk("%lu pages RAM\n", total);
....@@ -42,11 +38,9 @@
4238 #ifdef CONFIG_CMA
4339 printk("%lu pages cma reserved\n", totalcma_pages);
4440 #endif
45
-#ifdef CONFIG_QUICKLIST
46
- printk("%lu pages in pagetable cache\n",
47
- quicklist_total_size());
48
-#endif
4941 #ifdef CONFIG_MEMORY_FAILURE
5042 printk("%lu pages hwpoisoned\n", atomic_long_read(&num_poisoned_pages));
5143 #endif
44
+ trace_android_vh_show_mem(filter, nodemask);
5245 }
46
+EXPORT_SYMBOL_GPL(show_mem);