KVA space problems?
Mark Tinguely
tinguely at casselton.net
Wed May 26 13:48:34 PDT 2004
This has been seen before and there is at least one open problem report
that the kernel malloc() unexpectantly returns NULL in WAITOK situations.
http://www.freebsd.org/cgi/query-pr.cgi?pr=i386/53382
---
I think malloc returns before your patch, namely around line 199:
va = (caddr_t) kmem_malloc(kmem_map, (vm_size_t)ctob(npg), flags
);
if (va == NULL) {
splx(s);
return ((void *) NULL);
}
Although, I agree that the kernel malloc() should not do this, if KVM
is depleted or fragmented to this point, I suspect your changes of simply
retrying again will cause an infinite loop in malloc().
If malloc() sleeps waiting for KVM to be freed, my guess this will lead to
the processes to hang for a long time if not forever.
I think this because people are bumping the MBUFs numbers up and not
changing the KVM size, once the KVM is depleted/fragmented it shouldn't
come down for a long time.
---
The pre 5.x VM assumes KVM will not be depleted. contigmalloc() used to leak
physical pages if the KVM got depleted. I was told "the system will panic
soon anyway, why put them back".
--Mark Tinguely
More information about the freebsd-hackers
mailing list