Unverified Commit 0542be79 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!12397 tracing/timerlat: Drop interface_lock in stop_kthread()

parents 4942ddd0 85c9599b
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -1953,12 +1953,8 @@ static void stop_kthread(unsigned int cpu)
{
	struct task_struct *kthread;

	mutex_lock(&interface_lock);
	kthread = per_cpu(per_cpu_osnoise_var, cpu).kthread;
	kthread = xchg_relaxed(&(per_cpu(per_cpu_osnoise_var, cpu).kthread), NULL);
	if (kthread) {
		per_cpu(per_cpu_osnoise_var, cpu).kthread = NULL;
		mutex_unlock(&interface_lock);

		if (cpumask_test_and_clear_cpu(cpu, &kthread_cpumask) &&
		    !WARN_ON(!test_bit(OSN_WORKLOAD, &osnoise_options))) {
			kthread_stop(kthread);
@@ -1972,7 +1968,6 @@ static void stop_kthread(unsigned int cpu)
			put_task_struct(kthread);
		}
	} else {
		mutex_unlock(&interface_lock);
		/* if no workload, just return */
		if (!test_bit(OSN_WORKLOAD, &osnoise_options)) {
			/*
@@ -1994,8 +1989,12 @@ static void stop_per_cpu_kthreads(void)
{
	int cpu;

	for_each_possible_cpu(cpu)
	cpus_read_lock();

	for_each_online_cpu(cpu)
		stop_kthread(cpu);

	cpus_read_unlock();
}

/*