On Mon, Dec 08, 2003 at 01:17:26PM +0100, marat wrote:
> Recently, I had one of the xfs filesystem failed and the only message was :
> kernel panic:kmem_zone_zalloc: NULL memory on KM_SLEEP request!
> I had to reboot machine and run xfs_repair to make files system available
> I am using kernel 2.4.20 SMP and xfs version 1.3.0.
> Any ideas, suggestions how I can avoid this problem to happen again ?
Well, whats happened here is XFS is allocating memory from
a context where it cannot fail, and retries the allocation
a number of times (6 IIRC, with delays in-between each) and
after freeing up everything that XFS can itself. Afterward
if we still cannot get any memory allocated we give up and
I guess we could keep retrying indefinitely, but that doesn't
seem like a particularly good solution. I suspect we should
be getting a bit more help from the VM here (more recent 2.4
kernels might make this case better) ... you may be able to
tweak some variables in mm/vmscan.c too - these are likely
sysctls somewhere - vm_mapped_ratio, vm_vfs_scan_ratio, etc
(ah, have a look through "vm_table" in kernel/sysctl.c).