lkml.org 
[lkml]   [2012]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [Patch v4 1/7] acpi,memory-hotplug: introduce a mutex lock to protect the list in acpi_memory_device
From
Date
On Thu, 2012-11-08 at 19:04 +0800, Wen Congyang wrote:
> The memory device can be removed by 2 ways:
> 1. send eject request by SCI
> 2. echo 1 >/sys/bus/pci/devices/PNP0C80:XX/eject
>
> This 2 events may happen at the same time, so we may touch
> acpi_memory_device.res_list at the same time. This patch
> introduce a lock to protect this list.

Hi Wen,

This race condition is not unique in memory hot-remove as the sysfs
eject interface is created for all objects with _EJ0. For CPU
hot-remove, I addressed this race condition by making the notify handler
to run the hot-remove operation on kacpi_hotplug_wq by calling
acpi_os_hotplug_execute(). This serializes the hot-remove operations
among the two events since the sysfs eject also runs on
kacpi_hotplug_wq. This way is much simpler and is easy to maintain,
although it does not allow both operations to run simultaneously (which
I do not think we need). Can it be used for memory hot-remove as well?

Thanks,
-Toshi



\
 
 \ /
  Last update: 2012-11-12 22:41    [W:0.063 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site