]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 2 Mar 2012 02:22:55 +0000 (18:22 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 2 Mar 2012 02:22:55 +0000 (18:22 -0800)
Pull s390 fixes from Martin Schwidefsky

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  [S390] memory hotplug: prevent memory zone interleave
  [S390] crash_dump: remove duplicate include
  [S390] KEYS: Enable the compat keyctl wrapper on s390x

arch/s390/Kconfig
arch/s390/kernel/crash_dump.c
arch/s390/mm/init.c

index d1727584230a66b504ae1e9e0beed8f3522c5b23..6d99a5fcc09030114dd8d475e6fe54184fc59814 100644 (file)
@@ -227,6 +227,9 @@ config COMPAT
 config SYSVIPC_COMPAT
        def_bool y if COMPAT && SYSVIPC
 
+config KEYS_COMPAT
+       def_bool y if COMPAT && KEYS
+
 config AUDIT_ARCH
        def_bool y
 
index 39f8fd4438fc8a3810333a6e659e60dce4ea04aa..c383ce440d99952149895b0094d6794a22af2d5c 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/module.h>
 #include <linux/gfp.h>
 #include <linux/slab.h>
-#include <linux/crash_dump.h>
 #include <linux/bootmem.h>
 #include <linux/elf.h>
 #include <asm/ipl.h>
index 5d633019d8f3f86fb4da43a1c04ad060a6f2e83f..50236610de83cc0cb8d76ca34bbd2cd0f5c0e0aa 100644 (file)
@@ -223,16 +223,38 @@ void free_initrd_mem(unsigned long start, unsigned long end)
 #ifdef CONFIG_MEMORY_HOTPLUG
 int arch_add_memory(int nid, u64 start, u64 size)
 {
-       struct pglist_data *pgdat;
+       unsigned long zone_start_pfn, zone_end_pfn, nr_pages;
+       unsigned long start_pfn = PFN_DOWN(start);
+       unsigned long size_pages = PFN_DOWN(size);
        struct zone *zone;
        int rc;
 
-       pgdat = NODE_DATA(nid);
-       zone = pgdat->node_zones + ZONE_MOVABLE;
        rc = vmem_add_mapping(start, size);
        if (rc)
                return rc;
-       rc = __add_pages(nid, zone, PFN_DOWN(start), PFN_DOWN(size));
+       for_each_zone(zone) {
+               if (zone_idx(zone) != ZONE_MOVABLE) {
+                       /* Add range within existing zone limits */
+                       zone_start_pfn = zone->zone_start_pfn;
+                       zone_end_pfn = zone->zone_start_pfn +
+                                      zone->spanned_pages;
+               } else {
+                       /* Add remaining range to ZONE_MOVABLE */
+                       zone_start_pfn = start_pfn;
+                       zone_end_pfn = start_pfn + size_pages;
+               }
+               if (start_pfn < zone_start_pfn || start_pfn >= zone_end_pfn)
+                       continue;
+               nr_pages = (start_pfn + size_pages > zone_end_pfn) ?
+                          zone_end_pfn - start_pfn : size_pages;
+               rc = __add_pages(nid, zone, start_pfn, nr_pages);
+               if (rc)
+                       break;
+               start_pfn += nr_pages;
+               size_pages -= nr_pages;
+               if (!size_pages)
+                       break;
+       }
        if (rc)
                vmem_remove_mapping(start, size);
        return rc;