函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\fork.c Create Date:2022-07-27 09:57:06
Last Modify:2020-03-17 11:04:53 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:account_kernel_stack

函数原型:static void account_kernel_stack(struct task_struct *tsk, int account)

返回类型:void

参数:

类型参数名称
struct task_struct *tsk
intaccount
375  stack等于task_stack_page(tsk)
376  vm等于task_stack_vm_area(tsk)
378  BUILD_BUG_ON - break compile if a condition is true(IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_VMAP_STACK) && PAGE_SIZE % 1024 != 0)
380  如果vm
383  BUG_ON(nr_pages != THREAD_SIZE / PAGE_SIZE)
385 i小于THREAD_SIZEPAGE_SIZE循环
390  否则
395  first_page等于virt_to_page(kaddr) returns a valid pointer if and only if* virt_addr_valid(kaddr) returns true.(stack)
397  mod_zone_page_state(page_zone(first_page), NR_KERNEL_STACK_KB, THREAD_SIZE / 1024 * account)
400  mod_memcg_page_state(first_page, MEMCG_KERNEL_STACK_KB, account * (THREAD_SIZE / 1024))
调用者
名称描述
release_task_stack
dup_task_struct复制进程并设置栈