Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\hugetlb.c Create Date:2022-07-28 15:27:11
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:set_max_huge_pages

Proto:static int set_max_huge_pages(struct hstate *h, unsigned long count, int nid, nodemask_t *nodes_allowed)

Type:int

Parameter:

TypeParameterName
struct hstate *h
unsigned longcount
intnid
nodemask_t *nodes_allowed
2309  NODEMASK_ALLOC(nodemask_t, node_alloc_noretry, GFP_KERNEL)
2316  If node_alloc_noretry Then nodes_clear( * node_alloc_noretry)
2318  Else Return -ENOMEM
2321  spin_lock( & Protects updates to hugepage_freelists, hugepage_activelist, nr_huge_pages,* free_huge_pages, and surplus_huge_pages.)
2329  If nid != NUMA_NO_NODE Then
2330  old_count = count
2332  count += nr_huge_pages - nr_huge_pages_node[nid]
2339  If count < old_count Then count = ULONG_MAX
2350  If hstate_is_gigantic(h) && Not IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_CONTIG_ALLOC) Then
2351  If count > persistent_huge_pages(h) Then
2354  Return -EINVAL
2370  When surplus_huge_pages && count > persistent_huge_pages(h) cycle
2371  If Not 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. Then Break
2375  When count > persistent_huge_pages(h) cycle
2381  spin_unlock( & Protects updates to hugepage_freelists, hugepage_activelist, nr_huge_pages,* free_huge_pages, and surplus_huge_pages.)
2384  cond_resched()
2386  ret = Allocates a fresh page to the hugetlb allocator pool in the node interleaved* manner.
2388  spin_lock( & Protects updates to hugepage_freelists, hugepage_activelist, nr_huge_pages,* free_huge_pages, and surplus_huge_pages.)
2389  If Not ret Then Go to out
2393  If signal_pending(current process) Then Go to out
2412  min_count = resv_huge_pages + nr_huge_pages - free_huge_pages
2413  min_count = max - return maximum of two values of the same or compatible types*@x: first value*@y: second value(count, min_count)
2414  try_to_free_low(h, min_count, nodes_allowed)
2415  When min_count < persistent_huge_pages(h) cycle
2416  If Not 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. Then Break
2418  cond_resched_lock( & Protects updates to hugepage_freelists, hugepage_activelist, nr_huge_pages,* free_huge_pages, and surplus_huge_pages.)
2420  When count < persistent_huge_pages(h) cycle
2421  If Not 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. Then Break
2424  out :
2425  max_huge_pages = persistent_huge_pages(h)
2426  spin_unlock( & Protects updates to hugepage_freelists, hugepage_activelist, nr_huge_pages,* free_huge_pages, and surplus_huge_pages.)
2428  NODEMASK_FREE(node_alloc_noretry)
2430  Return 0
Caller
NameDescribe
__nr_hugepages_store_common