函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\swap.c Create Date:2022-07-27 15:37:20
Last Modify:2022-05-23 13:40:24 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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.

函数原型:void release_pages(struct page **pages, int nr)

返回类型:void

参数:

类型参数名称
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 i小于nr循环
789  page等于pages[i]
796  如果locked_pgdatlock_batch先自加恒等于SWAP_CLUSTER_MAX
798  locked_pgdat = NULL
801  如果is_huge_zero_page(page)则继续下一循环
804  如果is_zone_device_page(page)则
805  如果locked_pgdat
816  如果put_devmap_managed_page(page)则继续下一循环
820  page等于compound_head(page)
821  如果非Drop a ref, return true if the refcount fell to zero (the page has no users)则继续下一循环
824  如果PageCompound(page)则
825  如果locked_pgdat
830  继续下一循环
833  如果PageLRU(page)则
834  pgdat等于page_pgdat(page)
836  如果pgdat不等于locked_pgdat
852  __ClearPageActive(page)
853  __ClearPageWaiters(page)
855  添加链表项
857  如果locked_pgdatspin_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)
调用者
名称描述
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.