Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\vmscan.c Create Date:2022-07-28 14:17:33
Last Modify:2022-05-23 13:41:30 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:pageout is called by shrink_page_list() for each dirty page.* Calls ->writepage().

Proto:static pageout_t pageout(struct page *page, struct address_space *mapping)

Type:pageout_t

Parameter:

TypeParameterName
struct page *page
struct address_space *mapping
809  If Not is_page_cache_freeable(page) Then Return PAGE_KEEP
811  If Not mapping Then
817  If try_to_free_buffers(page) Then
819  pr_info("%s: orphaned page\n", __func__)
820  Return PAGE_CLEAN
823  Return PAGE_KEEP
825  If (writepage == NULL) Then Return PAGE_ACTIVATE
827  If Not may_write_to_inode(host) Then Return PAGE_KEEP
830  If Clear a page's dirty flag, while caring for dirty memory accounting.* Returns true if the page was previously dirty.* This is for preparing to put the page under writeout. We leave the page* tagged as dirty in the xarray so that a concurrent write-for-sync Then
832  struct writeback_control wbc = {sync_mode = WB_SYNC_NONE, Write this many pages, and decrementthis for each page written = SWAP_CLUSTER_MAX, For a_ops->writepages(): if start or end are non-zero then this is* a hint that the filesystem need only write out the pages inside that* byterange. The byte at `end' is included in the writeout request. = 0, range_end = LLONG_MAX, Invoked from the page allocator = 1, }
840  PG_readahead is only used for reads; PG_reclaim is only for writes
841  res = writepage(page, & wbc)
842  If res < 0 Then We detected a synchronous write error writing a page out. Probably* -ENOSPC. We need to propagate that into the address_space for a subsequent* fsync(), msync() or close().* The tricky part is that after writepage we cannot touch the mapping: nothing
844  If res == AOP_WRITEPAGE_ACTIVATE Then
846  Return PAGE_ACTIVATE
853  trace_mm_vmscan_writepage(page)
854  inc_node_page_state(page, NR_VMSCAN_WRITE)
855  Return PAGE_SUCCESS
858  Return PAGE_CLEAN
Caller
NameDescribe
shrink_page_listshrink_page_list() returns the number of reclaimed pages