Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 311842
b: refs/heads/master
c: 99ab7b1
h: refs/heads/master
v: v3
  • Loading branch information
Yinghai Lu authored and Linus Torvalds committed Jul 11, 2012
1 parent 432f202 commit 44ec217
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 8 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: 07b4e2bc9c35ea88cbd36d806fcd5e3bcbf022be
refs/heads/master: 99ab7b19440a72ebdf225f99b20f8ef40decee86
5 changes: 5 additions & 0 deletions trunk/include/linux/bootmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ extern void *__alloc_bootmem_node_nopanic(pg_data_t *pgdat,
unsigned long size,
unsigned long align,
unsigned long goal);
void *___alloc_bootmem_node_nopanic(pg_data_t *pgdat,
unsigned long size,
unsigned long align,
unsigned long goal,
unsigned long limit);
extern void *__alloc_bootmem_low(unsigned long size,
unsigned long align,
unsigned long goal);
Expand Down
2 changes: 1 addition & 1 deletion trunk/mm/bootmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ void * __init __alloc_bootmem(unsigned long size, unsigned long align,
return ___alloc_bootmem(size, align, goal, limit);
}

static void * __init ___alloc_bootmem_node_nopanic(pg_data_t *pgdat,
void * __init ___alloc_bootmem_node_nopanic(pg_data_t *pgdat,
unsigned long size, unsigned long align,
unsigned long goal, unsigned long limit)
{
Expand Down
2 changes: 1 addition & 1 deletion trunk/mm/nobootmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ void * __init __alloc_bootmem(unsigned long size, unsigned long align,
return ___alloc_bootmem(size, align, goal, limit);
}

static void * __init ___alloc_bootmem_node_nopanic(pg_data_t *pgdat,
void * __init ___alloc_bootmem_node_nopanic(pg_data_t *pgdat,
unsigned long size,
unsigned long align,
unsigned long goal,
Expand Down
18 changes: 13 additions & 5 deletions trunk/mm/sparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,9 @@ static unsigned long * __init
sparse_early_usemaps_alloc_pgdat_section(struct pglist_data *pgdat,
unsigned long size)
{
pg_data_t *host_pgdat;
unsigned long goal;
unsigned long goal, limit;
unsigned long *p;
int nid;
/*
* A page may contain usemaps for other sections preventing the
* page being freed and making a section unremovable while
Expand All @@ -288,9 +289,16 @@ sparse_early_usemaps_alloc_pgdat_section(struct pglist_data *pgdat,
* this problem.
*/
goal = __pa(pgdat) & (PAGE_SECTION_MASK << PAGE_SHIFT);
host_pgdat = NODE_DATA(early_pfn_to_nid(goal >> PAGE_SHIFT));
return __alloc_bootmem_node_nopanic(host_pgdat, size,
SMP_CACHE_BYTES, goal);
limit = goal + (1UL << PA_SECTION_SHIFT);
nid = early_pfn_to_nid(goal >> PAGE_SHIFT);
again:
p = ___alloc_bootmem_node_nopanic(NODE_DATA(nid), size,
SMP_CACHE_BYTES, goal, limit);
if (!p && limit) {
limit = 0;
goto again;
}
return p;
}

static void __init check_usemap_section_nr(int nid, unsigned long *usemap)
Expand Down

0 comments on commit 44ec217

Please sign in to comment.