Date: Sun, 06 Mar 2005 07:55:15 +0800 From: David Xu <davidxu@freebsd.org> To: Mike Silbersack <silby@silby.com> Cc: cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/sys proc.h umtx.h src/sys/kernkern_thread.c kern_umtx.c Message-ID: <422A46E3.6070902@freebsd.org> In-Reply-To: <20050305041220.M4921@odysseus.silby.com> References: <200503050915.j259F30c058488@repoman.freebsd.org> <20050305041220.M4921@odysseus.silby.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?422A46E3.6070902>