Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2851
b: refs/heads/master
c: 5b505b9
h: refs/heads/master
i:
  2849: f32a655
  2847: 8bcad39
v: v3
  • Loading branch information
Dave Hansen authored and Linus Torvalds committed Jun 23, 2005
1 parent 9da3f71 commit 2167214
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 348f8b6c4837a07304d2f72b11ce8d96588065e0
refs/heads/master: 5b505b90b2d54e526cc8d123bdef3b98c9f0bbc6
14 changes: 14 additions & 0 deletions trunk/arch/i386/mm/discontig.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ static unsigned long calculate_numa_remap_pages(void)
{
int nid;
unsigned long size, reserve_pages = 0;
unsigned long pfn;

for_each_online_node(nid) {
/*
Expand All @@ -234,6 +235,19 @@ static unsigned long calculate_numa_remap_pages(void)
size = (size + LARGE_PAGE_BYTES - 1) / LARGE_PAGE_BYTES;
/* now the roundup is correct, convert to PAGE_SIZE pages */
size = size * PTRS_PER_PTE;

/*
* Validate the region we are allocating only contains valid
* pages.
*/
for (pfn = node_end_pfn[nid] - size;
pfn < node_end_pfn[nid]; pfn++)
if (!page_is_ram(pfn))
break;

if (pfn != node_end_pfn[nid])
size = 0;

printk("Reserving %ld pages of KVA for lmem_map of node %d\n",
size, nid);
node_remap_size[nid] = size;
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/i386/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ static inline int page_kills_ppro(unsigned long pagenr)

extern int is_available_memory(efi_memory_desc_t *);

static inline int page_is_ram(unsigned long pagenr)
int page_is_ram(unsigned long pagenr)
{
int i;
unsigned long addr, end;
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/asm-i386/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ static __inline__ int get_order(unsigned long size)

extern int sysctl_legacy_va_layout;

extern int page_is_ram(unsigned long pagenr);

#endif /* __ASSEMBLY__ */

#ifdef __ASSEMBLY__
Expand Down

0 comments on commit 2167214

Please sign in to comment.