函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\zsmalloc.c Create Date:2022-07-27 18:02:59
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:migrate_zspage

函数原型:static int migrate_zspage(struct zs_pool *pool, struct size_class *class, struct zs_compact_control *cc)

返回类型:int

参数:

类型参数名称
struct zs_pool *pool
struct size_class *class
struct zs_compact_control *cc
1700  s_page等于 Source spage for migration which could be a subpage of zspage
1701  d_page等于 Destination page for migration which should be a first page * of zspage.
1702  obj_idx等于 Starting object index within @s_page which used for live object * in the subpage.
1703  ret等于0
1705  当1循环
1706  handle等于Find alloced object in zspage from index object and* return handle.
1707  如果非handle
1708  s_page等于get_next_page(s_page)
1709  如果非s_page退出
1711  obj_idx等于0
1712  继续下一循环
1716  如果zspage_full(class, get_zspage(d_page))则
1717  unpin_tag(handle)
1718  ret等于负ENOMEM
1719  退出
1722  used_obj等于handle_to_obj(handle)
1723  free_obj等于obj_malloc(class, get_zspage(d_page), handle)
1724  zs_object_copy(class, free_obj, used_obj)
1725  obj_idx自加
1732  free_obj或等于BIT(Memory for allocating for handle keeps object position by* encoding and the encoded value has a room* in least bit(ie, look at obj_to_location).* We use the bit to synchronize between object access by* user and migration.)
1733  record_obj(handle, free_obj)
1734  unpin_tag(handle)
1735  obj_free(class, used_obj)
1739  Source spage for migration which could be a subpage of zspage 等于s_page
1740  Starting object index within @s_page which used for live object * in the subpage. 等于obj_idx
1742  返回:ret
调用者
名称描述
__zs_compact