diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memory_hotplug.c | 6 | ||||
-rw-r--r-- | mm/migrate.c | 11 | ||||
-rw-r--r-- | mm/slab.c | 3 | ||||
-rw-r--r-- | mm/sparse.c | 9 |
4 files changed, 24 insertions, 5 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 1fe76d963ac..1ae2b2cc3a5 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
@@ -69,12 +69,16 @@ int __add_pages(struct zone *zone, unsigned long phys_start_pfn, | |||
69 | for (i = 0; i < nr_pages; i += PAGES_PER_SECTION) { | 69 | for (i = 0; i < nr_pages; i += PAGES_PER_SECTION) { |
70 | err = __add_section(zone, phys_start_pfn + i); | 70 | err = __add_section(zone, phys_start_pfn + i); |
71 | 71 | ||
72 | if (err) | 72 | /* We want to keep adding the rest of the |
73 | * sections if the first ones already exist | ||
74 | */ | ||
75 | if (err && (err != -EEXIST)) | ||
73 | break; | 76 | break; |
74 | } | 77 | } |
75 | 78 | ||
76 | return err; | 79 | return err; |
77 | } | 80 | } |
81 | EXPORT_SYMBOL_GPL(__add_pages); | ||
78 | 82 | ||
79 | static void grow_zone_span(struct zone *zone, | 83 | static void grow_zone_span(struct zone *zone, |
80 | unsigned long start_pfn, unsigned long end_pfn) | 84 | unsigned long start_pfn, unsigned long end_pfn) |
diff --git a/mm/migrate.c b/mm/migrate.c index d444229f259..1c25040693d 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
@@ -439,6 +439,17 @@ redo: | |||
439 | goto unlock_both; | 439 | goto unlock_both; |
440 | } | 440 | } |
441 | 441 | ||
442 | /* Make sure the dirty bit is up to date */ | ||
443 | if (try_to_unmap(page, 1) == SWAP_FAIL) { | ||
444 | rc = -EPERM; | ||
445 | goto unlock_both; | ||
446 | } | ||
447 | |||
448 | if (page_mapcount(page)) { | ||
449 | rc = -EAGAIN; | ||
450 | goto unlock_both; | ||
451 | } | ||
452 | |||
442 | /* | 453 | /* |
443 | * Default handling if a filesystem does not provide | 454 | * Default handling if a filesystem does not provide |
444 | * a migration function. We can only migrate clean | 455 | * a migration function. We can only migrate clean |
@@ -979,7 +979,8 @@ static void __drain_alien_cache(struct kmem_cache *cachep, | |||
979 | * That way we could avoid the overhead of putting the objects | 979 | * That way we could avoid the overhead of putting the objects |
980 | * into the free lists and getting them back later. | 980 | * into the free lists and getting them back later. |
981 | */ | 981 | */ |
982 | transfer_objects(rl3->shared, ac, ac->limit); | 982 | if (rl3->shared) |
983 | transfer_objects(rl3->shared, ac, ac->limit); | ||
983 | 984 | ||
984 | free_block(cachep, ac->entry, ac->avail, node); | 985 | free_block(cachep, ac->entry, ac->avail, node); |
985 | ac->avail = 0; | 986 | ac->avail = 0; |
diff --git a/mm/sparse.c b/mm/sparse.c index 0a51f36ba3a..d7c32de99ee 100644 --- a/mm/sparse.c +++ b/mm/sparse.c | |||
@@ -32,7 +32,10 @@ static struct mem_section *sparse_index_alloc(int nid) | |||
32 | unsigned long array_size = SECTIONS_PER_ROOT * | 32 | unsigned long array_size = SECTIONS_PER_ROOT * |
33 | sizeof(struct mem_section); | 33 | sizeof(struct mem_section); |
34 | 34 | ||
35 | section = alloc_bootmem_node(NODE_DATA(nid), array_size); | 35 | if (system_state == SYSTEM_RUNNING) |
36 | section = kmalloc_node(array_size, GFP_KERNEL, nid); | ||
37 | else | ||
38 | section = alloc_bootmem_node(NODE_DATA(nid), array_size); | ||
36 | 39 | ||
37 | if (section) | 40 | if (section) |
38 | memset(section, 0, array_size); | 41 | memset(section, 0, array_size); |
@@ -281,9 +284,9 @@ int sparse_add_one_section(struct zone *zone, unsigned long start_pfn, | |||
281 | 284 | ||
282 | ret = sparse_init_one_section(ms, section_nr, memmap); | 285 | ret = sparse_init_one_section(ms, section_nr, memmap); |
283 | 286 | ||
284 | if (ret <= 0) | ||
285 | __kfree_section_memmap(memmap, nr_pages); | ||
286 | out: | 287 | out: |
287 | pgdat_resize_unlock(pgdat, &flags); | 288 | pgdat_resize_unlock(pgdat, &flags); |
289 | if (ret <= 0) | ||
290 | __kfree_section_memmap(memmap, nr_pages); | ||
288 | return ret; | 291 | return ret; |
289 | } | 292 | } |