Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:rns _locked_ z3fold page header or NULL

Proto:static inline struct z3fold_header *__z3fold_alloc(struct z3fold_pool *pool, size_t size, bool can_sleep)

Type:struct z3fold_header

Parameter:

TypeParameterName
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  If Not zhdr Then Continue
899  spin_lock( & lock)
900  l = unbuddied[i]
901  If Value for the false possibility is greater at compile time(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)) || Not Try to lock a z3fold page Then
904  spin_unlock( & lock)
905  zhdr = NULL
906  put_cpu_ptr(unbuddied)
907  If can_sleep Then cond_resched()
909  Go to lookup
911  list_del_init - deletes entry from list and reinitialize it.*@entry: the element to delete from the list.
912  cpu = -1
913  spin_unlock( & lock)
915  page = virt_to_page(kaddr) returns a valid pointer if and only if* virt_addr_valid(kaddr) returns true.(zhdr)
916  If st_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting from || st_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting from Then
918  Unlock a z3fold page
919  zhdr = NULL
920  put_cpu_ptr(unbuddied)
921  If can_sleep Then cond_resched()
923  Go to lookup
932  kref_get - increment refcount for object.*@kref: object.
933  Break
935  put_cpu_ptr(unbuddied)
937  If Not zhdr Then
945  spin_lock( & lock)
946  l = unbuddied[chunks]
951  If Not zhdr || Not Try to lock a z3fold page Then
952  spin_unlock( & lock)
953  zhdr = NULL
954  Continue
957  cpu = -1
958  spin_unlock( & lock)
964  zhdr = NULL
965  If can_sleep Then cond_resched()
967  Continue
970  Break
974  Return zhdr
Caller
NameDescribe
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