Commit a66281c5 authored by Xu Qiang's avatar Xu Qiang Committed by Zhang Zekun
Browse files

mm/sharepool: Add sp_group_sem protection.

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



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

In sp_update_process_stat, traverse node_list
and lock protection is required.

Signed-off-by: default avatarXu Qiang <xuqiang36@huawei.com>
parent 7843fb44
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -841,8 +841,11 @@ static void sp_update_process_stat(struct task_struct *tsk, bool inc,
	unsigned long size = spa->real_size;
	enum spa_type type = spa->type;

	down_read(&sp_group_sem);
	spg_node = find_spg_node_by_spg(tsk->mm, spa->spg);
	if (spg_node != NULL)
		update_mem_usage(size, inc, spa->is_hugepage, spg_node, type);
	up_read(&sp_group_sem);
}

static inline void check_interrupt_context(void)