函数逻辑报告 |
Source Code:mm\page_alloc.c |
Create Date:2022-07-27 16:35:16 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称:Allocate a page from the given zone. Use pcplists for order-0 allocations.
函数原型:static inline struct page *rmqueue(struct zone *preferred_zone, struct zone *zone, unsigned int order, gfp_t gfp_flags, unsigned int alloc_flags, int migratetype)
返回类型:struct page
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| struct zone * | preferred_zone | |
| struct zone * | zone | |
| unsigned int | order | |
| gfp_t | gfp_flags | |
| unsigned int | alloc_flags | |
| int | migratetype |
| 3262 | 如果此条件成立可能性大(为编译器优化)(order == 0)则 |
| 3265 | 转到:out |
| 3272 | WARN_ON_ONCE((gfp_flags & __GFP_NOFAIL) && (order > 1)) |
| 3273 | spin_lock_irqsave( & 自旋锁, flags) |
| 3275 | 循环 |
| 3276 | page = NULL |
| 3277 | 如果alloc_flags按位与ry to alloc harder 则 |
| 3284 | 当page且check_new_pages(page, order)循环 |
| 3285 | 自旋锁解锁 |
| 3288 | __mod_zone_freepage_state(zone, - (1 << order), A cached value of the page's pageblock's migratetype, used when the page is* put on a pcplist) |
| 3291 | __count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order) |
| 3293 | local_irq_restore(flags) |
| 3295 | out : |
| 3303 | 返回:page |
| 3305 | failed : |
| 3306 | local_irq_restore(flags) |
| 3307 | 返回:NULL |
| 名称 | 描述 |
|---|---|
| get_page_from_freelist | get_page_from_freelist goes through the zonelist trying to allocate* a page. |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |