提交 51a552b0 编写于 作者: X Xu Qiang 提交者: Zhang Zekun

mm/sharepool: Delete total_num and total_size in sp_spa_stat

hulk inclusion
category: other
bugzilla: https://gitee.com/openeuler/kernel/issues/I6GI0X

----------------------------------------------

total_num and total_size in sp_spa_stat is redundant,
they can be calculated, so delete them.
Signed-off-by: NXu Qiang <xuqiang36@huawei.com>
上级 a66281c5
......@@ -645,11 +645,9 @@ static void update_mem_usage_k2u(unsigned long size, bool inc,
}
struct sp_spa_stat {
atomic64_t total_num;
atomic64_t alloc_num;
atomic64_t k2u_task_num;
atomic64_t k2u_spg_num;
atomic64_t total_size;
atomic64_t alloc_size;
atomic64_t k2u_task_size;
atomic64_t k2u_spg_size;
......@@ -750,12 +748,6 @@ static void spa_inc_usage(struct sp_area *spa)
}
atomic_inc(&spa->spg->spa_num);
/*
* all the calculations won't overflow due to system limitation and
* parameter checking in sp_alloc_area()
*/
atomic64_inc(&spa_stat.total_num);
atomic64_add(size, &spa_stat.total_size);
if (!is_local_group(spa->spg->id)) {
atomic_inc(&sp_overall_stat.spa_total_num);
......@@ -797,8 +789,6 @@ static void spa_dec_usage(struct sp_area *spa)
}
atomic_dec(&spa->spg->spa_num);
atomic64_dec(&spa_stat.total_num);
atomic64_sub(size, &spa_stat.total_size);
if (!is_local_group(spa->spg->id)) {
atomic_dec(&sp_overall_stat.spa_total_num);
......@@ -3825,16 +3815,16 @@ static void spa_overview_show(struct seq_file *seq)
if (!sp_is_enabled())
return;
total_num = atomic64_read(&spa_stat.total_num);
alloc_num = atomic64_read(&spa_stat.alloc_num);
k2u_task_num = atomic64_read(&spa_stat.k2u_task_num);
k2u_spg_num = atomic64_read(&spa_stat.k2u_spg_num);
total_size = atomic64_read(&spa_stat.total_size);
alloc_size = atomic64_read(&spa_stat.alloc_size);
k2u_task_size = atomic64_read(&spa_stat.k2u_task_size);
k2u_spg_size = atomic64_read(&spa_stat.k2u_spg_size);
dvpp_size = atomic64_read(&spa_stat.dvpp_size);
dvpp_va_size = atomic64_read(&spa_stat.dvpp_va_size);
total_num = alloc_num + k2u_task_num + k2u_spg_num;
total_size = alloc_size + k2u_task_size + k2u_spg_size;
SEQ_printf(seq, "Spa total num %lld.\n", total_num);
SEQ_printf(seq, "Spa alloc num %lld, k2u(task) num %lld, k2u(spg) num %lld.\n",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册