Function report |
Source Code:mm\page_alloc.c |
Create Date:2022-07-28 15:05:25 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:get_page_from_freelist goes through the zonelist trying to allocate* a page.
Proto:static struct page *get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags, const struct alloc_context *ac)
Type:struct page
Parameter:
Type | Parameter | Name |
---|---|---|
gfp_t | gfp_mask | |
unsigned int | order | |
int | alloc_flags | |
const struct alloc_context * | ac |
3574 | struct pglist_data * last_pgdat_dirty_limit = NULL |
3577 | retry : |
3582 | no_fallback = alloc_flags & ALLOC_NOFRAGMENT |
3583 | z = preferred_zoneref |
3589 | If cpusets_enabled() && alloc_flags & check for correct cpuset && Not __cpuset_zone_allowed(zone, gfp_mask) Then Continue |
3612 | If spread_dirty_pages Then |
3613 | If last_pgdat_dirty_limit == zone_pgdat Then Continue |
3617 | last_pgdat_dirty_limit = zone_pgdat |
3618 | Continue |
3622 | If no_fallback && nr_online_nodes > 1 && zone != Pointer to actual zone Then |
3631 | local_nid = zone_to_nid(Pointer to actual zone ) |
3632 | If zone_to_nid(zone) != local_nid Then |
3633 | alloc_flags &= ~ALLOC_NOFRAGMENT |
3634 | Go to retry |
3638 | mark = wmark_pages(zone, alloc_flags & Mask to get the watermark bits ) |
3639 | If Not zone_watermark_fast(zone, order, mark, ac_classzone_idx(ac), alloc_flags) Then |
3655 | If alloc_flags & don't check watermarks at all Then Go to try_this_zone |
3658 | If Node reclaim mode* If non-zero call node_reclaim when the number of free pages falls below* the watermarks. == 0 || Not zone_allows_reclaim(Pointer to actual zone , zone) Then Continue |
3662 | ret = node_reclaim(zone_pgdat, gfp_mask, order) |
3664 | Case ret == NODE_RECLAIM_NOSCAN |
3666 | Continue |
3667 | Case ret == NODE_RECLAIM_FULL |
3669 | Continue |
3670 | Default |
3672 | If zone_watermark_ok(zone, order, mark, ac_classzone_idx(ac), alloc_flags) Then Go to try_this_zone |
3676 | Continue |
3680 | try_this_zone : |
3683 | If page Then |
3684 | prep_new_page(page, order, gfp_mask, alloc_flags) |
3693 | Return page |
3694 | Else |
3709 | If no_fallback Then |
3710 | alloc_flags &= ~ALLOC_NOFRAGMENT |
3711 | Go to retry |
3714 | Return NULL |
Name | Describe |
---|---|
__alloc_pages_cpuset_fallback | |
__alloc_pages_may_oom | |
__alloc_pages_direct_reclaim | The really slow allocator path where we enter direct reclaim |
__alloc_pages_slowpath | |
__alloc_pages_nodemask | This is the 'heart' of the zoned buddy allocator. |
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 |