start_kernel()之page_address_init()
时间:2010-10-15 来源:letmego163
page_address_init() do nothing when all RAM can be mapped directly, otherwise, do following operations:
highmem.c:
static struct page_address_map page_address_maps[LAST_PKMAP]; |
page_address_pool is a global variable defined in highmem.c
/* |
page_address_htable[] is also a global variable defined in highmem.c
/* |
There is a very important data structure: struct page_address_map, this structure's main purpose is to maintain the association of struct page and its virtual memory. However, this will be wasteful if the page has a linear association with its virtual memory. This becomes necessary when the addressing is hashed.
|
Summary:
1. The main purpose of page_address_init() is to initiate global variable page_address_pool, which is used to support high memory that cannot be directly mapped.
page_address_pool is a list header pointing to lots of struct page_address_map connected each other using list.
2. page_address_htable[] is used to hold the list of entry that hash to the same bucket. page_address_init() initiates it.