Date: Thu, 03 Mar 2005 13:07:17 +0800 From: David Xu <davidxu@freebsd.org> To: Doug White <dwhite@gumbysoft.com> Cc: freebsd-current@freebsd.org Subject: Re: FreeBSD 5.3 crash (core with debug symbols available) Message-ID: <42269B85.3050602@freebsd.org> In-Reply-To: <20050302184617.K82821@carver.gumbysoft.com> References: <549575862.20050226230200@takeda.tk> <20050228210235.C62607@carver.gumbysoft.com> <20050301104030.W68845@carver.gumbysoft.com> <1119242149.20050301105816@takeda.tk> <20050301184735.O72408@carver.gumbysoft.com> <42259DCA.6060308@freebsd.org> <20050302184617.K82821@carver.gumbysoft.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Doug White wrote: >On Wed, 2 Mar 2005, David Xu wrote: > > > >>I believe this is caused by swapped out of kernel thread stack. >>in /sys/vm/vm_glue.c, there is some code swapping out a sleeping process, >>this means any kernel code can not use thread local variable to communicate >>with other threads, this is a rather unsafe assumptions, the vm code really >>should be disabled. >> >> > >I don't quite understand what you mean by "vm code really should be >disabled"; is virtual memory really that bad? :) > >The consensus on IRC is that threads should not use their stacks for >anything but storage of their own variables. Anything used for >synchronization or state should be placed in malloc()d memory or some >other shared structure. > > > Stack variable is cheap and fastest, why should I use slow malloc ? >I'll start working on a patch to change these references in the sigwait() >family. And queue up a pointy hat to jeff@. Pointers to other badly >behaved code gladly accepted :) > > This is not a bug, I always perfer to use stack variable because there is no lock order reversal and have to work around it. If I am correct, Linux and DragonFly both disable kernel stack to be swapped out. David Xu
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42269B85.3050602>