scottl at freebsd.org
Wed May 26 14:34:49 PDT 2004
lost inferno wrote:
> I was wondering... and thought i'd comment on something i've read... is
> there something going on
> in the kva area that's bad? (AKA exaustion through malloc routine) I
> found something that made me curious, and thought I'd see what you
> thought. I'm really debating now about what i should move my production
> machines to. They claim to have a patch...
> Interested to see what everyone thinks.
Aside from the interesting words in the blog entry, I have a few
problems with his patch. First of all, I can't see how it is
supposed to fix anything. At line 191 we check to see if
kbp->kb_next == NULL and enter a big code block to handle that.
At the end of the code block (right before line 245 in his patch),
we assign va = kbp->kb_next. So here we know that it is non-null.
Why you need to check for it to be NULL is beyond me. But, suppose
that it could be NULL. His solution is to return NULL in the
M_NOWAIT case and spin in the M_WAITOK case. I assume that the
point of spinning is that memory might become free at some later
time via it being freed in an interrupt handler or a swapout
completing. However, it does nothing to assure that enough interrpts
are enable to make sure that this can happen, so the result could
easily be that it spins forever. In fact. splmem() is held at that
point, which is the same as splhigh(), i.e. all interrupts are blocked.
So if this case is reached on a UP system, the only result will be
that your get a hard system freeze, not even a panic.
Regardless, I'd like to find out from David if he knows of a testable
case for this. I'd be happy to entertain further discussion of that.
More information about the freebsd-stable