RFC: Deadlock in Hotplug and CPUFreq interaction.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am running into a deadlock situation with hotplug and CPUFreq. I 
need to be able to prevent hotplug when changing the cpu frequency of 
my CPU to ensure that the workqueue I post to, doesnt get migrated 
during the cpu frequency change in the target function. I cannot 
change frequency in the interrupt context as it involves mutexes (in 
the clk_set_rate function and also in the regulator functions).

When the CPU is hotplugged, the hotplug notifications of CPU_PREPARE, 
CPU_UP are handled by CPUFreq to engage the sysfs nodes and also 
initialize the governor. The governor mutex is held before the target 
function is called. Now, if there was another thread, changing the 
frequency of another CPU, it will hold the governor mutex and then 
call the target function and will wait on the hotplug lock.

Thread1 : Change cpu freq core0 > holds governor mutex > calls target 
function > waits on get_online_cpus()

Thread2 : Hotplug core1 > calls get_online_cpus() holds hotplug mutex 
> calls notifiers > Calls CPUFreq notification handlers > waits on 
governor mutex.

I would like to suggest an try_get_online_cpus() that does a 
mutex_trylock(). Are there better ways to overcome this issue?

Thanks,
Praveen

Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm


[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux