Skip to content

Commit

Permalink
[PATCH] memory hotadd fixes: avoid check in acpi
Browse files Browse the repository at this point in the history
add_memory() does all necessary check to avoid collision.  then, acpi layer
doesn't have to check region by itself.

(*) pfn_valid() just returns page struct is valid or not. It returns 0
    if a section has been already added even is ioresource is not added.
    ioresource collision check in mm/memory_hotplug.c can do more precise
    collistion check.
    added enabled bit check just for sanity check..

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Keith Mannthey <kmannth@gmail.com>
Cc: Yasunori Goto <y-goto@jp.fujitsu.com>
Cc: Dave Hansen <haveblue@us.ibm.com>
Cc: "Brown, Len" <len.brown@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
KAMEZAWA Hiroyuki authored and Linus Torvalds committed Aug 6, 2006
1 parent 58c1b5b commit fa25d8d
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions drivers/acpi/acpi_memhotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,10 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
* (i.e. memory-hot-remove function)
*/
list_for_each_entry(info, &mem_device->res_list, list) {
u64 start_pfn, end_pfn;

start_pfn = info->start_addr >> PAGE_SHIFT;
end_pfn = (info->start_addr + info->length - 1) >> PAGE_SHIFT;

if (pfn_valid(start_pfn) || pfn_valid(end_pfn)) {
/* already enabled. try next area */
if (info->enabled) { /* just sanity check...*/
num_enabled++;
continue;
}

result = add_memory(node, info->start_addr, info->length);
if (result)
continue;
Expand Down

0 comments on commit fa25d8d

Please sign in to comment.