Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:z3fold_reclaim_page() - evicts allocations from a pool page and frees it*@pool: pool from which a page will attempt to be evicted*@retries: number of pages on the LRU list for which eviction will* be attempted before failing* z3fold reclaim is different

Proto:static int z3fold_reclaim_page(struct z3fold_pool *pool, unsigned int retries)

Type:int

Parameter:

TypeParameterName
struct z3fold_pool *pool
unsigned intretries
1341  ret = -1
1342  struct z3fold_header * zhdr = NULL
1343  struct page * page = NULL
1345  first_handle = 0 , middle_handle = 0 , last_handle = 0
1347  spin_lock( & lock)
1348  If Not ops || Not evict || retries == 0 Then
1349  spin_unlock( & lock)
1350  Return -EINVAL
1352  When i < retries cycle
1354  spin_unlock( & lock)
1355  Return -EINVAL
1364  page = NULL
1365  Continue
1373  zhdr = page_address(page)
1377  If Not Try to lock a z3fold page Then
1382  If foreign_handles Then
1390  cpu = -1
1391  Break
1394  If Not zhdr Then Break
1397  list_del_init - deletes entry from list and reinitialize it.*@entry: the element to delete from the list.
1398  spin_unlock( & lock)
1407  first_handle = 0
1408  last_handle = 0
1409  middle_handle = 0
1421  Else
1423  last_handle = middle_handle = 0
1426  If middle_handle Then
1428  If ret Then Go to next
1432  If first_handle Then
1433  ret = evict(pool, first_handle)
1434  If ret Then Go to next
1438  If last_handle Then
1439  ret = evict(pool, last_handle)
1440  If ret Then Go to next
1444  :
1446  If ret == 0 Then
1451  spin_lock( & lock)
1453  spin_unlock( & lock)
1455  Else
1459  atomic64_dec( & pages_nr)
1460  Return 0
1467  spin_lock( & lock)
1469  spin_unlock( & lock)
1475  spin_lock( & lock)
1477  spin_unlock( & lock)
1478  Return -EAGAIN
Caller
NameDescribe
z3fold_zpool_shrink