From owner-freebsd-current@FreeBSD.ORG Thu Mar 3 05:07:37 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F36A416A4CE for ; Thu, 3 Mar 2005 05:07:36 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id D593E43D68; Thu, 3 Mar 2005 05:07:36 +0000 (GMT) (envelope-from davidxu@freebsd.org) Received: from [127.0.0.1] (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id j2357YQZ086230; Thu, 3 Mar 2005 05:07:35 GMT (envelope-from davidxu@freebsd.org) Message-ID: <42269B85.3050602@freebsd.org> Date: Thu, 03 Mar 2005 13:07:17 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.3) Gecko/20040910 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Doug White 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> In-Reply-To: <20050302184617.K82821@carver.gumbysoft.com> Content-Type: text/plain; charset=windows-1250; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-current@freebsd.org Subject: Re: FreeBSD 5.3 crash (core with debug symbols available) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Mar 2005 05:07:37 -0000 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