Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:do_compact_page

Proto:static void do_compact_page(struct z3fold_header *zhdr, bool locked)

Type:void

Parameter:

TypeParameterName
struct z3fold_header *zhdr
boollocked
827  pool = zhdr_to_pool(zhdr)
830  page = virt_to_page(kaddr) returns a valid pointer if and only if* virt_addr_valid(kaddr) returns true.(zhdr)
831  If locked Then WARN_ON(Try to lock a z3fold page )
833  Else Lock a z3fold page
835  If WARN_ON(!st_and_clear_bit - Clear a bit and return its old value*@nr: Bit to clear*@addr: Address to count from* This is an atomic fully-ordered operation (implied full memory barrier).) Then
836  Unlock a z3fold page
837  Return
839  spin_lock( & lock)
840  list_del_init - deletes entry from list and reinitialize it.*@entry: the element to delete from the list.
841  spin_unlock( & lock)
843  If kref_put - decrement refcount for object.*@kref: object.*@release: pointer to the function that will clean up the object when the* last reference to the object is released.* This pointer is required, and it is not acceptable to pass kfree Then
844  atomic64_dec( & pages_nr)
845  Return
848  If Value for the false possibility is greater at compile time(PageIsolated(page) || 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
851  Unlock a z3fold page
852  Return
855  If Not foreign_handles && buddy_single(zhdr) && mapped_count == 0 && compact_single_buddy(zhdr) Then
857  If kref_put - decrement refcount for object.*@kref: object.*@release: pointer to the function that will clean up the object when the* last reference to the object is released.* This pointer is required, and it is not acceptable to pass kfree Then atomic64_dec( & pages_nr)
859  Else Unlock a z3fold page
861  Return
864  Has to be called with lock held
865  Add to the appropriate unbuddied list
866  Unlock a z3fold page
Caller
NameDescribe
compact_page_work
z3fold_freez3fold_free() - frees the allocation associated with the given handle*@pool: pool in which the allocation resided*@handle: handle associated with the allocation returned by z3fold_alloc()* In the case that the z3fold page in which the allocation resides