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
e3d87eab
Commit
e3d87eab
authored
Apr 26, 2003
by
Anton Blanchard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ppc64: clear up the cpu<-> node mappings, and cache them, from Matt Dobson
parent
43da12f7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
26 deletions
+22
-26
arch/ppc64/mm/init.c
arch/ppc64/mm/init.c
+1
-2
arch/ppc64/mm/numa.c
arch/ppc64/mm/numa.c
+10
-4
include/asm-ppc64/mmzone.h
include/asm-ppc64/mmzone.h
+1
-1
include/asm-ppc64/topology.h
include/asm-ppc64/topology.h
+10
-19
No files found.
arch/ppc64/mm/init.c
View file @
e3d87eab
...
...
@@ -69,8 +69,6 @@ struct mmu_context_queue_t mmu_context_queue;
int
mem_init_done
;
unsigned
long
ioremap_bot
=
IMALLOC_BASE
;
static
int
boot_mapsize
;
extern
pgd_t
swapper_pg_dir
[];
extern
char
__init_begin
,
__init_end
;
extern
char
_start
[],
_end
[];
...
...
@@ -454,6 +452,7 @@ void __init do_init_bootmem(void)
unsigned
long
i
;
unsigned
long
start
,
bootmap_pages
;
unsigned
long
total_pages
=
lmb_end_of_DRAM
()
>>
PAGE_SHIFT
;
int
boot_mapsize
;
/*
* Find an area to use for the bootmem bitmap. Calculate the size of
...
...
arch/ppc64/mm/numa.c
View file @
e3d87eab
...
...
@@ -24,10 +24,18 @@
int
numa_cpu_lookup_table
[
NR_CPUS
]
=
{
[
0
...
(
NR_CPUS
-
1
)]
=
-
1
};
int
numa_memory_lookup_table
[
MAX_MEMORY
>>
MEMORY_INCREMENT_SHIFT
]
=
{
[
0
...
((
MAX_MEMORY
>>
MEMORY_INCREMENT_SHIFT
)
-
1
)]
=
-
1
};
unsigned
long
numa_cpumask_lookup_table
[
MAX_NUMNODES
];
struct
pglist_data
node_data
[
MAX_NUMNODES
];
bootmem_data_t
plat_node_bdata
[
MAX_NUMNODES
];
static
inline
void
map_cpu_to_node
(
int
cpu
,
int
node
)
{
dbg
(
"cpu %d maps to domain %d
\n
"
,
cpu
,
node
);
numa_cpu_lookup_table
[
cpu
]
=
node
;
numa_cpumask_lookup_table
[
node
]
|=
1UL
<<
cpu
;
}
static
int
__init
parse_numa_properties
(
void
)
{
struct
device_node
*
cpu
;
...
...
@@ -87,9 +95,7 @@ static int __init parse_numa_properties(void)
if
(
max_domain
<
numa_domain
)
max_domain
=
numa_domain
;
numa_cpu_lookup_table
[
cpu_nr
]
=
numa_domain
;
dbg
(
"cpu %d maps to domain %d
\n
"
,
cpu_nr
,
numa_domain
);
map_cpu_to_node
(
cpu_nr
,
numa_domain
);
}
for
(
memory
=
find_type_devices
(
"memory"
);
memory
;
...
...
@@ -134,7 +140,7 @@ static int __init parse_numa_properties(void)
/* FIXME */
if
(
numa_domain
==
0xffff
)
{
dbg
(
"
cpu
has no numa doman
\n
"
);
dbg
(
"
memory
has no numa doman
\n
"
);
numa_domain
=
0
;
}
...
...
include/asm-ppc64/mmzone.h
View file @
e3d87eab
...
...
@@ -18,9 +18,9 @@ extern struct pglist_data node_data[];
* Following are specific to this numa platform.
*/
extern
int
numa_node_exists
[];
extern
int
numa_cpu_lookup_table
[];
extern
int
numa_memory_lookup_table
[];
extern
unsigned
long
numa_cpumask_lookup_table
[];
#define MAX_MEMORY (1UL << 41)
/* 256MB regions */
...
...
include/asm-ppc64/topology.h
View file @
e3d87eab
...
...
@@ -20,32 +20,23 @@ static inline int cpu_to_node(int cpu)
return
node
;
}
static
inline
int
node_to_first_cpu
(
int
node
)
{
int
cpu
;
#define memblk_to_node(memblk) (memblk)
for
(
cpu
=
0
;
cpu
<
NR_CPUS
;
cpu
++
)
if
(
numa_cpu_lookup_table
[
cpu
]
==
node
)
return
cpu
;
BUG
();
/* couldn't find a cpu on given node */
return
-
1
;
}
#define parent_node(node) (node)
static
inline
unsigned
long
node_to_cpumask
(
int
node
)
{
int
cpu
;
unsigned
long
mask
=
0UL
;
return
numa_cpumask_lookup_table
[
node
]
;
}
if
(
sizeof
(
unsigned
long
)
*
8
<
NR_CPUS
)
BUG
();
static
inline
int
node_to_first_cpu
(
int
node
)
{
return
__ffs
(
node_to_cpumask
(
node
));
}
for
(
cpu
=
0
;
cpu
<
NR_CPUS
;
cpu
++
)
if
(
numa_cpu_lookup_table
[
cpu
]
==
node
)
mask
|=
1UL
<<
cpu
;
#define node_to_memblk(node) (node)
return
mask
;
}
#define pcibus_to_cpumask(bus) (cpu_online_map)
/* Cross-node load balancing interval. */
#define NODE_BALANCE_RATE 10
...
...
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