函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\migrate.c Create Date:2022-07-27 17:32:34
Last Modify:2022-05-20 09:53:13 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Replace the page in the mapping.* The number of remaining references must be:* 1 for anonymous pages without a mapping* 2 for pages with a mapping* 3 for pages with a mapping and PagePrivate/PagePrivate2 set.

函数原型:int migrate_page_move_mapping(struct address_space *mapping, struct page *newpage, struct page *page, int extra_count)

返回类型:int

参数:

类型参数名称
struct address_space *mapping
struct page *newpage
struct page *page
intextra_count
400  XA_STATE() - Declare an XArray operation state.*@name: Name of this operation state (usually xas).*@array: Array to operate on.*@index: Initial index of interest.* Declare and initialise an xa_state on the stack.(xas, & i_pages, Return the pagecache index of the passed page. Regular pagecache pages* use ->index whereas swapcache pages use swp_offset(->private))
403  expected_count等于expected_page_refs(mapping, page)加extra_count
405  如果非mapping
407  如果page_count(page)不等于expected_count则返回:负EAGAIN
411  Our offset within mapping. 等于 Our offset within mapping.
412  See page-flags.h for PAGE_MAPPING_FLAGS 等于 See page-flags.h for PAGE_MAPPING_FLAGS
413  如果PageSwapBacked(page)则__SetPageSwapBacked(newpage)
416  返回:Return values from addresss_space_operations.migratepage():* - negative errno on page migration failure;* - zero on page migration success;
419  oldzone等于page_zone(page)
420  newzone等于page_zone(newpage)
422  xas_lock_irq( & xas)
423  如果page_count(page)不等于expected_countxas_load() - Load an entry from the XArray (advanced).*@xas: XArray operation state.* Usually walks the @xas to the appropriate state to load the entry* stored at xa_index. However, it will do nothing and return %NULL if*@xas is in an error state不等于page
424  xas_unlock_irq( & xas)
425  返回:负EAGAIN
428  如果非page_ref_freeze(page, expected_count)则
429  xas_unlock_irq( & xas)
430  返回:负EAGAIN
437  Our offset within mapping. 等于 Our offset within mapping.
438  See page-flags.h for PAGE_MAPPING_FLAGS 等于 See page-flags.h for PAGE_MAPPING_FLAGS
439  page_ref_add(newpage, hpage_nr_pages(page))
440  如果PageSwapBacked(page)则
441  __SetPageSwapBacked(newpage)
442  如果PageSwapCache(page)则
446  否则
447  VM_BUG_ON_PAGE(PageSwapCache(page), page)
451  dirty等于PageDirty(page)
452  如果dirty
453  ClearPageDirty(page)
454  SetPageDirty(newpage)
457  xas_store() - Store this entry in the XArray
458  如果PageHuge() only returns true for hugetlbfs pages, but not for* normal or transparent huge pages.* PageTransHuge() returns true for both transparent huge and* hugetlbfs pages, but not normal pages. PageTransHuge() can only be
461 i小于HPAGE_PMD_NR循环
472  page_ref_unfreeze(page, expected_count - hpage_nr_pages(page))
474  xas_unlock( & xas)
487  如果newzone不等于oldzone
488  __dec_node_state(建立内存域和父结点之间的关联, NR_FILE_PAGES)
489  __inc_node_state(建立内存域和父结点之间的关联, NR_FILE_PAGES)
490  如果PageSwapBacked(page)且非PageSwapCache(page)则
501  开中断()
503  返回:Return values from addresss_space_operations.migratepage():* - negative errno on page migration failure;* - zero on page migration success;
调用者
名称描述
migrate_pageCommon logic to directly migrate a single LRU page suitable for* pages that do not use PagePrivate/PagePrivate2.* Pages are locked upon entry and exit.
__buffer_migrate_page
iomap_migrate_page
aio_migratepage