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
31d71284
Commit
31d71284
authored
Sep 21, 2002
by
Anton Blanchard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ppc64: DISCONTIGMEM updates
parent
657732b7
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
21 deletions
+31
-21
arch/ppc64/mm/init.c
arch/ppc64/mm/init.c
+17
-13
include/asm-ppc64/mmzone.h
include/asm-ppc64/mmzone.h
+4
-1
include/asm-ppc64/numnodes.h
include/asm-ppc64/numnodes.h
+6
-0
include/asm-ppc64/page.h
include/asm-ppc64/page.h
+3
-1
include/asm-ppc64/pgtable.h
include/asm-ppc64/pgtable.h
+1
-6
No files found.
arch/ppc64/mm/init.c
View file @
31d71284
...
@@ -99,16 +99,18 @@ mmu_gather_t mmu_gathers[NR_CPUS];
...
@@ -99,16 +99,18 @@ mmu_gather_t mmu_gathers[NR_CPUS];
void
show_mem
(
void
)
void
show_mem
(
void
)
{
{
int
pfn
,
total
=
0
,
reserved
=
0
;
int
total
=
0
,
reserved
=
0
;
int
shared
=
0
,
cached
=
0
;
int
shared
=
0
,
cached
=
0
;
struct
page
*
page
;
struct
page
*
page
;
pg_data_t
*
pgdat
;
unsigned
long
i
;
printk
(
"Mem-info:
\n
"
);
printk
(
"Mem-info:
\n
"
);
show_free_areas
();
show_free_areas
();
printk
(
"Free swap: %6dkB
\n
"
,
nr_swap_pages
<<
(
PAGE_SHIFT
-
10
));
printk
(
"Free swap: %6dkB
\n
"
,
nr_swap_pages
<<
(
PAGE_SHIFT
-
10
));
pfn
=
max_mapnr
;
for_each_pgdat
(
pgdat
)
{
while
(
pfn
--
>
0
)
{
for
(
i
=
0
;
i
<
pgdat
->
node_size
;
i
++
)
{
page
=
pfn_to_page
(
pfn
)
;
page
=
pgdat
->
node_mem_map
+
i
;
total
++
;
total
++
;
if
(
PageReserved
(
page
))
if
(
PageReserved
(
page
))
reserved
++
;
reserved
++
;
...
@@ -117,6 +119,7 @@ void show_mem(void)
...
@@ -117,6 +119,7 @@ void show_mem(void)
else
if
(
page_count
(
page
))
else
if
(
page_count
(
page
))
shared
+=
page_count
(
page
)
-
1
;
shared
+=
page_count
(
page
)
-
1
;
}
}
}
printk
(
"%d pages of RAM
\n
"
,
total
);
printk
(
"%d pages of RAM
\n
"
,
total
);
printk
(
"%d reserved pages
\n
"
,
reserved
);
printk
(
"%d reserved pages
\n
"
,
reserved
);
printk
(
"%d pages shared
\n
"
,
shared
);
printk
(
"%d pages shared
\n
"
,
shared
);
...
@@ -511,9 +514,8 @@ void __init mem_init(void)
...
@@ -511,9 +514,8 @@ void __init mem_init(void)
int
datapages
=
0
;
int
datapages
=
0
;
int
initpages
=
0
;
int
initpages
=
0
;
max_mapnr
=
max_low_pfn
;
num_physpages
=
max_low_pfn
;
/* RAM is assumed contiguous */
high_memory
=
(
void
*
)
__va
(
max_low_pfn
*
PAGE_SIZE
);
high_memory
=
(
void
*
)
__va
(
max_low_pfn
*
PAGE_SIZE
);
num_physpages
=
max_mapnr
;
/* RAM is assumed contiguous */
max_pfn
=
max_low_pfn
;
max_pfn
=
max_low_pfn
;
#ifdef CONFIG_DISCONTIGMEM
#ifdef CONFIG_DISCONTIGMEM
...
@@ -535,6 +537,8 @@ void __init mem_init(void)
...
@@ -535,6 +537,8 @@ void __init mem_init(void)
PAGE_OFFSET
,
(
unsigned
long
)
__va
(
lmb_end_of_DRAM
()));
PAGE_OFFSET
,
(
unsigned
long
)
__va
(
lmb_end_of_DRAM
()));
}
}
#else
#else
max_mapnr
=
num_physpages
;
totalram_pages
+=
free_all_bootmem
();
totalram_pages
+=
free_all_bootmem
();
if
(
sysmap_size
)
if
(
sysmap_size
)
...
...
include/asm-ppc64/mmzone.h
View file @
31d71284
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
#define _ASM_MMZONE_H_
#define _ASM_MMZONE_H_
#include <linux/config.h>
#include <linux/config.h>
#include <asm/smp.h>
#ifdef CONFIG_DISCONTIGMEM
#ifdef CONFIG_DISCONTIGMEM
...
@@ -21,7 +22,6 @@ extern int numa_node_exists[];
...
@@ -21,7 +22,6 @@ extern int numa_node_exists[];
extern
int
numa_cpu_lookup_table
[];
extern
int
numa_cpu_lookup_table
[];
extern
int
numa_memory_lookup_table
[];
extern
int
numa_memory_lookup_table
[];
#define MAX_NUMNODES 16
#define MAX_MEMORY (1UL << 41)
#define MAX_MEMORY (1UL << 41)
/* 256MB regions */
/* 256MB regions */
#define MEMORY_INCREMENT_SHIFT 28
#define MEMORY_INCREMENT_SHIFT 28
...
@@ -112,5 +112,8 @@ static inline int __cpu_to_node(int cpu)
...
@@ -112,5 +112,8 @@ static inline int __cpu_to_node(int cpu)
page_zone(__tmp)->zone_start_pfn); \
page_zone(__tmp)->zone_start_pfn); \
})
})
/* XXX fix for discontiguous physical memory */
#define discontigmem_pfn_valid(pfn) ((pfn) < num_physpages)
#endif
/* CONFIG_DISCONTIGMEM */
#endif
/* CONFIG_DISCONTIGMEM */
#endif
/* _ASM_MMZONE_H_ */
#endif
/* _ASM_MMZONE_H_ */
include/asm-ppc64/numnodes.h
0 → 100644
View file @
31d71284
#ifndef _ASM_MAX_NUMNODES_H
#define _ASM_MAX_NUMNODES_H
#define MAX_NUMNODES 16
#endif
/* _ASM_MAX_NUMNODES_H */
include/asm-ppc64/page.h
View file @
31d71284
...
@@ -207,13 +207,15 @@ static inline int get_order(unsigned long size)
...
@@ -207,13 +207,15 @@ static inline int get_order(unsigned long size)
#ifdef CONFIG_DISCONTIGMEM
#ifdef CONFIG_DISCONTIGMEM
#define page_to_pfn(page) discontigmem_page_to_pfn(page)
#define page_to_pfn(page) discontigmem_page_to_pfn(page)
#define pfn_to_page(pfn) discontigmem_pfn_to_page(pfn)
#define pfn_to_page(pfn) discontigmem_pfn_to_page(pfn)
#define pfn_valid(pfn) discontigmem_pfn_valid(pfn)
#else
#else
#define pfn_to_page(pfn) (mem_map + (pfn))
#define pfn_to_page(pfn) (mem_map + (pfn))
#define page_to_pfn(page) ((unsigned long)((page) - mem_map))
#define page_to_pfn(page) ((unsigned long)((page) - mem_map))
#define pfn_valid(pfn) ((pfn) < max_mapnr)
#endif
#endif
#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
#define pfn_valid(pfn) ((pfn) < max_mapnr)
#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
...
...
include/asm-ppc64/pgtable.h
View file @
31d71284
...
@@ -35,12 +35,7 @@
...
@@ -35,12 +35,7 @@
#define PTRS_PER_PMD (1 << PMD_INDEX_SIZE)
#define PTRS_PER_PMD (1 << PMD_INDEX_SIZE)
#define PTRS_PER_PGD (1 << PGD_INDEX_SIZE)
#define PTRS_PER_PGD (1 << PGD_INDEX_SIZE)
#if 0
#define USER_PTRS_PER_PGD (TASK_SIZE_USER64 / PGDIR_SIZE)
/* DRENG / PPPBBB This is a compiler bug!!! */
#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
#else
#define USER_PTRS_PER_PGD (1024)
#endif
#define FIRST_USER_PGD_NR 0
#define FIRST_USER_PGD_NR 0
#define EADDR_SIZE (PTE_INDEX_SIZE + PMD_INDEX_SIZE + \
#define EADDR_SIZE (PTE_INDEX_SIZE + PMD_INDEX_SIZE + \
...
...
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