From: Yuan Can <yuancan@huawei.com> hulk inclusion category: feature category: bugfix bugzilla: NA ------------------ This log was used to notice the user that they use sharepool in an unrecommand manner that allocate memory in a process and free memory in another process. But this usage case is needed in real world and this message seems useless and confuses the user. And this produces too much log in mdc scene. Just delete this log. Fixes: cda50cb21293 ("mm/sharepool: support fork() and exit() to handle the mm") Signed-off-by: Yuan Can <yuancan@huawei.com> Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com> --- mm/share_pool.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/mm/share_pool.c b/mm/share_pool.c index 5cd4efce8f68..f52705ac814b 100644 --- a/mm/share_pool.c +++ b/mm/share_pool.c @@ -3573,8 +3573,6 @@ static void __init proc_sharepool_init(void) void __sp_mm_clean(struct mm_struct *mm) { - struct sp_meminfo *meminfo; - long alloc_size, k2u_size; /* lockless visit */ struct sp_group_master *master = mm->sp_group_master; struct sp_group_node *spg_node, *tmp; @@ -3583,29 +3581,6 @@ void __sp_mm_clean(struct mm_struct *mm) if (!master) return; - /* - * There are two basic scenarios when a process in the share pool is - * exiting but its share pool memory usage is not 0. - * 1. Process A called sp_alloc(), but it terminates without calling - * sp_free(). Then its share pool memory usage is a positive number. - * 2. Process A never called sp_alloc(), and process B in the same spg - * called sp_alloc() to get an addr u. Then A gets u somehow and - * called sp_free(u). Now A's share pool memory usage is a negative - * number. Notice B's memory usage will be a positive number. - * - * We decide to print an info when seeing both of the scenarios. - * - * A process not in an sp group doesn't need to print because there - * wont't be any memory which is not freed. - */ - meminfo = &master->meminfo; - alloc_size = meminfo_alloc_sum(meminfo); - k2u_size = atomic64_read(&meminfo->k2u_size); - if (alloc_size != 0 || k2u_size != 0) - pr_info("process %s(%d) exits. It applied %ld aligned KB, k2u shared %ld aligned KB\n", - master->comm, master->tgid, - byte2kb(alloc_size), byte2kb(k2u_size)); - down_write(&sp_global_sem); list_for_each_entry_safe(spg_node, tmp, &master->group_head, group_node) { spg = spg_node->spg; -- 2.43.0