.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Generic show_mem() implementation |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2008 Johannes Weiner <hannes@saeurebad.de> |
---|
5 | | - * All code subject to the GPL version 2. |
---|
6 | 6 | */ |
---|
7 | 7 | |
---|
8 | 8 | #include <linux/mm.h> |
---|
9 | | -#include <linux/quicklist.h> |
---|
10 | 9 | #include <linux/cma.h> |
---|
11 | | - |
---|
| 10 | +#include <trace/hooks/mm.h> |
---|
12 | 11 | void show_mem(unsigned int filter, nodemask_t *nodemask) |
---|
13 | 12 | { |
---|
14 | 13 | pg_data_t *pgdat; |
---|
.. | .. |
---|
18 | 17 | show_free_areas(filter, nodemask); |
---|
19 | 18 | |
---|
20 | 19 | for_each_online_pgdat(pgdat) { |
---|
21 | | - unsigned long flags; |
---|
22 | 20 | int zoneid; |
---|
23 | 21 | |
---|
24 | | - pgdat_resize_lock(pgdat, &flags); |
---|
25 | 22 | for (zoneid = 0; zoneid < MAX_NR_ZONES; zoneid++) { |
---|
26 | 23 | struct zone *zone = &pgdat->node_zones[zoneid]; |
---|
27 | 24 | if (!populated_zone(zone)) |
---|
28 | 25 | continue; |
---|
29 | 26 | |
---|
30 | 27 | total += zone->present_pages; |
---|
31 | | - reserved += zone->present_pages - zone->managed_pages; |
---|
| 28 | + reserved += zone->present_pages - zone_managed_pages(zone); |
---|
32 | 29 | |
---|
33 | 30 | if (is_highmem_idx(zoneid)) |
---|
34 | 31 | highmem += zone->present_pages; |
---|
35 | 32 | } |
---|
36 | | - pgdat_resize_unlock(pgdat, &flags); |
---|
37 | 33 | } |
---|
38 | 34 | |
---|
39 | 35 | printk("%lu pages RAM\n", total); |
---|
.. | .. |
---|
42 | 38 | #ifdef CONFIG_CMA |
---|
43 | 39 | printk("%lu pages cma reserved\n", totalcma_pages); |
---|
44 | 40 | #endif |
---|
45 | | -#ifdef CONFIG_QUICKLIST |
---|
46 | | - printk("%lu pages in pagetable cache\n", |
---|
47 | | - quicklist_total_size()); |
---|
48 | | -#endif |
---|
49 | 41 | #ifdef CONFIG_MEMORY_FAILURE |
---|
50 | 42 | printk("%lu pages hwpoisoned\n", atomic_long_read(&num_poisoned_pages)); |
---|
51 | 43 | #endif |
---|
| 44 | + trace_android_vh_show_mem(filter, nodemask); |
---|
52 | 45 | } |
---|
| 46 | +EXPORT_SYMBOL_GPL(show_mem); |
---|