예제 #1
0
파일: cpu.c 프로젝트: 383530895/linux
void put_online_cpus(void)
{
	if (cpu_hotplug.active_writer == current)
		return;
	if (!mutex_trylock(&cpu_hotplug.lock)) {
		atomic_inc(&cpu_hotplug.puts_pending);
		cpuhp_lock_release();
		return;
	}

	if (WARN_ON(!cpu_hotplug.refcount))
		cpu_hotplug.refcount++; /* try to fix things up */

	if (!--cpu_hotplug.refcount && unlikely(cpu_hotplug.active_writer))
		wake_up_process(cpu_hotplug.active_writer);
	mutex_unlock(&cpu_hotplug.lock);
	cpuhp_lock_release();

}
예제 #2
0
void put_online_cpus(void)
{
	int refcount;

	if (cpu_hotplug.active_writer == current)
		return;

	refcount = atomic_dec_return(&cpu_hotplug.refcount);
	if (WARN_ON(refcount < 0)) /* try to fix things up */
		atomic_inc(&cpu_hotplug.refcount);

	if (refcount <= 0 && waitqueue_active(&cpu_hotplug.wq))
		wake_up(&cpu_hotplug.wq);

	cpuhp_lock_release();

}
예제 #3
0
파일: cpu.c 프로젝트: borkmann/kasan
void cpu_hotplug_done(void)
{
	cpu_hotplug.active_writer = NULL;
	mutex_unlock(&cpu_hotplug.lock);
	cpuhp_lock_release();
}