Skip to content

Commit 3828a76

Browse files
minchanktorvalds
authored andcommitted
zsmalloc: rename zs_stat_type to class_stat_type
The stat aims for class stat, not zspage so rename it. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Minchan Kim <[email protected]> Acked-by: Sebastian Andrzej Siewior <[email protected]> Tested-by: Sebastian Andrzej Siewior <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra (Intel) <[email protected]> Cc: Sergey Senozhatsky <[email protected]> Cc: Thomas Gleixner <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 67f1c9c commit 3828a76

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

mm/zsmalloc.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ enum fullness_group {
158158
NR_ZS_FULLNESS,
159159
};
160160

161-
enum zs_stat_type {
161+
enum class_stat_type {
162162
CLASS_EMPTY,
163163
CLASS_ALMOST_EMPTY,
164164
CLASS_ALMOST_FULL,
@@ -549,21 +549,21 @@ static int get_size_class_index(int size)
549549
return min_t(int, ZS_SIZE_CLASSES - 1, idx);
550550
}
551551

552-
/* type can be of enum type zs_stat_type or fullness_group */
553-
static inline void zs_stat_inc(struct size_class *class,
552+
/* type can be of enum type class_stat_type or fullness_group */
553+
static inline void class_stat_inc(struct size_class *class,
554554
int type, unsigned long cnt)
555555
{
556556
class->stats.objs[type] += cnt;
557557
}
558558

559-
/* type can be of enum type zs_stat_type or fullness_group */
560-
static inline void zs_stat_dec(struct size_class *class,
559+
/* type can be of enum type class_stat_type or fullness_group */
560+
static inline void class_stat_dec(struct size_class *class,
561561
int type, unsigned long cnt)
562562
{
563563
class->stats.objs[type] -= cnt;
564564
}
565565

566-
/* type can be of enum type zs_stat_type or fullness_group */
566+
/* type can be of enum type class_stat_type or fullness_group */
567567
static inline unsigned long zs_stat_get(struct size_class *class,
568568
int type)
569569
{
@@ -725,7 +725,7 @@ static void insert_zspage(struct size_class *class,
725725
{
726726
struct zspage *head;
727727

728-
zs_stat_inc(class, fullness, 1);
728+
class_stat_inc(class, fullness, 1);
729729
head = list_first_entry_or_null(&class->fullness_list[fullness],
730730
struct zspage, list);
731731
/*
@@ -750,7 +750,7 @@ static void remove_zspage(struct size_class *class,
750750
VM_BUG_ON(is_zspage_isolated(zspage));
751751

752752
list_del_init(&zspage->list);
753-
zs_stat_dec(class, fullness, 1);
753+
class_stat_dec(class, fullness, 1);
754754
}
755755

756756
/*
@@ -964,7 +964,7 @@ static void __free_zspage(struct zs_pool *pool, struct size_class *class,
964964

965965
cache_free_zspage(pool, zspage);
966966

967-
zs_stat_dec(class, OBJ_ALLOCATED, class->objs_per_zspage);
967+
class_stat_dec(class, OBJ_ALLOCATED, class->objs_per_zspage);
968968
atomic_long_sub(class->pages_per_zspage,
969969
&pool->pages_allocated);
970970
}
@@ -1394,7 +1394,7 @@ static unsigned long obj_malloc(struct size_class *class,
13941394

13951395
kunmap_atomic(vaddr);
13961396
mod_zspage_inuse(zspage, 1);
1397-
zs_stat_inc(class, OBJ_USED, 1);
1397+
class_stat_inc(class, OBJ_USED, 1);
13981398

13991399
obj = location_to_obj(m_page, obj);
14001400

@@ -1458,7 +1458,7 @@ unsigned long zs_malloc(struct zs_pool *pool, size_t size, gfp_t gfp)
14581458
record_obj(handle, obj);
14591459
atomic_long_add(class->pages_per_zspage,
14601460
&pool->pages_allocated);
1461-
zs_stat_inc(class, OBJ_ALLOCATED, class->objs_per_zspage);
1461+
class_stat_inc(class, OBJ_ALLOCATED, class->objs_per_zspage);
14621462

14631463
/* We completely set up zspage so mark them as movable */
14641464
SetZsPageMovable(pool, zspage);
@@ -1489,7 +1489,7 @@ static void obj_free(struct size_class *class, unsigned long obj)
14891489
kunmap_atomic(vaddr);
14901490
set_freeobj(zspage, f_objidx);
14911491
mod_zspage_inuse(zspage, -1);
1492-
zs_stat_dec(class, OBJ_USED, 1);
1492+
class_stat_dec(class, OBJ_USED, 1);
14931493
}
14941494

14951495
void zs_free(struct zs_pool *pool, unsigned long handle)

0 commit comments

Comments
 (0)