summaryrefslogtreecommitdiffstats
path: root/mm/sparse.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/sparse.c')
-rw-r--r--mm/sparse.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/mm/sparse.c b/mm/sparse.c
index 6b01022e23a9..41579b66fff1 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -728,8 +728,8 @@ static void free_map_bootmem(struct page *memmap)
728 * * -EEXIST - Section has been present. 728 * * -EEXIST - Section has been present.
729 * * -ENOMEM - Out of memory. 729 * * -ENOMEM - Out of memory.
730 */ 730 */
731int __meminit sparse_add_one_section(int nid, unsigned long start_pfn, 731int __meminit sparse_add_section(int nid, unsigned long start_pfn,
732 struct vmem_altmap *altmap) 732 unsigned long nr_pages, struct vmem_altmap *altmap)
733{ 733{
734 unsigned long section_nr = pfn_to_section_nr(start_pfn); 734 unsigned long section_nr = pfn_to_section_nr(start_pfn);
735 struct mem_section_usage *usage; 735 struct mem_section_usage *usage;
@@ -835,8 +835,9 @@ static void free_section_usage(struct mem_section *ms, struct page *memmap,
835 free_map_bootmem(memmap); 835 free_map_bootmem(memmap);
836} 836}
837 837
838void sparse_remove_one_section(struct mem_section *ms, unsigned long map_offset, 838void sparse_remove_one_section(struct mem_section *ms, unsigned long pfn,
839 struct vmem_altmap *altmap) 839 unsigned long nr_pages, unsigned long map_offset,
840 struct vmem_altmap *altmap)
840{ 841{
841 struct page *memmap = NULL; 842 struct page *memmap = NULL;
842 struct mem_section_usage *usage = NULL; 843 struct mem_section_usage *usage = NULL;
@@ -849,10 +850,7 @@ void sparse_remove_one_section(struct mem_section *ms, unsigned long map_offset,
849 ms->usage = NULL; 850 ms->usage = NULL;
850 } 851 }
851 852
852 clear_hwpoisoned_pages(memmap + map_offset, 853 clear_hwpoisoned_pages(memmap + map_offset, nr_pages - map_offset);
853 PAGES_PER_SECTION - map_offset); 854 free_section_usage(ms, memmap, usage, pfn, nr_pages, altmap);
854 free_section_usage(ms, memmap, usage,
855 section_nr_to_pfn(__section_nr(ms)),
856 PAGES_PER_SECTION, altmap);
857} 855}
858#endif /* CONFIG_MEMORY_HOTPLUG */ 856#endif /* CONFIG_MEMORY_HOTPLUG */