函数逻辑报告 |
Source Code:kernel\trace\ring_buffer.c |
Create Date:2022-07-27 12:58:53 |
Last Modify:2020-03-17 19:30:04 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:__rb_allocate_pages
函数原型:static int __rb_allocate_pages(long nr_pages, struct list_head *pages, int cpu)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
long | nr_pages | |
struct list_head * | pages | |
int | cpu |
1192 | bool user_thread = mm != NULL |
1203 | i等于si_mem_available() |
1212 | mflags等于GFP_KERNEL按位或__GFP_RETRY_MAYFAIL |
1223 | 如果user_thread则set_current_oom_origin() |
1228 | bpage等于根据内存节点分配内存 |
1230 | 如果非bpage则转到:free_pages |
1233 | 添加链表项 |
1235 | page等于Allocate pages, preferring the node given as nid. When nid == NUMA_NO_NODE,* prefer the current CPU's closest node. Otherwise node must be valid and* online. |
1236 | 如果非page则转到:free_pages |
1238 | Actual data page 等于page_address(page) |
1239 | rb_init_page(Actual data page ) |
1241 | 如果user_thread且fatal_signal_pending(当前进程)则转到:free_pages |
1244 | 如果user_thread则clear_current_oom_origin() |
1247 | 返回:0 |
1249 | free_pages : |
1251 | 删除链表项并重新初始化 |
1254 | 如果user_thread则clear_current_oom_origin() |
1257 | 返回:负ENOMEM |
名称 | 描述 |
---|---|
rb_allocate_pages | |
ring_buffer_resize | g_buffer_resize - resize the ring buffer*@buffer: the buffer to resize.*@size: the new size.*@cpu_id: the cpu buffer to resize* Minimum size is 2 * BUF_PAGE_SIZE.* Returns 0 on success and < 0 on failure. |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |