[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

kmem_alloc() issues



file: fs/xfs_support/kmem.c

When kmem_alloc() fails to get a kmalloc() within
DEF_PRIORITY retries it will alloc the memory from
__vmalloc() which will cause an Oops when the memory
is kmem_free()'d if the size is <= MAX_SLAB_SIZE.

Further, just before the panic, the line should read,

if (!rval && (flags & KM_SLEEP))
   panic()

but would that be more proper as,

if (!rval && (flags & (KM_SLEEP | KM_SLEEP_IO))
   panic()

Note that lowering MAX_SLAB_SIZE to 64K from 128K
helps alleviate this problem, as well as putting in a
retry instead of the panic().  On linux 2.4.16 I'm
seeing this on a system with 512MB of RAM on an SMP
system with 1.7TB of attached storage (LSI raid 5 via
software raid 0).  This helps to alleviate the
pressure on the bigger slabs (size-64 and size-128). 
I tried lowering it to 32K but this bombed on boot
when the aic7xxx was initialised.

I've also inserted a
wake_up_interruptible(&kswapd_wait) here before
resetting shrink to 24 (instead of 6) and repeating. 
I've seen the system retry up to about 48 times, which
is bad, but not as bad as a panic.

This appears to be a problem with the page cache not
releasing pages for use by the slab cache (kmalloc),
since I still have about 450MB of inactive page cache
available when this happens.

This could also happen under VERY severe conditions in
kmem_zone_alloc() and kmem_zone_zalloc() but it is
very unlikely I suspect.

Cheers!

Mr F.



=====
Mr. Fiddlehead
mrfiddlehead@yahoo.co.uk
Fuck Off

__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/