Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:migrate_zspage

Proto:static int migrate_zspage(struct zs_pool *pool, struct size_class *class, struct zs_compact_control *cc)

Type:int

Parameter:

TypeParameterName
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  When 1 cycle
1706  handle = Find alloced object in zspage from index object and* return handle.
1707  If Not handle Then
1709  If Not s_page Then Break
1711  obj_idx = 0
1712  Continue
1716  If zspage_full(class, get_zspage(d_page)) Then
1717  unpin_tag(handle)
1718  ret = -ENOMEM
1719  Break
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  Return ret
Caller
NameDescribe
__zs_compact