Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115833
b: refs/heads/master
c: 7108878
h: refs/heads/master
i:
  115831: 3a871fd
v: v3
  • Loading branch information
Badari Pulavarty authored and Linus Torvalds committed Oct 20, 2008
1 parent 2058f6e commit 5c6872b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 47 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8433ac61acf733dc4b427de5f0891518c21538f9
refs/heads/master: 71088785c6bc68fddb450063d57b1bd1c78e0ea1
17 changes: 0 additions & 17 deletions trunk/arch/ia64/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,23 +700,6 @@ int arch_add_memory(int nid, u64 start, u64 size)

return ret;
}
#ifdef CONFIG_MEMORY_HOTREMOVE
int remove_memory(u64 start, u64 size)
{
unsigned long start_pfn, end_pfn;
unsigned long timeout = 120 * HZ;
int ret;
start_pfn = start >> PAGE_SHIFT;
end_pfn = start_pfn + (size >> PAGE_SHIFT);
ret = offline_pages(start_pfn, end_pfn, timeout);
if (ret)
goto out;
/* we can free mem_map at this point */
out:
return ret;
}
EXPORT_SYMBOL_GPL(remove_memory);
#endif /* CONFIG_MEMORY_HOTREMOVE */
#endif

/*
Expand Down
17 changes: 0 additions & 17 deletions trunk/arch/powerpc/mm/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,23 +134,6 @@ int arch_add_memory(int nid, u64 start, u64 size)

return __add_pages(zone, start_pfn, nr_pages);
}

#ifdef CONFIG_MEMORY_HOTREMOVE
int remove_memory(u64 start, u64 size)
{
unsigned long start_pfn, end_pfn;
int ret;

start_pfn = start >> PAGE_SHIFT;
end_pfn = start_pfn + (size >> PAGE_SHIFT);
ret = offline_pages(start_pfn, end_pfn, 120 * HZ);
if (ret)
goto out;
/* Arch-specific calls go here - next patch */
out:
return ret;
}
#endif /* CONFIG_MEMORY_HOTREMOVE */
#endif /* CONFIG_MEMORY_HOTPLUG */

/*
Expand Down
11 changes: 0 additions & 11 deletions trunk/arch/s390/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,3 @@ int arch_add_memory(int nid, u64 start, u64 size)
return rc;
}
#endif /* CONFIG_MEMORY_HOTPLUG */

#ifdef CONFIG_MEMORY_HOTREMOVE
int remove_memory(u64 start, u64 size)
{
unsigned long start_pfn, end_pfn;

start_pfn = PFN_DOWN(start);
end_pfn = start_pfn + PFN_DOWN(size);
return offline_pages(start_pfn, end_pfn, 120 * HZ);
}
#endif /* CONFIG_MEMORY_HOTREMOVE */
12 changes: 11 additions & 1 deletion trunk/mm/memory_hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <linux/delay.h>
#include <linux/migrate.h>
#include <linux/page-isolation.h>
#include <linux/pfn.h>

#include <asm/tlbflush.h>

Expand Down Expand Up @@ -849,10 +850,19 @@ int offline_pages(unsigned long start_pfn,

return ret;
}

int remove_memory(u64 start, u64 size)
{
unsigned long start_pfn, end_pfn;

start_pfn = PFN_DOWN(start);
end_pfn = start_pfn + PFN_DOWN(size);
return offline_pages(start_pfn, end_pfn, 120 * HZ);
}
#else
int remove_memory(u64 start, u64 size)
{
return -EINVAL;
}
EXPORT_SYMBOL_GPL(remove_memory);
#endif /* CONFIG_MEMORY_HOTREMOVE */
EXPORT_SYMBOL_GPL(remove_memory);

0 comments on commit 5c6872b

Please sign in to comment.