mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
mm/um: use free_highmem_page() to free highmem pages into buddy system
Use helper function free_highmem_page() to free highmem pages into the buddy system. Signed-off-by: Jiang Liu <[email protected]> Cc: Jeff Dike <[email protected]> Cc: Richard Weinberger <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
32e1a10927
commit
5b472b2057
1 changed files with 3 additions and 13 deletions
|
|
@ -42,17 +42,12 @@ static unsigned long brk_end;
|
|||
static void setup_highmem(unsigned long highmem_start,
|
||||
unsigned long highmem_len)
|
||||
{
|
||||
struct page *page;
|
||||
unsigned long highmem_pfn;
|
||||
int i;
|
||||
|
||||
highmem_pfn = __pa(highmem_start) >> PAGE_SHIFT;
|
||||
for (i = 0; i < highmem_len >> PAGE_SHIFT; i++) {
|
||||
page = &mem_map[highmem_pfn + i];
|
||||
ClearPageReserved(page);
|
||||
init_page_count(page);
|
||||
__free_page(page);
|
||||
}
|
||||
for (i = 0; i < highmem_len >> PAGE_SHIFT; i++)
|
||||
free_highmem_page(&mem_map[highmem_pfn + i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -73,18 +68,13 @@ void __init mem_init(void)
|
|||
totalram_pages = free_all_bootmem();
|
||||
max_low_pfn = totalram_pages;
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
totalhigh_pages = highmem >> PAGE_SHIFT;
|
||||
totalram_pages += totalhigh_pages;
|
||||
setup_highmem(end_iomem, highmem);
|
||||
#endif
|
||||
num_physpages = totalram_pages;
|
||||
max_pfn = totalram_pages;
|
||||
printk(KERN_INFO "Memory: %luk available\n",
|
||||
nr_free_pages() << (PAGE_SHIFT-10));
|
||||
kmalloc_ok = 1;
|
||||
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
setup_highmem(end_iomem, highmem);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue