函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:attempts to compress and store an single page

函数原型:static int zswap_frontswap_store(unsigned type, unsigned long offset, struct page *page)

返回类型:int

参数:

类型参数名称
unsignedtype
unsigned longoffset
struct page *page
990  tree等于zswap_trees[type]
994  dlen等于PAGE_SIZE
998  struct zswap_header zhdr = {swpentry = Store a type+offset into a swp_entry_t in an arch-independent format}
1002  如果PageHuge() only returns true for hugetlbfs pages, but not for* normal or transparent huge pages.* PageTransHuge() returns true for both transparent huge and* hugetlbfs pages, but not normal pages. PageTransHuge() can only be
1003  ret等于负EINVAL
1004  转到:reject
1007  如果非Enable/disable zswap (disabled by default) 或非tree
1008  ret等于负ENODEV
1009  转到:reject
1013  如果zswap_is_full()则
1014  Pool limit was hit (see zswap_max_pool_percent) 自加
1015  如果zswap_shrink()则
1017  ret等于负ENOMEM
1018  转到:reject
1025  如果zswap_is_full()则
1026  ret等于负ENOMEM
1027  转到:reject
1032  entry等于zswap_entry_cache_alloc(GFP_KERNEL)
1033  如果非entry
1034  Store failed because the entry metadata could not be allocated (rare) 自加
1035  ret等于负ENOMEM
1036  转到:reject
1039  如果Enable/disable handling same-value filled pages (enabled by default)
1040  src等于kmap_atomic(page)
1041  如果zswap_is_page_same_filled(src, & value)则
1047  转到:insert_entry
1049  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.(src)
1053  the zswap_pool the entry's data is in等于zswap_pool_current_get()
1054  如果非 the zswap_pool the entry's data is in
1055  ret等于负EINVAL
1056  转到:freepage
1060  dst等于Must be an lvalue. Since @var must be a simple identifier,* we force a syntax error here if it isn't.(per-cpu code)
1061  tfm等于get_cpu_ptr(tfm)
1062  src等于kmap_atomic(page)
1063  ret等于crypto_comp_compress(tfm, src, PAGE_SIZE, dst, & dlen)
1064  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.(src)
1065  put_cpu_ptr(tfm)
1066  如果ret
1067  ret等于负EINVAL
1068  转到:put_dstmem
1072  hlen等于如果zpool_evictable(zpool)则zhdr的长度否则0
1073  gfp等于__GFP_NORETRY按位或DOC: Action modifiers* Action modifiers* ~~~~~~~~~~~~~~~~* %__GFP_NOWARN suppresses allocation failure reports.* %__GFP_COMP address compound page metadata.* %__GFP_ZERO returns a zeroed page on success.按位或kswapd can wake
1074  如果zpool_malloc_support_movable(zpool)则gfp或等于__GFP_HIGHMEM按位或ZONE_MOVABLE allowed
1076  ret等于zpool_malloc(zpool, hlen + dlen, gfp, & handle)
1077  如果ret恒等于负ENOSPC
1078  Compressed page was too big for the allocator to (optimally) store 自加
1079  转到:put_dstmem
1081  如果ret
1082  Store failed because underlying allocator could not get memory 自加
1083  转到:put_dstmem
1085  buf等于zpool_map_handle(zpool, handle, rmal read-write mapping )
1086  内存复制(buf, & zhdr, hlen)
1087  内存复制(buf + hlen, dst, dlen)
1088  zpool_unmap_handle(zpool, handle)
1089  The weird & is necessary because sparse considers (void)(var) to be* a direct dereference of percpu variable (var).(per-cpu code)
1092  the swap offset for the entry. Index into the red-black tree.等于offset
1093  zpool allocation handle that stores the compressed page data等于handle
1094  the length in bytes of the compressed page data. Needed during等于dlen
1096  insert_entry :
1098  加自旋锁
1099  循环
1100  ret等于In the case that a entry with the same offset is found, a pointer to* the existing entry is stored in dupentry and the function returns -EEXIST
1101  如果ret恒等于负EEXIST
1107 ret恒等于负EEXIST循环
1108  自旋锁解锁
1111  atomic_inc( & The number of compressed pages currently stored in zswap )
1112  zswap_update_total_size()
1114  返回:0
1116  put_dstmem :
1117  The weird & is necessary because sparse considers (void)(var) to be* a direct dereference of percpu variable (var).(per-cpu code)
1118  zswap_pool_put( the zswap_pool the entry's data is in)
1119  freepage :
1120  zswap_entry_cache_free(entry)
1121  reject :
1122  返回:ret