Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 335797
b: refs/heads/master
c: 5576646
h: refs/heads/master
i:
  335795: bf7b34d
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Nov 16, 2012
1 parent b8da0d1 commit d124ac7
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 59 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: 0f3c42f522dc1ad7e27affc0a4aa8c790bce0a66
refs/heads/master: 5576646f3c1abd60d72d19829de6f5d8c2ca8ecf
1 change: 0 additions & 1 deletion trunk/arch/ia64/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,6 @@ mem_init (void)

high_memory = __va(max_low_pfn * PAGE_SIZE);

reset_zone_present_pages();
for_each_online_pgdat(pgdat)
if (pgdat->bdata->node_bootmem_map)
totalram_pages += free_all_bootmem_node(pgdat);
Expand Down
4 changes: 0 additions & 4 deletions trunk/include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -1684,9 +1684,5 @@ static inline unsigned int debug_guardpage_minorder(void) { return 0; }
static inline bool page_is_guard(struct page *page) { return false; }
#endif /* CONFIG_DEBUG_PAGEALLOC */

extern void reset_zone_present_pages(void);
extern void fixup_zone_present_pages(int nid, unsigned long start_pfn,
unsigned long end_pfn);

#endif /* __KERNEL__ */
#endif /* _LINUX_MM_H */
10 changes: 1 addition & 9 deletions trunk/mm/bootmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,6 @@ static unsigned long __init free_all_bootmem_core(bootmem_data_t *bdata)
int order = ilog2(BITS_PER_LONG);

__free_pages_bootmem(pfn_to_page(start), order);
fixup_zone_present_pages(page_to_nid(pfn_to_page(start)),
start, start + BITS_PER_LONG);
count += BITS_PER_LONG;
start += BITS_PER_LONG;
} else {
Expand All @@ -210,9 +208,6 @@ static unsigned long __init free_all_bootmem_core(bootmem_data_t *bdata)
if (vec & 1) {
page = pfn_to_page(start + off);
__free_pages_bootmem(page, 0);
fixup_zone_present_pages(
page_to_nid(page),
start + off, start + off + 1);
count++;
}
vec >>= 1;
Expand All @@ -226,11 +221,8 @@ static unsigned long __init free_all_bootmem_core(bootmem_data_t *bdata)
pages = bdata->node_low_pfn - bdata->node_min_pfn;
pages = bootmem_bootmap_pages(pages);
count += pages;
while (pages--) {
fixup_zone_present_pages(page_to_nid(page),
page_to_pfn(page), page_to_pfn(page) + 1);
while (pages--)
__free_pages_bootmem(page++, 0);
}

bdebug("nid=%td released=%lx\n", bdata - bootmem_node_data, count);

Expand Down
7 changes: 0 additions & 7 deletions trunk/mm/memory_hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ static void get_page_bootmem(unsigned long info, struct page *page,
void __ref put_page_bootmem(struct page *page)
{
unsigned long type;
struct zone *zone;

type = (unsigned long) page->lru.next;
BUG_ON(type < MEMORY_HOTPLUG_MIN_BOOTMEM_TYPE ||
Expand All @@ -117,12 +116,6 @@ void __ref put_page_bootmem(struct page *page)
set_page_private(page, 0);
INIT_LIST_HEAD(&page->lru);
__free_pages_bootmem(page, 0);

zone = page_zone(page);
zone_span_writelock(zone);
zone->present_pages++;
zone_span_writeunlock(zone);
totalram_pages++;
}

}
Expand Down
3 changes: 0 additions & 3 deletions trunk/mm/nobootmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ static unsigned long __init __free_memory_core(phys_addr_t start,
return 0;

__free_pages_memory(start_pfn, end_pfn);
fixup_zone_present_pages(pfn_to_nid(start >> PAGE_SHIFT),
start_pfn, end_pfn);

return end_pfn - start_pfn;
}
Expand All @@ -128,7 +126,6 @@ unsigned long __init free_low_memory_core_early(int nodeid)
phys_addr_t start, end, size;
u64 i;

reset_zone_present_pages();
for_each_free_mem_range(i, MAX_NUMNODES, &start, &end, NULL)
count += __free_memory_core(start, end);

Expand Down
34 changes: 0 additions & 34 deletions trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -6098,37 +6098,3 @@ void dump_page(struct page *page)
dump_page_flags(page->flags);
mem_cgroup_print_bad_page(page);
}

/* reset zone->present_pages */
void reset_zone_present_pages(void)
{
struct zone *z;
int i, nid;

for_each_node_state(nid, N_HIGH_MEMORY) {
for (i = 0; i < MAX_NR_ZONES; i++) {
z = NODE_DATA(nid)->node_zones + i;
z->present_pages = 0;
}
}
}

/* calculate zone's present pages in buddy system */
void fixup_zone_present_pages(int nid, unsigned long start_pfn,
unsigned long end_pfn)
{
struct zone *z;
unsigned long zone_start_pfn, zone_end_pfn;
int i;

for (i = 0; i < MAX_NR_ZONES; i++) {
z = NODE_DATA(nid)->node_zones + i;
zone_start_pfn = z->zone_start_pfn;
zone_end_pfn = zone_start_pfn + z->spanned_pages;

/* if the two regions intersect */
if (!(zone_start_pfn >= end_pfn || zone_end_pfn <= start_pfn))
z->present_pages += min(end_pfn, zone_end_pfn) -
max(start_pfn, zone_start_pfn);
}
}

0 comments on commit d124ac7

Please sign in to comment.