Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
236a8daa
Commit
236a8daa
authored
Feb 16, 2003
by
Richard Henderson
Browse files
Options
Browse Files
Download
Plain Diff
Merge kanga.twiddle.net:/home/rth/linux/linus-2.5
into kanga.twiddle.net:/home/rth/linux/axp-2.5
parents
d3845a62
41b3b8c6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
29 deletions
+40
-29
arch/alpha/mm/numa.c
arch/alpha/mm/numa.c
+40
-29
No files found.
arch/alpha/mm/numa.c
View file @
236a8daa
...
@@ -64,6 +64,7 @@ setup_memory_node(int nid, void *kernel_end)
...
@@ -64,6 +64,7 @@ setup_memory_node(int nid, void *kernel_end)
unsigned
long
bootmap_size
,
bootmap_pages
,
bootmap_start
;
unsigned
long
bootmap_size
,
bootmap_pages
,
bootmap_start
;
unsigned
long
start
,
end
;
unsigned
long
start
,
end
;
unsigned
long
node_pfn_start
,
node_pfn_end
;
unsigned
long
node_pfn_start
,
node_pfn_end
;
unsigned
long
node_min_pfn
,
node_max_pfn
;
int
i
;
int
i
;
unsigned
long
node_datasz
=
PFN_UP
(
sizeof
(
pg_data_t
));
unsigned
long
node_datasz
=
PFN_UP
(
sizeof
(
pg_data_t
));
int
show_init
=
0
;
int
show_init
=
0
;
...
@@ -76,8 +77,9 @@ setup_memory_node(int nid, void *kernel_end)
...
@@ -76,8 +77,9 @@ setup_memory_node(int nid, void *kernel_end)
memdesc
=
(
struct
memdesc_struct
*
)
memdesc
=
(
struct
memdesc_struct
*
)
(
hwrpb
->
mddt_offset
+
(
unsigned
long
)
hwrpb
);
(
hwrpb
->
mddt_offset
+
(
unsigned
long
)
hwrpb
);
/* find the bounds of this node (min_low_pfn/max_low_pfn) */
/* find the bounds of this node (node_min_pfn/node_max_pfn) */
min_low_pfn
=
~
0UL
;
node_min_pfn
=
~
0UL
;
node_max_pfn
=
0UL
;
for_each_mem_cluster
(
memdesc
,
cluster
,
i
)
{
for_each_mem_cluster
(
memdesc
,
cluster
,
i
)
{
/* Bit 0 is console/PALcode reserved. Bit 1 is
/* Bit 0 is console/PALcode reserved. Bit 1 is
non-volatile memory -- we might want to mark
non-volatile memory -- we might want to mark
...
@@ -104,42 +106,48 @@ setup_memory_node(int nid, void *kernel_end)
...
@@ -104,42 +106,48 @@ setup_memory_node(int nid, void *kernel_end)
if
(
end
>
node_pfn_end
)
if
(
end
>
node_pfn_end
)
end
=
node_pfn_end
;
end
=
node_pfn_end
;
if
(
start
<
min_low
_pfn
)
if
(
start
<
node_min
_pfn
)
min_low
_pfn
=
start
;
node_min
_pfn
=
start
;
if
(
end
>
max_low
_pfn
)
if
(
end
>
node_max
_pfn
)
max_pfn
=
max_low
_pfn
=
end
;
node_max
_pfn
=
end
;
}
}
if
(
mem_size_limit
&&
max_low
_pfn
>
mem_size_limit
)
{
if
(
mem_size_limit
&&
node_max
_pfn
>
mem_size_limit
)
{
static
int
msg_shown
=
0
;
static
int
msg_shown
=
0
;
if
(
!
msg_shown
)
{
if
(
!
msg_shown
)
{
msg_shown
=
1
;
msg_shown
=
1
;
printk
(
"setup: forcing memory size to %ldK (from %ldK).
\n
"
,
printk
(
"setup: forcing memory size to %ldK (from %ldK).
\n
"
,
mem_size_limit
<<
(
PAGE_SHIFT
-
10
),
mem_size_limit
<<
(
PAGE_SHIFT
-
10
),
max_low
_pfn
<<
(
PAGE_SHIFT
-
10
));
node_max
_pfn
<<
(
PAGE_SHIFT
-
10
));
}
}
max_low
_pfn
=
mem_size_limit
;
node_max
_pfn
=
mem_size_limit
;
}
}
if
(
min_low_pfn
>=
max_low
_pfn
)
if
(
node_min_pfn
>=
node_max
_pfn
)
return
;
return
;
num_physpages
+=
max_low_pfn
-
min_low_pfn
;
/* Update global {min,max}_low_pfn from node information. */
if
(
node_min_pfn
<
min_low_pfn
)
min_low_pfn
=
node_min_pfn
;
if
(
node_max_pfn
>
max_low_pfn
)
max_pfn
=
max_low_pfn
=
node_max_pfn
;
num_physpages
+=
node_max_pfn
-
node_min_pfn
;
#if 0 /* we'll try this one again in a little while */
#if 0 /* we'll try this one again in a little while */
/* Cute trick to make sure our local node data is on local memory */
/* Cute trick to make sure our local node data is on local memory */
node_data[nid] = (pg_data_t *)(__va(
min_low
_pfn << PAGE_SHIFT));
node_data[nid] = (pg_data_t *)(__va(
node_min
_pfn << PAGE_SHIFT));
#endif
#endif
/* Quasi-mark the pg_data_t as in-use */
/* Quasi-mark the pg_data_t as in-use */
min_low
_pfn
+=
node_datasz
;
node_min
_pfn
+=
node_datasz
;
if
(
min_low_pfn
>=
max_low
_pfn
)
{
if
(
node_min_pfn
>=
node_max
_pfn
)
{
printk
(
" not enough mem to reserve NODE_DATA"
);
printk
(
" not enough mem to reserve NODE_DATA"
);
return
;
return
;
}
}
NODE_DATA
(
nid
)
->
bdata
=
&
node_bdata
[
nid
];
NODE_DATA
(
nid
)
->
bdata
=
&
node_bdata
[
nid
];
printk
(
" Detected node memory: start %8lu, end %8lu
\n
"
,
printk
(
" Detected node memory: start %8lu, end %8lu
\n
"
,
min_low_pfn
,
max_low
_pfn
);
node_min_pfn
,
node_max
_pfn
);
DBGDCONT
(
" DISCONTIG: node_data[%d] is at 0x%p
\n
"
,
nid
,
NODE_DATA
(
nid
));
DBGDCONT
(
" DISCONTIG: node_data[%d] is at 0x%p
\n
"
,
nid
,
NODE_DATA
(
nid
));
DBGDCONT
(
" DISCONTIG: NODE_DATA(%d)->bdata is at 0x%p
\n
"
,
nid
,
NODE_DATA
(
nid
)
->
bdata
);
DBGDCONT
(
" DISCONTIG: NODE_DATA(%d)->bdata is at 0x%p
\n
"
,
nid
,
NODE_DATA
(
nid
)
->
bdata
);
...
@@ -149,15 +157,15 @@ setup_memory_node(int nid, void *kernel_end)
...
@@ -149,15 +157,15 @@ setup_memory_node(int nid, void *kernel_end)
end_kernel_pfn
=
PFN_UP
(
virt_to_phys
(
kernel_end
));
end_kernel_pfn
=
PFN_UP
(
virt_to_phys
(
kernel_end
));
bootmap_start
=
-
1
;
bootmap_start
=
-
1
;
if
(
!
nid
&&
(
max_low_pfn
<
end_kernel_pfn
||
min_low
_pfn
>
start_kernel_pfn
))
if
(
!
nid
&&
(
node_max_pfn
<
end_kernel_pfn
||
node_min
_pfn
>
start_kernel_pfn
))
panic
(
"kernel loaded out of ram"
);
panic
(
"kernel loaded out of ram"
);
/* Zone start phys-addr must be 2^(MAX_ORDER-1) aligned */
/* Zone start phys-addr must be 2^(MAX_ORDER-1) aligned */
min_low_pfn
=
(
min_low
_pfn
+
((
1UL
<<
(
MAX_ORDER
-
1
))
-
1
))
&
~
((
1UL
<<
(
MAX_ORDER
-
1
))
-
1
);
node_min_pfn
=
(
node_min
_pfn
+
((
1UL
<<
(
MAX_ORDER
-
1
))
-
1
))
&
~
((
1UL
<<
(
MAX_ORDER
-
1
))
-
1
);
/* We need to know how many physically contiguous pages
/* We need to know how many physically contiguous pages
we'll need for the bootmap. */
we'll need for the bootmap. */
bootmap_pages
=
bootmem_bootmap_pages
(
max_low_pfn
-
min_low
_pfn
);
bootmap_pages
=
bootmem_bootmap_pages
(
node_max_pfn
-
node_min
_pfn
);
/* Now find a good region where to allocate the bootmap. */
/* Now find a good region where to allocate the bootmap. */
for_each_mem_cluster
(
memdesc
,
cluster
,
i
)
{
for_each_mem_cluster
(
memdesc
,
cluster
,
i
)
{
...
@@ -167,13 +175,13 @@ setup_memory_node(int nid, void *kernel_end)
...
@@ -167,13 +175,13 @@ setup_memory_node(int nid, void *kernel_end)
start
=
cluster
->
start_pfn
;
start
=
cluster
->
start_pfn
;
end
=
start
+
cluster
->
numpages
;
end
=
start
+
cluster
->
numpages
;
if
(
start
>=
max_low_pfn
||
end
<=
min_low
_pfn
)
if
(
start
>=
node_max_pfn
||
end
<=
node_min
_pfn
)
continue
;
continue
;
if
(
end
>
max_low
_pfn
)
if
(
end
>
node_max
_pfn
)
end
=
max_low
_pfn
;
end
=
node_max
_pfn
;
if
(
start
<
min_low
_pfn
)
if
(
start
<
node_min
_pfn
)
start
=
min_low
_pfn
;
start
=
node_min
_pfn
;
if
(
start
<
start_kernel_pfn
)
{
if
(
start
<
start_kernel_pfn
)
{
if
(
end
>
end_kernel_pfn
if
(
end
>
end_kernel_pfn
...
@@ -195,7 +203,7 @@ setup_memory_node(int nid, void *kernel_end)
...
@@ -195,7 +203,7 @@ setup_memory_node(int nid, void *kernel_end)
/* Allocate the bootmap and mark the whole MM as reserved. */
/* Allocate the bootmap and mark the whole MM as reserved. */
bootmap_size
=
init_bootmem_node
(
NODE_DATA
(
nid
),
bootmap_start
,
bootmap_size
=
init_bootmem_node
(
NODE_DATA
(
nid
),
bootmap_start
,
min_low_pfn
,
max_low
_pfn
);
node_min_pfn
,
node_max
_pfn
);
DBGDCONT
(
" bootmap_start %lu, bootmap_size %lu, bootmap_pages %lu
\n
"
,
DBGDCONT
(
" bootmap_start %lu, bootmap_size %lu, bootmap_pages %lu
\n
"
,
bootmap_start
,
bootmap_size
,
bootmap_pages
);
bootmap_start
,
bootmap_size
,
bootmap_pages
);
...
@@ -207,13 +215,13 @@ setup_memory_node(int nid, void *kernel_end)
...
@@ -207,13 +215,13 @@ setup_memory_node(int nid, void *kernel_end)
start
=
cluster
->
start_pfn
;
start
=
cluster
->
start_pfn
;
end
=
cluster
->
start_pfn
+
cluster
->
numpages
;
end
=
cluster
->
start_pfn
+
cluster
->
numpages
;
if
(
start
>=
max_low_pfn
||
end
<=
min_low
_pfn
)
if
(
start
>=
node_max_pfn
||
end
<=
node_min
_pfn
)
continue
;
continue
;
if
(
end
>
max_low
_pfn
)
if
(
end
>
node_max
_pfn
)
end
=
max_low
_pfn
;
end
=
node_max
_pfn
;
if
(
start
<
min_low
_pfn
)
if
(
start
<
node_min
_pfn
)
start
=
min_low
_pfn
;
start
=
node_min
_pfn
;
if
(
start
<
start_kernel_pfn
)
{
if
(
start
<
start_kernel_pfn
)
{
if
(
end
>
end_kernel_pfn
)
{
if
(
end
>
end_kernel_pfn
)
{
...
@@ -249,6 +257,9 @@ setup_memory(void *kernel_end)
...
@@ -249,6 +257,9 @@ setup_memory(void *kernel_end)
show_mem_layout
();
show_mem_layout
();
numnodes
=
0
;
numnodes
=
0
;
min_low_pfn
=
~
0UL
;
max_low_pfn
=
0UL
;
for
(
nid
=
0
;
nid
<
MAX_NUMNODES
;
nid
++
)
for
(
nid
=
0
;
nid
<
MAX_NUMNODES
;
nid
++
)
setup_memory_node
(
nid
,
kernel_end
);
setup_memory_node
(
nid
,
kernel_end
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment