Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\swap.c Create Date:2022-07-28 14:13:36
Last Modify:2022-05-23 13:40:24 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:lease_pages - batched put_page()*@pages: array of pages to release*@nr: number of pages* Decrement the reference count on all the pages in @pages. If it* fell to zero, remove the page from the LRU and free it.

Proto:void release_pages(struct page **pages, int nr)

Type:void

Parameter:

TypeParameterName
struct page **pages
intnr
782  LIST_HEAD(pages_to_free)
783  struct pglist_data * locked_pgdat = NULL
785  flags = flags
786  lock_batch = lock_batch
788  When i < nr cycle
789  page = pages[i]
796  If locked_pgdat && ++lock_batch == SWAP_CLUSTER_MAX Then
798  locked_pgdat = NULL
801  If is_huge_zero_page(page) Then Continue
804  If is_zone_device_page(page) Then
805  If locked_pgdat Then
816  If put_devmap_managed_page(page) Then Continue
820  page = compound_head(page)
821  If Not Drop a ref, return true if the refcount fell to zero (the page has no users) Then Continue
824  If PageCompound(page) Then
825  If locked_pgdat Then
830  Continue
833  If PageLRU(page) Then
834  pgdat = page_pgdat(page)
836  If pgdat != locked_pgdat Then
852  __ClearPageActive(page)
853  __ClearPageWaiters(page)
855  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.
857  If locked_pgdat Then spin_unlock_irqrestore( & Write-intensive fields used by page reclaim , flags)
860  mem_cgroup_uncharge_list( & pages_to_free)
861  free_unref_page_list( & pages_to_free)
Caller
NameDescribe
pagevec_lru_move_fn
__pagevec_releaseThe pages which we're about to release may be in the deferred lru-addition* queues. That would prevent them from really being freed right now. That's* OK from a correctness point of view but is inefficient - those pages may be
free_pages_and_swap_cachePassed an array of pages, drop them all from swapcache and then release* them. They are removed from the LRU and freed if this is their last use.