Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Process all subpages of the specified huge page with the specified* operation. The target subpage will be processed last to keep its* cache lines hot.

Proto:static inline void process_huge_page(unsigned long addr_hint, unsigned int pages_per_huge_page, void (*process_subpage)(unsigned long addr, int idx, void *arg), void *arg)

Type:void

Parameter:

TypeParameterName
unsigned longaddr_hint
unsigned intpages_per_huge_page
void (*process_subpage
void *arg
4633  addr = addr_hint & ~((pages_per_huge_page << PAGE_SHIFT determines the page size ) - 1)
4637  might_sleep()
4638  n = (addr_hint - addr) / PAGE_SIZE
4639  If 2 * n <= pages_per_huge_page Then
4641  base = 0
4642  l = n
4644  When i >= 2 * n cycle
4645  cond_resched()
4648  Else
4650  base = pages_per_huge_page - 2 * (pages_per_huge_page - n)
4651  l = pages_per_huge_page - n
4653  When i < base cycle
4654  cond_resched()
4662  When i < l cycle
4663  left_idx = base + i
4664  right_idx = base + 2 * l - 1 - i
4666  cond_resched()
4667  process_subpage(addr + left_idx * PAGE_SIZE, left_idx, arg)
4668  cond_resched()
4669  process_subpage(addr + right_idx * PAGE_SIZE, right_idx, arg)
Caller
NameDescribe
clear_huge_page
copy_user_huge_page