lkml.org 
[lkml]   [2004]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: Possible dcache BUG
    On Aug 12, 2004  18:31 -0700, Linus Torvalds wrote:
    > Can you figure out what triggers it for you? If nothing obvious comes to
    > mind, could you do something really silly like this
    >
    > --- 1.141/mm/slab.c 2004-07-11 01:52:48 -07:00
    > +++ edited/mm/slab.c 2004-08-12 18:30:00 -07:00
    > @@ -2360,6 +2360,11 @@
    > */
    > BUG_ON(csizep->cs_cachep == NULL);
    > #endif
    > + if (csizep->cs_size == 64) {
    > + static unsigned count;
    > + if (!(4095 & ++count))
    > + dump_stack();
    > + }
    > return __cache_alloc(flags & GFP_DMA ?
    > csizep->cs_dmacachep : csizep->cs_cachep, flags);
    > }

    I don't know who suggested it first, but someone on l-k had a similar
    problem and a more robust method of finding the offender was to dump_stack()
    when the slab was grown instead of for each allocation. That way you
    don't see frequent but harmless allocators that don't leak, but rather the
    process that is causing the slab to be grown repeatedly.

    So putting something like the above in cache_alloc_refill() is probably
    the right thing.

    Cheers, Andreas
    --
    Andreas Dilger
    http://sourceforge.net/projects/ext2resize/
    http://members.shaw.ca/adilger/ http://members.shaw.ca/golinux/

    [unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2005-03-22 14:05    [W:0.025 / U:60.796 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site