Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:z3fold_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

Proto:static void z3fold_free(struct z3fold_pool *pool, unsigned long handle)

Type:void

Parameter:

TypeParameterName
struct z3fold_pool *pool
unsigned longhandle
1228  zhdr = rn locked z3fold page if it's not headless
1229  page = virt_to_page(kaddr) returns a valid pointer if and only if* virt_addr_valid(kaddr) returns true.(zhdr)
1230  page_claimed = st_and_set_bit - Set a bit and return its old value*@nr: Bit to set*@addr: Address to count from* This is an atomic fully-ordered operation (implied full memory barrier).
1232  If st_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting from Then
1238  If Not page_claimed Then
1239  spin_lock( & lock)
1241  spin_unlock( & lock)
1244  atomic64_dec( & pages_nr)
1246  Return
1250  bud = (handle & BUDDY_MASK) < zhdr->first_num is possible in encode_handle* but that doesn't matter. because the masking will result in the* correct buddy number.
1253  Case bud == FIRST
1254  first_chunks = 0
1255  Break
1256  Case bud == MIDDLE
1257  middle_chunks = 0
1258  Break
1259  Case bud == LAST
1260  last_chunks = 0
1261  Break
1262  Default
1263  pr_err("%s: unknown bud %d\n", __func__, bud)
1264  WARN_ON(1)
1265  put_z3fold_header(zhdr)
1266  lear_bit - Clears a bit in memory*@nr: Bit to clear*@addr: Address to start counting from* This is a relaxed atomic operation (no implied memory barriers).
1267  Return
1270  If Not page_claimed Then free_handle(handle)
1272  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
1273  atomic64_dec( & pages_nr)
1274  Return
1276  If page_claimed Then
1278  Unlock a z3fold page
1279  Return
1281  If Value for the false possibility is greater at compile time(PageIsolated(page)) || st_and_set_bit - Set a bit and return its old value*@nr: Bit to set*@addr: Address to count from* This is an atomic fully-ordered operation (implied full memory barrier). Then
1283  put_z3fold_header(zhdr)
1284  lear_bit - Clears a bit in memory*@nr: Bit to clear*@addr: Address to start counting from* This is a relaxed atomic operation (no implied memory barriers).
1285  Return
1287  If cpu < 0 || Not cpu_online(cpu) Then
1288  spin_lock( & lock)
1289  list_del_init - deletes entry from list and reinitialize it.*@entry: the element to delete from the list.
1290  spin_unlock( & lock)
1291  cpu = -1
1292  kref_get - increment refcount for object.*@kref: object.
1293  lear_bit - Clears a bit in memory*@nr: Bit to clear*@addr: Address to start counting from* This is a relaxed atomic operation (no implied memory barriers).
1294  do_compact_page(zhdr, true)
1295  Return
1297  kref_get - increment refcount for object.*@kref: object.
1298  lear_bit - Clears a bit in memory*@nr: Bit to clear*@addr: Address to start counting from* This is a relaxed atomic operation (no implied memory barriers).
1299  queue_work_on - queue work on specific cpu*@cpu: CPU number to execute work on*@wq: workqueue to use*@work: work to queue* We queue the work to a specific CPU, the caller must ensure it* can't go away.
1300  put_z3fold_header(zhdr)
Caller
NameDescribe
z3fold_zpool_free