函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\hugetlb.c Create Date:2022-07-27 16:58:36
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:set_max_huge_pages

函数原型:static int set_max_huge_pages(struct hstate *h, unsigned long count, int nid, nodemask_t *nodes_allowed)

返回类型:int

参数:

类型参数名称
struct hstate *h
unsigned longcount
intnid
nodemask_t *nodes_allowed
2309  NODEMASK_ALLOC(nodemask_t, node_alloc_noretry, GFP_KERNEL)
2316  如果node_alloc_noretrynodes_clear( * node_alloc_noretry)
2318  否则返回:负ENOMEM
2321  加自旋锁
2329  如果nid不等于NUMA_NO_NODE
2330  old_count等于count
2332  count加等于nr_huge_pagesnr_huge_pages_node[nid]
2339  如果count小于old_countcount等于ULONG_MAX
2350  如果hstate_is_gigantic(h)且非IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_CONTIG_ALLOC)则
2351  如果count大于persistent_huge_pages(h)则
2354  返回:负EINVAL
2370 surplus_huge_pagescount大于persistent_huge_pages(h)循环
2371  如果非Increment or decrement surplus_huge_pages. Keep node-specific counters* balanced by operating on them in a round-robin fashion.* Returns 1 if an adjustment was made.退出
2375 count大于persistent_huge_pages(h)循环
2381  自旋锁解锁
2384  cond_resched()
2386  ret等于Allocates a fresh page to the hugetlb allocator pool in the node interleaved* manner.
2388  加自旋锁
2389  如果非ret则转到:out
2393  如果signal_pending(当前进程)则转到:out
2412  min_count等于resv_huge_pagesnr_huge_pagesfree_huge_pages
2413  min_count等于两数取大(count, min_count)
2414  try_to_free_low(h, min_count, nodes_allowed)
2415 min_count小于persistent_huge_pages(h)循环
2416  如果非Free huge page from pool from next node to free.* Attempt to keep persistent huge pages more or less* balanced over allowed nodes.* Called with hugetlb_lock locked.退出
2418  cond_resched_lock( & Protects updates to hugepage_freelists, hugepage_activelist, nr_huge_pages,* free_huge_pages, and surplus_huge_pages.)
2420 count小于persistent_huge_pages(h)循环
2421  如果非Increment or decrement surplus_huge_pages. Keep node-specific counters* balanced by operating on them in a round-robin fashion.* Returns 1 if an adjustment was made.退出
2424  out :
2425  max_huge_pages等于persistent_huge_pages(h)
2426  自旋锁解锁
2428  NODEMASK_FREE(node_alloc_noretry)
2430  返回:0
调用者
名称描述
__nr_hugepages_store_common