Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:obj_free

Proto:static void obj_free(struct size_class *class, unsigned long obj)

Type:void

Parameter:

TypeParameterName
struct size_class *class
unsigned longobj
1524  obj &= ~Head in allocated object should have OBJ_ALLOCATED_TAG* to identify the object was allocated or not.* It's okay to add the status bit in the least bit because* header keeps handle which is 4byte-aligned address so we* have room for two bit at least.
1525  bj_to_location - get (, ) from encoded object value*@obj: the encoded object value*@page: page object resides in zspage*@obj_idx: object index
1526  f_offset = * Size of objects stored in this class. Must be multiple * of ZS_ALIGN. * f_objidx & ~PAGE_MASK
1527  zspage = get_zspage(f_page)
1529  vaddr = kmap_atomic(f_page)
1532  link = vaddr + f_offset
1533  Free object index;* It's valid for non-allocated object = get_freeobj(zspage) << OBJ_TAG_BITS
1534  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.(vaddr)
1535  set_freeobj(zspage, f_objidx)
1536  mod_zspage_inuse(zspage, - 1)
1537  ype can be of enum type zs_stat_type or fullness_group
Caller
NameDescribe
zs_free
migrate_zspage