• Home
  • Raw
  • Download

Lines Matching refs:size

212 	int size;  member
326 static int zs_zpool_malloc(void *pool, size_t size, gfp_t gfp, in zs_zpool_malloc() argument
329 *handle = zs_malloc(pool, size); in zs_zpool_malloc()
389 static unsigned int get_maxobj_per_zspage(int size, int pages_per_zspage) in get_maxobj_per_zspage() argument
391 return pages_per_zspage * PAGE_SIZE / size; in get_maxobj_per_zspage()
436 static int get_size_class_index(int size) in get_size_class_index() argument
440 if (likely(size > ZS_MIN_ALLOC_SIZE)) in get_size_class_index()
441 idx = DIV_ROUND_UP(size - ZS_MIN_ALLOC_SIZE, in get_size_class_index()
513 objs_per_zspage = get_maxobj_per_zspage(class->size, in zs_stats_size_show()
519 i, class->size, class_almost_full, class_almost_empty, in zs_stats_size_show()
931 while ((off += class->size) < PAGE_SIZE) { in init_zspage()
933 link += class->size / sizeof(*link); in init_zspage()
998 first_page->objects = class->pages_per_zspage * PAGE_SIZE / class->size; in alloc_zspage()
1048 struct page *pages[2], int off, int size) in __zs_map_object() argument
1056 struct page *pages[2], int off, int size) in __zs_unmap_object() argument
1086 struct page *pages[2], int off, int size) in __zs_map_object() argument
1100 sizes[1] = size - sizes[0]; in __zs_map_object()
1114 struct page *pages[2], int off, int size) in __zs_unmap_object() argument
1127 size -= ZS_HANDLE_SIZE; in __zs_unmap_object()
1132 sizes[1] = size - sizes[0]; in __zs_unmap_object()
1217 static bool can_merge(struct size_class *prev, int size, int pages_per_zspage) in can_merge() argument
1222 if (get_maxobj_per_zspage(prev->size, prev->pages_per_zspage) in can_merge()
1223 != get_maxobj_per_zspage(size, pages_per_zspage)) in can_merge()
1285 off = obj_idx_to_offset(page, obj_idx, class->size); in zs_map_object()
1289 if (off + class->size <= PAGE_SIZE) { in zs_map_object()
1301 ret = __zs_map_object(area, pages, off, class->size); in zs_map_object()
1326 off = obj_idx_to_offset(page, obj_idx, class->size); in zs_unmap_object()
1329 if (off + class->size <= PAGE_SIZE) in zs_unmap_object()
1338 __zs_unmap_object(area, pages, off, class->size); in zs_unmap_object()
1358 m_offset = obj_idx_to_offset(m_page, m_objidx, class->size); in obj_malloc()
1386 unsigned long zs_malloc(struct zs_pool *pool, size_t size) in zs_malloc() argument
1392 if (unlikely(!size || size > ZS_MAX_ALLOC_SIZE)) in zs_malloc()
1400 size += ZS_HANDLE_SIZE; in zs_malloc()
1401 class = pool->size_class[get_size_class_index(size)]; in zs_malloc()
1420 class->size, class->pages_per_zspage)); in zs_malloc()
1450 f_offset = obj_idx_to_offset(f_page, f_objidx, class->size); in obj_free()
1489 class->size, class->pages_per_zspage)); in zs_free()
1508 int s_size, d_size, size; in zs_object_copy() local
1511 s_size = d_size = class->size; in zs_object_copy()
1516 s_off = obj_idx_to_offset(s_page, s_objidx, class->size); in zs_object_copy()
1517 d_off = obj_idx_to_offset(d_page, d_objidx, class->size); in zs_object_copy()
1519 if (s_off + class->size > PAGE_SIZE) in zs_object_copy()
1522 if (d_off + class->size > PAGE_SIZE) in zs_object_copy()
1529 size = min(s_size, d_size); in zs_object_copy()
1530 memcpy(d_addr + d_off, s_addr + s_off, size); in zs_object_copy()
1531 written += size; in zs_object_copy()
1533 if (written == class->size) in zs_object_copy()
1536 s_off += size; in zs_object_copy()
1537 s_size -= size; in zs_object_copy()
1538 d_off += size; in zs_object_copy()
1539 d_size -= size; in zs_object_copy()
1548 s_size = class->size - written; in zs_object_copy()
1557 d_size = class->size - written; in zs_object_copy()
1580 offset += class->size * index; in find_alloced_obj()
1591 offset += class->size; in find_alloced_obj()
1687 class->size, class->pages_per_zspage)); in putback_zspage()
1817 int size; in zs_create_pool() local
1821 size = ZS_MIN_ALLOC_SIZE + i * ZS_SIZE_CLASS_DELTA; in zs_create_pool()
1822 if (size > ZS_MAX_ALLOC_SIZE) in zs_create_pool()
1823 size = ZS_MAX_ALLOC_SIZE; in zs_create_pool()
1824 pages_per_zspage = get_pages_per_zspage(size); in zs_create_pool()
1836 if (can_merge(prev_class, size, pages_per_zspage)) { in zs_create_pool()
1846 class->size = size; in zs_create_pool()
1850 get_maxobj_per_zspage(size, pages_per_zspage) == 1) in zs_create_pool()
1890 class->size, fg); in zs_destroy_pool()