lkml.org 
[lkml]   [2009]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH 2/2] SLUB: Use GFP_PANIC for early-boot allocations
    From
    Date
    From: Pekka Enberg <penberg@cs.helsinki.fi>

    This patch converts SLUB early-boot code to use GFP_PANIC instead of explicit
    BUG_ON() calls.

    Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
    ---
    mm/slub.c | 8 +++-----
    1 files changed, 3 insertions(+), 5 deletions(-)

    diff --git a/mm/slub.c b/mm/slub.c
    index 7ab54ec..55216b4 100644
    --- a/mm/slub.c
    +++ b/mm/slub.c
    @@ -2109,9 +2109,8 @@ static void early_kmem_cache_node_alloc(gfp_t gfpflags, int node)

    BUG_ON(kmalloc_caches->size < sizeof(struct kmem_cache_node));

    - page = new_slab(kmalloc_caches, gfpflags, node);
    + page = new_slab(kmalloc_caches, gfpflags | GFP_PANIC, node);

    - BUG_ON(!page);
    if (page_to_nid(page) != node) {
    printk(KERN_ERR "SLUB: Unable to allocate memory from "
    "node %d\n", node);
    @@ -4367,10 +4366,9 @@ static struct kset *slab_kset;
    */
    static char *create_unique_id(struct kmem_cache *s)
    {
    - char *name = kmalloc(ID_STR_LENGTH, GFP_KERNEL);
    - char *p = name;
    + char *name, *p;

    - BUG_ON(!name);
    + p = name = kmalloc(ID_STR_LENGTH, GFP_KERNEL | GFP_PANIC);

    *p++ = ':';
    /*
    --
    1.5.6.3




    \
     
     \ /
      Last update: 2009-05-08 17:15    [W:0.020 / U:62.152 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site