• Chao Yu's avatar
    f2fs: merge two uchar variable in struct node_info to reduce memory cost · 5c27f4ee
    Chao Yu authored
    This patch moves one member of struct nat_entry: _flag_ to struct node_info,
    so _version_ in struct node_info and _flag_ which are unsigned char type will
    merge to one 32-bit space in register/memory. So the size of nat_entry will be
    reduced from 28 bytes to 24 bytes (for 64-bit machine, reduce its size from 40
    bytes to 32 bytes) and then slab memory using by f2fs will be reduced.
    
    changes from v2:
     o update description of memory usage gain for 64-bit machine suggested by
       Changman Lee.
    changes from v1:
     o introduce inline copy_node_info() to copy valid data from node info suggested
       by Jaegeuk Kim, it can avoid bug.
    Reviewed-by: default avatarChangman Lee <cm224.lee@samsung.com>
    Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
    Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
    5c27f4ee
node.c 50.1 KB