[Linux Memory] Partner System Learning Note (ii)--memory system initialization

Source: Internet
Author: User

1, most of this article from: http://blog.csdn.net/vanbreaker/article/details/7611585

2, in Start_kernel ()-->paging_init ()-->zone_sizes_init ()-->free_area_init_nodes ()-->free_area_init_ Node ()-->free_area_init_core ()-->init_currently_empty_zone ()->zone_init_free_lists (), Free_ The related fields of area are initialized

[CPP]View Plaincopy
  1. static void __meminit zone_init_free_lists (struct zone *zone)
  2. {
  3. int order, t;
  4. For_each_migratetype_order (order, T) {
  5. / * list initialized to empty list * /
  6. Init_list_head (&zone->free_area[order].free_list[t]);
  7. / * Number of memory blocks initialized to 0*/
  8. Zone->free_area[order].nr_free = 0;
  9. }
  10. }



Start_kernel ()-->mm_init ()-->mem_init (), responsible for the statistics of all available low-end memory and high-end memory, and released into the partner system

In Free_area_init_core ()-->memmap_init () (-->memmap_init_zone ())-->set_pageblock_migratetype (), The bitmap-related area of the pageblock_flags representation in the struct zone corresponding to each Pageblock start Page box is marked as movable, which means that the pageblock is movable, that is, when the kernel initializes the partner system, All pages are marked as movable

The kernel first initializes some data items for the node and the management area through Setup_arch ()-->paging_init ()-->zone_sizes_init (), where the core function is Free_area_init_node (), Used to initialize for a specific node

At this point, the key data for the node and the management area has been initialized, and the kernel is prepared to do a good job of managing the memory in the future by chaining all the node's administrative areas into the zonelist, so that the kernel of the memory allocation work is Start_kernel ()-->build_all_ Initialization of Zonelist completed in Zonelist ()

[Linux Memory] Partner System Learning Note (ii)--memory system initialization

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.