Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 137433
b: refs/heads/master
c: 3835f6c
h: refs/heads/master
i:
  137431: 5a88c9e
v: v3
  • Loading branch information
Nicolas Pitre committed Mar 16, 2009
1 parent 07bf08f commit fb56b20
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 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: d73cd42893f4cdc06e6829fea2347bb92cb789d1
refs/heads/master: 3835f6cb645bdb9a58aa6e062fe1d5777f1a9748
21 changes: 18 additions & 3 deletions trunk/arch/arm/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <linux/mman.h>
#include <linux/nodemask.h>
#include <linux/initrd.h>
#include <linux/highmem.h>

#include <asm/mach-types.h>
#include <asm/sections.h>
Expand Down Expand Up @@ -485,7 +486,7 @@ void __init mem_init(void)
int i, node;

#ifndef CONFIG_DISCONTIGMEM
max_mapnr = virt_to_page(high_memory) - mem_map;
max_mapnr = pfn_to_page(max_pfn + PHYS_PFN_OFFSET) - mem_map;
#endif

/* this will put all unused low memory onto the freelists */
Expand All @@ -504,6 +505,19 @@ void __init mem_init(void)
__phys_to_pfn(__pa(swapper_pg_dir)), NULL);
#endif

#ifdef CONFIG_HIGHMEM
/* set highmem page free */
for_each_online_node(node) {
for_each_nodebank (i, &meminfo, node) {
unsigned long start = bank_pfn_start(&meminfo.bank[i]);
unsigned long end = bank_pfn_end(&meminfo.bank[i]);
if (start >= max_low_pfn + PHYS_PFN_OFFSET)
totalhigh_pages += free_area(start, end, NULL);
}
}
totalram_pages += totalhigh_pages;
#endif

/*
* Since our memory may not be contiguous, calculate the
* real number of pages we have in this system
Expand All @@ -521,9 +535,10 @@ void __init mem_init(void)
initsize = __init_end - __init_begin;

printk(KERN_NOTICE "Memory: %luKB available (%dK code, "
"%dK data, %dK init)\n",
"%dK data, %dK init, %luK highmem)\n",
(unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
codesize >> 10, datasize >> 10, initsize >> 10);
codesize >> 10, datasize >> 10, initsize >> 10,
(unsigned long) (totalhigh_pages << (PAGE_SHIFT-10)));

if (PAGE_SIZE >= 16384 && num_physpages <= 128) {
extern int sysctl_overcommit_memory;
Expand Down

0 comments on commit fb56b20

Please sign in to comment.