Re: Possible dcache BUG

From: Andreas Dilger
Date: Thu Aug 12 2004 - 21:29:22 EST


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/

Attachment: pgp00000.pgp
Description: PGP signature