函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:rns _locked_ z3fold page header or NULL

函数原型:static inline struct z3fold_header *__z3fold_alloc(struct z3fold_pool *pool, size_t size, bool can_sleep)

返回类型:struct z3fold_header

参数:

类型参数名称
struct z3fold_pool *pool
size_tsize
boolcan_sleep
881  struct z3fold_header * zhdr = NULL
884  chunks等于Converts an allocation size in bytes to size in z3fold chunks
886  lookup :
888  unbuddied等于get_cpu_ptr(unbuddied)
890  l等于unbuddied[i]
892  zhdr等于list_first_entry_or_null - get the first element from a list*@ptr: the list head to take the element from.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.(READ_ONCE(l), structz3fold_header, buddy)
895  如果非zhdr则继续下一循环
899  加自旋锁
900  l等于unbuddied[i]
901  如果此条件成立可能性小(为编译器优化)(zhdr != list_first_entry - get the first element from a list*@ptr: the list head to take the element from.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.* Note, that list is expected to be not empty.(READ_ONCE(l), structz3fold_header, buddy))或非Try to lock a z3fold page
904  自旋锁解锁
905  zhdr = NULL
906  put_cpu_ptr(unbuddied)
907  如果can_sleepcond_resched()
909  转到:lookup
911  删除链表项并重新初始化
912  cpu等于负1
913  自旋锁解锁
915  page等于virt_to_page(kaddr) returns a valid pointer if and only if* virt_addr_valid(kaddr) returns true.(zhdr)
916  如果st_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting fromst_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting from
918  Unlock a z3fold page
919  zhdr = NULL
920  put_cpu_ptr(unbuddied)
921  如果can_sleepcond_resched()
923  转到:lookup
932  对象增加引用
933  退出
935  put_cpu_ptr(unbuddied)
937  如果非zhdr
945  加自旋锁
946  l等于unbuddied[chunks]
951  如果非zhdr或非Try to lock a z3fold page
953  zhdr = NULL
954  继续下一循环
957  cpu等于负1
964  zhdr = NULL
965  如果can_sleepcond_resched()
967  继续下一循环
970  退出
974  返回:zhdr
调用者
名称描述
compact_single_buddy
z3fold_allocz3fold_alloc() - allocates a region of a given size*@pool: z3fold pool from which to allocate*@size: size in bytes of the desired allocation*@gfp: gfp flags used if the pool needs to grow*@handle: handle of the new allocation* This function will attempt