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
ba89e64d
Commit
ba89e64d
authored
Oct 16, 2003
by
Jesse Barnes
Committed by
David Mosberger
Oct 16, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] ia64: fix topology init
Populate topology directories correctly now that NUMA kernels work.
parent
ba1b98db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
arch/ia64/mm/numa.c
arch/ia64/mm/numa.c
+53
-0
No files found.
arch/ia64/mm/numa.c
View file @
ba89e64d
...
...
@@ -11,12 +11,19 @@
*/
#include <linux/config.h>
#include <linux/cpu.h>
#include <linux/kernel.h>
#include <linux/memblk.h>
#include <linux/mm.h>
#include <linux/node.h>
#include <linux/init.h>
#include <linux/bootmem.h>
#include <asm/numa.h>
static
struct
memblk
*
sysfs_memblks
;
static
struct
node
*
sysfs_nodes
;
static
struct
cpu
*
sysfs_cpus
;
/*
* The following structures are usually initialized by ACPI or
* similar mechanisms and describe the NUMA characteristics of the machine.
...
...
@@ -43,3 +50,49 @@ paddr_to_nid(unsigned long paddr)
return
(
i
<
num_memblks
)
?
node_memblk
[
i
].
nid
:
(
num_memblks
?
-
1
:
0
);
}
static
int
__init
topology_init
(
void
)
{
int
i
,
err
=
0
;
sysfs_nodes
=
kmalloc
(
sizeof
(
struct
node
)
*
numnodes
,
GFP_KERNEL
);
if
(
!
sysfs_nodes
)
{
err
=
-
ENOMEM
;
goto
out
;
}
sysfs_memblks
=
kmalloc
(
sizeof
(
struct
memblk
)
*
num_memblks
,
GFP_KERNEL
);
if
(
!
sysfs_memblks
)
{
kfree
(
sysfs_nodes
);
err
=
-
ENOMEM
;
goto
out
;
}
sysfs_cpus
=
kmalloc
(
sizeof
(
struct
cpu
)
*
NR_CPUS
,
GFP_KERNEL
);
if
(
!
sysfs_cpus
)
{
kfree
(
sysfs_memblks
);
kfree
(
sysfs_nodes
);
err
=
-
ENOMEM
;
goto
out
;
}
for
(
i
=
0
;
i
<
numnodes
;
i
++
)
if
((
err
=
register_node
(
&
sysfs_nodes
[
i
],
i
,
0
)))
goto
out
;
for
(
i
=
0
;
i
<
num_memblks
;
i
++
)
if
((
err
=
register_memblk
(
&
sysfs_memblks
[
i
],
i
,
&
sysfs_nodes
[
memblk_to_node
(
i
)])))
goto
out
;
for
(
i
=
0
;
i
<
NR_CPUS
;
i
++
)
if
(
cpu_online
(
i
))
if
((
err
=
register_cpu
(
&
sysfs_cpus
[
i
],
i
,
&
sysfs_nodes
[
cpu_to_node
(
i
)])))
goto
out
;
out:
return
err
;
}
__initcall
(
topology_init
);
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