Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 349787
b: refs/heads/master
c: 7c45512
h: refs/heads/master
i:
  349785: a6f5694
  349783: 4e801c8
v: v3
  • Loading branch information
Linus Torvalds committed Feb 18, 2013
1 parent 0e2e972 commit 4ca8e80
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 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: f741656d646f7a5b56ba86765205b954237e7956
refs/heads/master: 7c45512df987c5619db041b5c9b80d281e26d3db
15 changes: 9 additions & 6 deletions trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4420,10 +4420,11 @@ static void __meminit calculate_node_totalpages(struct pglist_data *pgdat,
* round what is now in bits to nearest long in bits, then return it in
* bytes.
*/
static unsigned long __init usemap_size(unsigned long zonesize)
static unsigned long __init usemap_size(unsigned long zone_start_pfn, unsigned long zonesize)
{
unsigned long usemapsize;

zonesize += zone_start_pfn & (pageblock_nr_pages-1);
usemapsize = roundup(zonesize, pageblock_nr_pages);
usemapsize = usemapsize >> pageblock_order;
usemapsize *= NR_PAGEBLOCK_BITS;
Expand All @@ -4433,17 +4434,19 @@ static unsigned long __init usemap_size(unsigned long zonesize)
}

static void __init setup_usemap(struct pglist_data *pgdat,
struct zone *zone, unsigned long zonesize)
struct zone *zone,
unsigned long zone_start_pfn,
unsigned long zonesize)
{
unsigned long usemapsize = usemap_size(zonesize);
unsigned long usemapsize = usemap_size(zone_start_pfn, zonesize);
zone->pageblock_flags = NULL;
if (usemapsize)
zone->pageblock_flags = alloc_bootmem_node_nopanic(pgdat,
usemapsize);
}
#else
static inline void setup_usemap(struct pglist_data *pgdat,
struct zone *zone, unsigned long zonesize) {}
static inline void setup_usemap(struct pglist_data *pgdat, struct zone *zone,
unsigned long zone_start_pfn, unsigned long zonesize) {}
#endif /* CONFIG_SPARSEMEM */

#ifdef CONFIG_HUGETLB_PAGE_SIZE_VARIABLE
Expand Down Expand Up @@ -4594,7 +4597,7 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat,
continue;

set_pageblock_order();
setup_usemap(pgdat, zone, size);
setup_usemap(pgdat, zone, zone_start_pfn, size);
ret = init_currently_empty_zone(zone, zone_start_pfn,
size, MEMMAP_EARLY);
BUG_ON(ret);
Expand Down

0 comments on commit 4ca8e80

Please sign in to comment.