cvs commit: src/sys/sys proc.h umtx.h src/sys/kernkern_thread.c kern_umtx.c

David Xu davidxu at
Sat Mar 5 23:55:10 GMT 2005

Mike Silbersack wrote:

> On Sat, 5 Mar 2005, David Xu wrote:
>> davidxu     2005-03-05 09:15:03 UTC
>>  FreeBSD src repository
>>  Modified files:
>>    sys/sys              proc.h umtx.h
>>    sys/kern             kern_thread.c kern_umtx.c
>>  Log:
>>  Allocate umtx_q from heap instead of stack, this avoids
>>  page fault panic in kernel under heavy swapping.
> Heavy swapping, or just unlucky swapping like we were talking about in 
> relation to kern_sig.c?
If I understand it correctly, kernel stack is swapped out only when 
there is memory
pressure, for example, following code:

char  *p = malloc(1024 * 1024 * 512); // assume you have memory less 
than 512M
for (;;)
    memset(p, 0, 1024 * 1024 * 512);

and if there is thousands of thread in the kernel and all are sleeping
(rarely extreme case), swapping out all their kernel stack can save several
megabytes. because so many people have the objection to disable it, and
would like to accept a serious risk, I just adjusted the code to work 
around it,
that does not mean I agree their points.

> Mike "Silby" Silbersack

More information about the cvs-src mailing list