Commit f30182b3 authored by Guo Mengqi's avatar Guo Mengqi Committed by Zheng Zengkai
Browse files

mm: sharepool: use built-in-statistics

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5J0YW


CVE: NA
--------------------------------

Sharepool owns an statistics system which allow user to check the memory
use easily. The statistics codes are quite independent from the major
functions. However, the realization is very similar with the major
functions, which doubles the lock use and cause nesting problems.

Thus we remove the statistics system, and put all the statistics into raw
data structures as built-in statistics. The user api did not change.
This can greatly reduce the complexity of locks, as well as remove hundred
lines of redundant codes.

Signed-off-by: default avatarGuo Mengqi <guomengqi3@huawei.com>
Reviewed-by: default avatarWeilong Chen <chenweilong@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 6cfda1d2
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ extern int sysctl_sp_perf_alloc;

extern int sysctl_sp_perf_k2u;

#ifdef __GENKSYMS__
/* we estimate an sp-group ususally contains at most 64 sp-group */
#define SP_SPG_HASH_BITS 6

@@ -206,6 +207,7 @@ struct sp_group_node {
	struct sp_group *spg;
	unsigned long prot;
};
#endif

struct sp_walk_data {
	struct page **pages;
@@ -508,11 +510,6 @@ static inline bool mg_is_sharepool_addr(unsigned long addr)
	return false;
}

static inline struct sp_proc_stat *sp_get_proc_stat_ref(struct mm_struct *mm)
{
	return NULL;
}

static inline void spa_overview_show(struct seq_file *seq)
{
}
+373 −470

File changed.

Preview size limit exceeded, changes collapsed.