[PATCH] nr_slab accounting fix

From: Manfred Spraul (manfred_at_colorfullife.com)
Date: 11/29/03

  • Next message: Bartlomiej Zolnierkiewicz: "Re: Promise IDE controller crashes 2.4.22"
    Date:	Sat, 29 Nov 2003 15:03:06 +0100
    To: Andrew Morton <akpm@digeo.com>
    
    
    

    Hi Andrew,

    if alloc_slabmgmt fails, then kmem_freepages() calls sub_page_state(),
    altough nr_slab was not yet increased. The attached patch fixes that by
    moving the inc_page_state into kmem_getpages().
    Could you add it to your next -mm kernel?

    --
        Manfred
    
    

    // $Header$
    // Kernel Version:
    // VERSION = 2
    // PATCHLEVEL = 6
    // SUBLEVEL = 0
    // EXTRAVERSION = -test11
    --- 2.6/mm/slab.c 2003-11-29 09:46:35.000000000 +0100
    +++ build-2.6/mm/slab.c 2003-11-29 14:50:06.000000000 +0100
    @@ -812,6 +812,7 @@
                     int i = (1 << cachep->gfporder);
                     struct page *page = virt_to_page(addr);
     
    + add_page_state(nr_slab, i);
                     while (i--) {
                             SetPageSlab(page);
                             page++;
    @@ -1608,7 +1609,6 @@
             do {
                     SET_PAGE_CACHE(page, cachep);
                     SET_PAGE_SLAB(page, slabp);
    - inc_page_state(nr_slab);
                     page++;
             } while (--i);
     
    --- 2.6/include/linux/page-flags.h 2003-10-25 20:44:06.000000000 +0200
    +++ build-2.6/include/linux/page-flags.h 2003-11-29 14:45:57.000000000 +0100
    @@ -133,6 +133,7 @@
     
     #define inc_page_state(member) mod_page_state(member, 1UL)
     #define dec_page_state(member) mod_page_state(member, 0UL - 1)
    +#define add_page_state(member,delta) mod_page_state(member, (delta))
     #define sub_page_state(member,delta) mod_page_state(member, 0UL - (delta))
     
     

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Bartlomiej Zolnierkiewicz: "Re: Promise IDE controller crashes 2.4.22"

    Relevant Pages

    • Re: 2.6.7-bk way too fast
      ... > kernel ~1 week ago, and all timer-related stuff is moving at a vastly ... > clock advances at twice normal rate, and keyboard repeat is so sensitive ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH 1/3] 2.6.8-rc4-mm1 - Fix UML build
      ... can access them all, and initialized data all before uninitialized, so ... SYMLINKS:= $,$/$f) ... semaphore.c-dir = kernel ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Real-Time Preemption, -RT-2.6.12-final-V0.7.50-24
      ... > rebooted to a kernel that doesn't have the RT-preempt patch but ... getting a very verbose running trail, almost like an strace output, ... Copyright 2005 by Maurice Eugene Heskett, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • RE: Error mounting root fs on 72:01 using Promise FastTrak TX2000 (PDC20271)
      ... Subject: Error mounting root fs on 72:01 using Promise FastTrak TX2000 ... > Now I'm sucessfully booting my system with the 2.4.23 kernel using ... I think it's when the ATARAID driver is about to fire up. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • RE: Error mounting root fs on 72:01 using Promise FastTrak TX2000 (PDC20271)
      ... > Now I'm sucessfully booting my system with the 2.4.23 kernel using ... I think it's when the ATARAID driver is about to fire up. ... > the hard drives since this is the only thing that has changed. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)