Changeset 7852625 in mainline


Ignore:
Timestamp:
2012-01-05T17:49:20Z (12 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0a549cc
Parents:
9f0fb84
Message:

zone_external_conf_alloc() must be allowed to fail gracefully (by passing FRAME_ATOMIC to frame_alloc()), otherwise the frame_alloc_generic() might panic on the "Cannot wait for memory to become available" assertion in specific memory configurations

Location:
kernel
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm32/src/mm/frame.c

    r9f0fb84 r7852625  
    6060        } else {
    6161                pfn_t conf = zone_external_conf_alloc(SIZE2FRAMES(size));
    62 
    63                 zone_create(ADDR2PFN(base), SIZE2FRAMES(size), conf,
    64                     ZONE_AVAILABLE | ZONE_HIGHMEM);
     62                if (conf != 0)
     63                        zone_create(ADDR2PFN(base), SIZE2FRAMES(size), conf,
     64                            ZONE_AVAILABLE | ZONE_HIGHMEM);
    6565        }
    6666       
  • kernel/arch/ia32/src/mm/frame.c

    r9f0fb84 r7852625  
    7979                        } else {
    8080                                conf = zone_external_conf_alloc(count);
    81                                 zone_create(pfn, count, conf,
    82                                     ZONE_AVAILABLE | ZONE_HIGHMEM);
     81                                if (conf != 0)
     82                                        zone_create(pfn, count, conf,
     83                                            ZONE_AVAILABLE | ZONE_HIGHMEM);
    8384                        }
    8485                } else if ((e820table[i].type == MEMMAP_MEMORY_ACPI) ||
  • kernel/arch/ia64/src/mm/frame.c

    r9f0fb84 r7852625  
    7979                                    ZONE_AVAILABLE | ZONE_LOWMEM);
    8080                        } else {
    81                                 pfn_t conf;
    82 
    83                                 conf = zone_external_conf_alloc(count);
    84                                 zone_create(pfn, count, conf,
    85                                     ZONE_AVAILABLE | ZONE_HIGHMEM);
     81                                pfn_t conf = zone_external_conf_alloc(count);
     82                                if (conf != 0)
     83                                        zone_create(pfn, count, conf,
     84                                            ZONE_AVAILABLE | ZONE_HIGHMEM);
    8685                        }
    8786                }
  • kernel/arch/mips32/src/mm/frame.c

    r9f0fb84 r7852625  
    156156        } else {
    157157                conf_frame = zone_external_conf_alloc(count);
    158                 zone_create(first, count, conf_frame,
    159                     ZONE_AVAILABLE | ZONE_HIGHMEM);
    160         }
    161                
    162                
     158                if (conf_frame != 0)
     159                        zone_create(first, count, conf_frame,
     160                            ZONE_AVAILABLE | ZONE_HIGHMEM);
     161        }
     162       
    163163        if (phys_regions_count < MAX_REGIONS) {
    164164                phys_regions[phys_regions_count].start = first;
  • kernel/arch/mips64/src/mm/frame.c

    r9f0fb84 r7852625  
    148148        } else {
    149149                conf_frame = zone_external_conf_alloc(count);
    150                 zone_create(first, count, conf_frame,
    151                     ZONE_AVAILABLE | ZONE_HIGHMEM);
    152         }
    153                
    154                
     150                if (conf_frame != 0)
     151                        zone_create(first, count, conf_frame,
     152                            ZONE_AVAILABLE | ZONE_HIGHMEM);
     153        }
     154       
    155155        if (phys_regions_count < MAX_REGIONS) {
    156156                phys_regions[phys_regions_count].start = first;
  • kernel/arch/ppc32/src/mm/frame.c

    r9f0fb84 r7852625  
    8181                } else {
    8282                        conf = zone_external_conf_alloc(count);
    83                         zone_create(pfn, count, conf,
    84                             ZONE_AVAILABLE | ZONE_HIGHMEM);
     83                        if (conf != 0)
     84                                zone_create(pfn, count, conf,
     85                                    ZONE_AVAILABLE | ZONE_HIGHMEM);
    8586                }
    8687        }
  • kernel/arch/sparc64/src/mm/sun4u/frame.c

    r9f0fb84 r7852625  
    7979                } else {
    8080                        confdata = zone_external_conf_alloc(count);
    81                         zone_create(pfn, count, confdata,
    82                             ZONE_AVAILABLE | ZONE_HIGHMEM);
     81                        if (confdata != 0)
     82                                zone_create(pfn, count, confdata,
     83                                    ZONE_AVAILABLE | ZONE_HIGHMEM);
    8384                }
    8485        }
    85                
    8686}
    8787
  • kernel/arch/sparc64/src/mm/sun4v/frame.c

    r9f0fb84 r7852625  
    7979                } else {
    8080                        confdata = zone_external_conf_alloc(count);
    81                         zone_create(pfn, count, confdata,
    82                             ZONE_AVAILABLE | ZONE_HIGHMEM);
     81                        if (confdata != 0)
     82                                zone_create(pfn, count, confdata,
     83                                    ZONE_AVAILABLE | ZONE_HIGHMEM);
    8384                }
    8485        }
    85                
    8686}
    8787
  • kernel/generic/src/mm/frame.c

    r9f0fb84 r7852625  
    870870        size_t order = ispwr2(size) ? fnzb(size) : (fnzb(size) + 1);
    871871
    872         return ADDR2PFN((uintptr_t) frame_alloc(order - FRAME_WIDTH, FRAME_LOWMEM));
     872        return ADDR2PFN((uintptr_t) frame_alloc(order - FRAME_WIDTH,
     873            FRAME_LOWMEM | FRAME_ATOMIC));
    873874}
    874875
Note: See TracChangeset for help on using the changeset viewer.