Function report |
Source Code:mm\page_alloc.c |
Create Date:2022-07-28 15:03:23 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:Freeing function for a buddy system allocator
Proto:static inline void __free_one_page(struct page *page, unsigned long pfn, struct zone *zone, unsigned int order, int migratetype)
Type:void
Parameter:
Type | Parameter | Name |
---|---|---|
struct page * | page | |
unsigned long | pfn | |
struct zone * | zone | |
unsigned int | order | |
int | migratetype |
910 | VM_BUG_ON(!zone_is_initialized(zone)) |
911 | VM_BUG_ON_PAGE( Atomic flags, some possibly * updated asynchronously & Flags checked when a page is prepped for return by the page allocator, page) |
913 | VM_BUG_ON(migratetype == - 1) |
914 | If Value is more likely to compile time(!is_migrate_isolate(migratetype)) Then __mod_zone_freepage_state(zone, 1 << order, migratetype) |
917 | VM_BUG_ON_PAGE(pfn & ((1 << order) - 1), page) |
918 | VM_BUG_ON_PAGE(bad_range(zone, page), page) |
920 | continue_merging : |
922 | If compaction_capture(capc, page, order, migratetype) Then |
923 | __mod_zone_freepage_state(zone, - (1 << order), migratetype) |
925 | Return |
927 | buddy_pfn = Locate the struct page for both the matching buddy in our* pair (buddy1) and the combined O(n+1) page they form (page) |
930 | If Not pfn_valid_within(buddy_pfn) Then Go to done_merging |
938 | If page_is_guard(buddy) Then clear_page_guard(zone, buddy, order, migratetype) |
940 | Else del_page_from_free_area(buddy, & Write-intensive fields used from the page allocator [order]) |
942 | combined_pfn = buddy_pfn & pfn |
943 | page = page + combined_pfn - pfn |
944 | pfn = combined_pfn |
945 | order++ |
947 | If max_order < Free memory management - zoned buddy allocator. Then |
959 | buddy_pfn = Locate the struct page for both the matching buddy in our* pair (buddy1) and the combined O(n+1) page they form (page) |
963 | If migratetype != buddy_mt && (is_migrate_isolate(migratetype) || is_migrate_isolate(buddy_mt)) Then Go to done_merging |
968 | max_order++ |
969 | Go to continue_merging |
972 | done_merging : |
973 | set_page_order(page, order) |
983 | If order < Free memory management - zoned buddy allocator. - 2 && pfn_valid_within(buddy_pfn) && Not is_shuffle_order(order) Then |
986 | combined_pfn = buddy_pfn & pfn |
987 | higher_page = page + combined_pfn - pfn |
988 | buddy_pfn = Locate the struct page for both the matching buddy in our* pair (buddy1) and the combined O(n+1) page they form (page) |
989 | higher_buddy = higher_page + buddy_pfn - combined_pfn |
994 | Return |
998 | If is_shuffle_order(order) Then add_to_free_area_random(page, & Write-intensive fields used from the page allocator [order], migratetype) |
1001 | Else Used for pages not on another list |
Name | Describe |
---|---|
free_pcppages_bulk | Frees a number of pages from the PCP lists* Assumes all pages on list are in same zone, and of same order.* count is the number of pages to free.* If the zone was previously in an "all pages pinned" state then look to |
free_one_page |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |