Commit 029922c4 authored by Dave Hansen's avatar Dave Hansen Committed by Linus Torvalds

[PATCH] kill off highmem_start_page

People love to do comparisons with highmem_start_page.  However, where
CONFIG_HIGHMEM=y and there is no actual highmem, there's no real page at
*highmem_start_page.

That's usually not a problem, but CONFIG_NONLINEAR is a bit more strict and
catches the bogus address tranlations. 

There are about a gillion different ways to find out of a 'struct page' is
highmem or not.  Why not just check page_flags?  Just use PageHighMem()
wherever there used to be a highmem_start_page comparison.  Then, kill off
highmem_start_page.

This removes more code than it adds, and gets rid of some nasty
#ifdefs in .c files.
Signed-off-by: default avatarDave Hansen <haveblue@us.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c46ea0a8
......@@ -13,7 +13,7 @@
void *kmap(struct page *page)
{
might_sleep();
if (page < highmem_start_page)
if (!PageHighMem(page))
return page_address(page);
return kmap_high(page);
}
......@@ -22,7 +22,7 @@ void kunmap(struct page *page)
{
if (in_interrupt())
BUG();
if (page < highmem_start_page)
if (!PageHighMem(page))
return;
kunmap_high(page);
}
......
......@@ -134,11 +134,6 @@ void __init paging_init(void)
free_area_init(zones_size);
#ifdef CONFIG_MMU
/* high memory (if present) starts after the last mapped page
* - this is used by kmap()
*/
highmem_start_page = mem_map + num_mappedpages;
/* initialise init's MMU context */
init_new_context(&init_task, &init_mm);
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment