Commit 39148316 authored by Cheng Yu's avatar Cheng Yu
Browse files

Revert "sched: add mutex lock to protect qos_level"

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IAS45L



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

This reverts commit 995f0e60.

RCU is an atomic operation, and calling a sleepable mutex in RCU is not
allowed.

Fixes: 995f0e60 ("sched: add mutex lock to protect qos_level")
Signed-off-by: default avatarCheng Yu <serein.chengyu@huawei.com>
Signed-off-by: default avatarZucheng Zheng <zhengzucheng@huawei.com>
parent 677c06d9
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -8636,13 +8636,6 @@ static inline int alloc_qos_sched_group(struct task_group *tg,
#ifdef CONFIG_QOS_SCHED_SMT_EXPELLER
	tg->smt_expell = parent->smt_expell;
#endif
	tg->qos_level_mutex = kzalloc(sizeof(struct mutex), GFP_KERNEL);

	if (!tg->qos_level_mutex)
		return 0;

	mutex_init(tg->qos_level_mutex);

	return 1;
}

@@ -9727,7 +9720,6 @@ static int tg_change_scheduler(struct task_group *tg, void *data)
	s64 qos_level = *(s64 *)data;
	struct cgroup_subsys_state *css = &tg->css;

	mutex_lock(tg->qos_level_mutex);
	tg->qos_level = qos_level;
	if (is_offline_level(qos_level))
		policy = SCHED_IDLE;
@@ -9745,7 +9737,6 @@ static int tg_change_scheduler(struct task_group *tg, void *data)
		sched_setscheduler(tsk, policy, &param);
	}
	css_task_iter_end(&it);
	mutex_unlock(tg->qos_level_mutex);

	return 0;
}
+0 −3
Original line number Diff line number Diff line
@@ -13691,9 +13691,6 @@ void free_fair_sched_group(struct task_group *tg)
			kfree(tg->se[i]);
	}

#ifdef CONFIG_QOS_SCHED
	kfree(tg->qos_level_mutex);
#endif
	kfree(tg->cfs_rq);
	kfree(tg->se);
}
+0 −4
Original line number Diff line number Diff line
@@ -497,11 +497,7 @@ struct task_group {
#else
	KABI_RESERVE(2)
#endif
#ifdef CONFIG_QOS_SCHED
	KABI_USE(3, struct mutex *qos_level_mutex)
#else
	KABI_RESERVE(3)
#endif
#if defined(CONFIG_QOS_SCHED_SMART_GRID) && !defined(__GENKSYMS__)
	KABI_USE(4, struct auto_affinity *auto_affinity)
#else