mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-20 18:54:09 +08:00
7b98447722
This patch adds reference counting for ACPI IPMI transfers to tune the locking granularity of tx_msg_lock. This patch also makes the whole acpi_ipmi module's coding style consistent by using reference counting for all its objects (i.e., acpi_ipmi_device and acpi_ipmi_msg). The acpi_ipmi_msg handling is re-designed using referece counting. 1. tx_msg is always unlinked before complete(), so that it is safe to put complete() out side of tx_msg_lock. 2. tx_msg reference counters are incremented before calling ipmi_request_settime() and tx_msg_lock protection is added to ipmi_cancel_tx_msg() so that a complete() can be safely called in parellel with tx_msg unlinking in failure cases. 3. tx_msg holds a reference to acpi_ipmi_device so that it can be flushed and freed in the contexts other than acpi_ipmi_space_handler(). The lockdep_chains shows all acpi_ipmi locks are leaf locks after the tuning: 1. ipmi_lock is always leaf: irq_context: 0 [ffffffff81a943f8] smi_watchers_mutex [ffffffffa06eca60] driver_data.ipmi_lock irq_context: 0 [ffffffff82767b40] &buffer->mutex [ffffffffa00a6678] s_active#103 [ffffffffa06eca60] driver_data.ipmi_lock 2. without this patch applied, lock used by complete() is held after holding tx_msg_lock: irq_context: 0 [ffffffff82767b40] &buffer->mutex [ffffffffa00a6678] s_active#103 [ffffffffa06ecce8] &(&ipmi_device->tx_msg_lock)->rlock irq_context: 1 [ffffffffa06ecce8] &(&ipmi_device->tx_msg_lock)->rlock irq_context: 1 [ffffffffa06ecce8] &(&ipmi_device->tx_msg_lock)->rlock [ffffffffa06eccf0] &x->wait#25 irq_context: 1 [ffffffffa06ecce8] &(&ipmi_device->tx_msg_lock)->rlock [ffffffffa06eccf0] &x->wait#25 [ffffffff81e36620] &p->pi_lock irq_context: 1 [ffffffffa06ecce8] &(&ipmi_device->tx_msg_lock)->rlock [ffffffffa06eccf0] &x->wait#25 [ffffffff81e36620] &p->pi_lock [ffffffff81e5d0a8] &rq->lock 3. with this patch applied, tx_msg_lock is always leaf: irq_context: 0 [ffffffff82767b40] &buffer->mutex [ffffffffa00a66d8] s_active#107 [ffffffffa07ecdc8] &(&ipmi_device->tx_msg_lock)->rlock irq_context: 1 [ffffffffa07ecdc8] &(&ipmi_device->tx_msg_lock)->rlock Signed-off-by: Lv Zheng <lv.zheng@intel.com> Reviewed-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> |
||
---|---|---|
.. | ||
acpica | ||
apei | ||
ac.c | ||
acpi_cmos_rtc.c | ||
acpi_ipmi.c | ||
acpi_lpss.c | ||
acpi_memhotplug.c | ||
acpi_pad.c | ||
acpi_platform.c | ||
acpi_processor.c | ||
battery.c | ||
bgrt.c | ||
blacklist.c | ||
bus.c | ||
button.c | ||
cm_sbs.c | ||
container.c | ||
custom_method.c | ||
debugfs.c | ||
device_pm.c | ||
dock.c | ||
ec_sys.c | ||
ec.c | ||
event.c | ||
fan.c | ||
glue.c | ||
hed.c | ||
internal.h | ||
Kconfig | ||
Makefile | ||
numa.c | ||
nvs.c | ||
osl.c | ||
pci_irq.c | ||
pci_link.c | ||
pci_root.c | ||
pci_slot.c | ||
power.c | ||
proc.c | ||
processor_core.c | ||
processor_driver.c | ||
processor_idle.c | ||
processor_perflib.c | ||
processor_thermal.c | ||
processor_throttling.c | ||
reboot.c | ||
resource.c | ||
sbs.c | ||
sbshc.c | ||
sbshc.h | ||
scan.c | ||
sleep.c | ||
sleep.h | ||
sysfs.c | ||
tables.c | ||
thermal.c | ||
utils.c | ||
video_detect.c | ||
video.c | ||
wakeup.c |