函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Counterpart of unmap_and_move_page() for hugepage migration

函数原型:static int unmap_and_move_huge_page(new_page_t get_new_page, free_page_t put_new_page, unsigned long private, struct page *hpage, int force, enum migrate_mode mode, int reason)

返回类型:int

参数:

类型参数名称
new_page_tget_new_page
free_page_tput_new_page
unsigned longprivate
struct page *hpage
intforce
enum migrate_modemode
intreason
1281  rc等于负EAGAIN
1282  page_was_mapped等于0
1284  struct anon_vma * anon_vma = NULL
1293  如果非hugepage_migration_supported(page_hstate(hpage))则
1294  putback_active_hugepage(hpage)
1295  返回:负ENOSYS
1298  new_hpage等于get_new_page(hpage, private)
1299  如果非new_hpage则返回:负ENOMEM
1302  如果非Return true if the page was successfully locked
1303  如果非force则转到:out
1306  :mode恒等于MIGRATE_SYNC
1307  :mode恒等于MIGRATE_SYNC_NO_COPY
1308  退出
1309  默认
1310  转到:out
1312  lock_page may only be called if we have the page's inode pinned.
1320  如果page_private(hpage)且非page_mapping(hpage)则
1321  rc等于负EBUSY
1322  转到:out_unlock
1325  如果PageAnon(hpage)则anon_vma等于Getting a lock on a stable anon_vma from a page off the LRU is tricky!* Since there is no serialization what so ever against page_remove_rmap()* the best this function can do is return a locked anon_vma that might* have been relevant to this page
1328  如果此条件成立可能性小(为编译器优化)(!Return true if the page was successfully locked)则转到:put_anon
1331  如果Return true if this page is mapped into pagetables.* For compound page it returns true if any subpage of compound page is mapped.
1332  ry_to_unmap - try to remove all page table mappings to a page*@page: the page to get unmapped*@flags: action and flags* Tries to remove all the page table entries which are mapping this* page, used in the pageout path. Caller must hold the page lock.
1334  page_was_mapped等于1
1337  如果非Return true if this page is mapped into pagetables.* For compound page it returns true if any subpage of compound page is mapped.rc等于Move a page to a newly allocated page* The page is locked and all ptes have been successfully removed.* The new page will have replaced the old page if this function* is successful.* Return value:* < 0 - error code* MIGRATEPAGE_SUCCESS - success
1340  如果page_was_mappedGet rid of all migration entries and replace them by* references to the indicated page.
1344  lock_page - unlock a locked page*@page: the page* Unlocks the page and wakes up sleepers in ___wait_on_page_locked().* Also wakes sleepers in wait_on_page_writeback() because the wakeup* mechanism between PageLocked pages and PageWriteback pages is shared.
1346  put_anon :
1347  如果anon_vmaput_anon_vma(anon_vma)
1350  如果rc恒等于Return values from addresss_space_operations.migratepage():* - negative errno on page migration failure;* - zero on page migration success;
1351  move_hugetlb_state(hpage, new_hpage, reason)
1352  put_new_page = NULL
1355  out_unlock :
1356  lock_page - unlock a locked page*@page: the page* Unlocks the page and wakes up sleepers in ___wait_on_page_locked().* Also wakes sleepers in wait_on_page_writeback() because the wakeup* mechanism between PageLocked pages and PageWriteback pages is shared.
1357  out :
1358  如果rc不等于负EAGAINputback_active_hugepage(hpage)
1366  如果put_new_pageput_new_page(new_hpage, private)
1368  否则putback_active_hugepage(new_hpage)
1371  返回:rc
调用者
名称描述
migrate_pagesmigrate_pages - migrate the pages specified in a list, to the free pages* supplied as the target for the page migration*@from: The list of pages to be migrated.*@get_new_page: The function used to allocate free pages to be used