Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mariux64
/
linux
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
2
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
68ad8df
Documentation
arch
block
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
Kconfig
Makefile
allocpercpu.c
backing-dev.c
bootmem.c
bounce.c
dmapool.c
fadvise.c
filemap.c
filemap_xip.c
fremap.c
highmem.c
hugetlb.c
internal.h
maccess.c
madvise.c
memcontrol.c
memory.c
memory_hotplug.c
mempolicy.c
mempool.c
migrate.c
mincore.c
mlock.c
mm_init.c
mmap.c
mmzone.c
mprotect.c
mremap.c
msync.c
nommu.c
oom_kill.c
page-writeback.c
page_alloc.c
page_io.c
page_isolation.c
pagewalk.c
pdflush.c
prio_tree.c
quicklist.c
readahead.c
rmap.c
shmem.c
shmem_acl.c
slab.c
slob.c
slub.c
sparse-vmemmap.c
sparse.c
swap.c
swap_state.c
swapfile.c
thrash.c
tiny-shmem.c
truncate.c
util.c
vmalloc.c
vmscan.c
vmstat.c
net
samples
scripts
security
sound
usr
virt
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
MAINTAINERS
Makefile
README
REPORTING-BUGS
Breadcrumbs
linux
/
mm
/
mm_init.c
Blame
Blame
Latest commit
History
History
134 lines (120 loc) · 3.41 KB
Breadcrumbs
linux
/
mm
/
mm_init.c
Top
File metadata and controls
Code
Blame
134 lines (120 loc) · 3.41 KB
Raw
/* * mm_init.c - Memory initialisation verification and debugging * * Copyright 2008 IBM Corporation, 2008 * Author Mel Gorman <mel@csn.ul.ie> * */ #include <linux/kernel.h> #include <linux/init.h> #include "internal.h" int __meminitdata mminit_loglevel; /* The zonelists are simply reported, validation is manual. */ void mminit_verify_zonelist(void) { int nid; if (mminit_loglevel < MMINIT_VERIFY) return; for_each_online_node(nid) { pg_data_t *pgdat = NODE_DATA(nid); struct zone *zone; struct zoneref *z; struct zonelist *zonelist; int i, listid, zoneid; BUG_ON(MAX_ZONELISTS > 2); for (i = 0; i < MAX_ZONELISTS * MAX_NR_ZONES; i++) { /* Identify the zone and nodelist */ zoneid = i % MAX_NR_ZONES; listid = i / MAX_NR_ZONES; zonelist = &pgdat->node_zonelists[listid]; zone = &pgdat->node_zones[zoneid]; if (!populated_zone(zone)) continue; /* Print information about the zonelist */ printk(KERN_DEBUG "mminit::zonelist %s %d:%s = ", listid > 0 ? "thisnode" : "general", nid, zone->name); /* Iterate the zonelist */ for_each_zone_zonelist(zone, z, zonelist, zoneid) { #ifdef CONFIG_NUMA printk(KERN_CONT "%d:%s ", zone->node, zone->name); #else printk(KERN_CONT "0:%s ", zone->name); #endif /* CONFIG_NUMA */ } printk(KERN_CONT "\n"); } } } void __init mminit_verify_pageflags_layout(void) { int shift, width; unsigned long or_mask, add_mask; shift = 8 * sizeof(unsigned long); width = shift - SECTIONS_WIDTH - NODES_WIDTH - ZONES_WIDTH; mminit_dprintk(MMINIT_TRACE, "pageflags_layout_widths", "Section %d Node %d Zone %d Flags %d\n", SECTIONS_WIDTH, NODES_WIDTH, ZONES_WIDTH, NR_PAGEFLAGS); mminit_dprintk(MMINIT_TRACE, "pageflags_layout_shifts", "Section %d Node %d Zone %d\n", #ifdef SECTIONS_SHIFT SECTIONS_SHIFT, #else 0, #endif NODES_SHIFT, ZONES_SHIFT); mminit_dprintk(MMINIT_TRACE, "pageflags_layout_offsets", "Section %lu Node %lu Zone %lu\n", (unsigned long)SECTIONS_PGSHIFT, (unsigned long)NODES_PGSHIFT, (unsigned long)ZONES_PGSHIFT); mminit_dprintk(MMINIT_TRACE, "pageflags_layout_zoneid", "Zone ID: %lu -> %lu\n", (unsigned long)ZONEID_PGOFF, (unsigned long)(ZONEID_PGOFF + ZONEID_SHIFT)); mminit_dprintk(MMINIT_TRACE, "pageflags_layout_usage", "location: %d -> %d unused %d -> %d flags %d -> %d\n", shift, width, width, NR_PAGEFLAGS, NR_PAGEFLAGS, 0); #ifdef NODE_NOT_IN_PAGE_FLAGS mminit_dprintk(MMINIT_TRACE, "pageflags_layout_nodeflags", "Node not in page flags"); #endif if (SECTIONS_WIDTH) { shift -= SECTIONS_WIDTH; BUG_ON(shift != SECTIONS_PGSHIFT); } if (NODES_WIDTH) { shift -= NODES_WIDTH; BUG_ON(shift != NODES_PGSHIFT); } if (ZONES_WIDTH) { shift -= ZONES_WIDTH; BUG_ON(shift != ZONES_PGSHIFT); } /* Check for bitmask overlaps */ or_mask = (ZONES_MASK << ZONES_PGSHIFT) | (NODES_MASK << NODES_PGSHIFT) | (SECTIONS_MASK << SECTIONS_PGSHIFT); add_mask = (ZONES_MASK << ZONES_PGSHIFT) + (NODES_MASK << NODES_PGSHIFT) + (SECTIONS_MASK << SECTIONS_PGSHIFT); BUG_ON(or_mask != add_mask); } void __meminit mminit_verify_page_links(struct page *page, enum zone_type zone, unsigned long nid, unsigned long pfn) { BUG_ON(page_to_nid(page) != nid); BUG_ON(page_zonenum(page) != zone); BUG_ON(page_to_pfn(page) != pfn); } static __init int set_mminit_loglevel(char *str) { get_option(&str, &mminit_loglevel); return 0; } early_param("mminit_loglevel", set_mminit_loglevel);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
You can’t perform that action at this time.