Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:zbud_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* zbud reclaim is different from

Proto:int zbud_reclaim_page(struct zbud_pool *pool, unsigned int retries)

Type:int

Parameter:

TypeParameterName
struct zbud_pool *pool
unsigned intretries
506  first_handle = 0 , last_handle = 0
508  spin_lock( & lock)
509  If Not ops || Not evict || list_empty - tests whether a list is empty*@head: the list to test. || retries == 0 Then
511  spin_unlock( & lock)
512  Return -EINVAL
514  When i < retries cycle
515  zhdr = list_last_entry - get the last 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.( & lru, structzbud_header, lru)
516  deletes entry from list
517  deletes entry from list
519  under_reclaim = true
524  first_handle = 0
525  last_handle = 0
526  If first_chunks Then first_handle = Encodes the handle of a particular buddy within a zbud page* Pool lock should be held as this function accesses first|last_chunks
528  If last_chunks Then last_handle = Encodes the handle of a particular buddy within a zbud page* Pool lock should be held as this function accesses first|last_chunks
530  spin_unlock( & lock)
533  If first_handle Then
535  If ret Then Go to next
538  If last_handle Then
540  If ret Then Go to next
543  :
544  spin_lock( & lock)
545  under_reclaim = false
546  If first_chunks == 0 && last_chunks == 0 Then
552  pages_nr--
553  spin_unlock( & lock)
554  Return 0
555  Else if first_chunks == 0 || last_chunks == 0 Then
560  Else
566  list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
568  spin_unlock( & lock)
569  Return -EAGAIN
Caller
NameDescribe
zbud_zpool_shrink