Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:z3fold_page_migrate

Proto:static int z3fold_page_migrate(struct address_space *mapping, struct page *newpage, struct page *page, enum migrate_mode mode)

Type:int

Parameter:

TypeParameterName
struct address_space *mapping
struct page *newpage
struct page *page
enum migrate_modemode
1611  VM_BUG_ON_PAGE(!PageMovable(page), page)
1612  VM_BUG_ON_PAGE(!PageIsolated(page), page)
1613  VM_BUG_ON_PAGE(!PageLocked(newpage), newpage)
1615  zhdr = page_address(page)
1616  pool = zhdr_to_pool(zhdr)
1618  If Not Try to lock a z3fold page Then
1619  Return -EAGAIN
1621  If mapped_count != 0 || foreign_handles != 0 Then
1622  Unlock a z3fold page
1623  Return -EBUSY
1625  If work_pending - Find out whether a work item is currently pending*@work: The work item in question( & work) Then
1626  Unlock a z3fold page
1627  Return -EAGAIN
1629  new_zhdr = page_address(newpage)
1630  memcpy(new_zhdr, zhdr, PAGE_SIZE)
1631  *@private: Mapping-private opaque data. * Usually used for buffer_heads if PagePrivate. * Used for swp_entry_t if PageSwapCache. * Indicates order in the buddy system if PageBuddy. = *@private: Mapping-private opaque data. * Usually used for buffer_heads if PagePrivate. * Used for swp_entry_t if PageSwapCache. * Indicates order in the buddy system if PageBuddy.
1632  *@private: Mapping-private opaque data. * Usually used for buffer_heads if PagePrivate. * Used for swp_entry_t if PageSwapCache. * Indicates order in the buddy system if PageBuddy. = 0
1633  Unlock a z3fold page
1634  Process spin lock initialization( & page_lock)
1635  INIT_WORK( & work, compact_page_work)
1640  Initialization list head
1641  new_mapping = page_mapping(page)
1642  __ClearPageMovable(page)
1643  Private page markings that may be used by the filesystem that owns the page* for its own purposes.* - PG_private and PG_private_2 cause releasepage() and co to be invoked
1645  get_page(newpage)
1646  Lock a z3fold page
1647  If first_chunks Then encode_handle(new_zhdr, FIRST)
1649  If last_chunks Then encode_handle(new_zhdr, LAST)
1651  If middle_chunks Then encode_handle(new_zhdr, MIDDLE)
1653  Atomically set a bit in memory
1654  cpu = smp_processor_id()
1655  spin_lock( & lock)
1656  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.
1657  spin_unlock( & lock)
1658  __SetPageMovable(newpage, new_mapping)
1659  Unlock a z3fold page
1661  queue_work_on - queue work on specific cpu*@cpu: CPU number to execute work on*@wq: workqueue to use*@work: work to queue* We queue the work to a specific CPU, the caller must ensure it* can't go away.
1663  The atomic page->_mapcount, starts from -1: so that transitions* both from it and to it can be tracked, using atomic_inc_and_test* and atomic_add_negative(-1).
1664  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
1665  Return 0