Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__soft_offline_page

Proto:static int __soft_offline_page(struct page *page, int flags)

Type:int

Parameter:

TypeParameterName
struct page *page
intflags
1731  pfn = page_to_pfn(page)
1739  lock_page may only be called if we have the page's inode pinned.
1740  Wait for a page to complete writeback
1741  If PageHWPoison(page) Then
1742  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.
1743  put_hwpoison_page(page)
1744  pr_info("soft offline: %#lx page already poisoned\n", pfn)
1745  Return -EBUSY
1751  ret = Safely invalidate one page from its pagecache mapping.* It only drops clean, unused pages. The page must be locked.* Returns 1 if the page is successfully invalidated, otherwise 0.
1752  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.
1757  If ret == 1 Then
1758  put_hwpoison_page(page)
1759  pr_info("soft_offline: %#lx: invalidated\n", pfn)
1760  SetPageHWPoison(page)
1761  num_poisoned_pages_inc()
1762  Return 0
1770  If PageLRU(page) Then ret = solate_lru_page - tries to isolate a page from its LRU list*@page: page to isolate from its LRU list* Isolates a @page from an LRU list, clears PageLRU and adjusts the* vmstat statistic corresponding to whatever LRU list the page was on.
1772  Else ret = isolate_movable_page(page, Isolate unevictable pages )
1778  put_hwpoison_page(page)
1779  If Not ret Then
1780  LIST_HEAD(pagelist)
1786  If Not __PageMovable(page) Then inc_node_page_state(page, Temporary isolated pages from anon lru + page_is_file_cache - should the page be on a file LRU or anon LRU?*@page: the page to test* Returns 1 if @page is page cache page backed by a regular filesystem,* or 0 if @page is anonymous, tmpfs or otherwise ram or swap backed)
1789  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.
1790  ret = migrate_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
1792  If ret Then
1798  If ret > 0 Then ret = -EIO
1801  Else
1802  pr_info("soft offline: %#lx: isolation failed: %d, page count %d, type %lx (%pGp)\n", pfn, ret, page_count(page), Atomic flags, some possibly * updated asynchronously , & Atomic flags, some possibly * updated asynchronously )
1805  Return ret
Caller
NameDescribe
soft_offline_in_use_page