Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:zs_object_copy

Proto:static void zs_object_copy(struct size_class *class, unsigned long dst, unsigned long src)

Type:void

Parameter:

TypeParameterName
struct size_class *class
unsigned longdst
unsigned longsrc
1593  written = 0
1595  s_size = d_size = * Size of objects stored in this class. Must be multiple * of ZS_ALIGN.
1597  bj_to_location - get (, ) from encoded object value*@obj: the encoded object value*@page: page object resides in zspage*@obj_idx: object index
1598  bj_to_location - get (, ) from encoded object value*@obj: the encoded object value*@page: page object resides in zspage*@obj_idx: object index
1600  s_off = * Size of objects stored in this class. Must be multiple * of ZS_ALIGN. * s_objidx & ~PAGE_MASK
1601  d_off = * Size of objects stored in this class. Must be multiple * of ZS_ALIGN. * d_objidx & ~PAGE_MASK
1603  If s_off + * Size of objects stored in this class. Must be multiple * of ZS_ALIGN. > PAGE_SIZE Then s_size = PAGE_SIZE - s_off
1606  If d_off + * Size of objects stored in this class. Must be multiple * of ZS_ALIGN. > PAGE_SIZE Then d_size = PAGE_SIZE - d_off
1609  s_addr = kmap_atomic(s_page)
1610  d_addr = kmap_atomic(d_page)
1612  When 1 cycle
1613  size = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(s_size, d_size)
1614  memcpy(d_addr + d_off, s_addr + s_off, size)
1615  written += size
1617  If written == * Size of objects stored in this class. Must be multiple * of ZS_ALIGN. Then Break
1620  s_off += size
1621  s_size -= size
1622  d_off += size
1623  d_size -= size
1625  If s_off >= PAGE_SIZE Then
1632  s_off = 0
1635  If d_off >= PAGE_SIZE Then
1640  d_off = 0
1644  Prevent people trying to call kunmap_atomic() as if it were kunmap()* kunmap_atomic() should get the return value of kmap_atomic, not the page.(d_addr)
1645  Prevent people trying to call kunmap_atomic() as if it were kunmap()* kunmap_atomic() should get the return value of kmap_atomic, not the page.(s_addr)
Caller
NameDescribe
migrate_zspage