From owner-freebsd-arch@FreeBSD.ORG Mon Nov 12 04:49:59 2007 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E4EF16A468 for ; Mon, 12 Nov 2007 04:49:59 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outW.internet-mail-service.net (outW.internet-mail-service.net [216.240.47.246]) by mx1.freebsd.org (Postfix) with ESMTP id 6E7D413C494 for ; Mon, 12 Nov 2007 04:49:59 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Sun, 11 Nov 2007 20:34:42 -0800 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 6078512697A; Sun, 11 Nov 2007 20:34:42 -0800 (PST) Message-ID: <4737D7E3.3090500@elischer.org> Date: Sun, 11 Nov 2007 20:34:43 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Marcel Moolenaar References: <1191187393.00807485.1191175801@10.7.7.3> <1191189248.00807488.1191177603@10.7.7.3> <4736D8AF.7010209@FreeBSD.org> <20071111163815.GJ37471@deviant.kiev.zoral.com.ua> <47373C5E.2080800@elischer.org> <0414590D-0C2A-4EBD-9617-7AC193ABD1E8@mac.com> <4737696A.7050605@FreeBSD.org> <06618562-A789-4B5E-94BF-0ED8AB51A1FF@mac.com> In-Reply-To: <06618562-A789-4B5E-94BF-0ED8AB51A1FF@mac.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Kostik Belousov , Alexander Motin , freebsd-arch@FreeBSD.org Subject: Re: Kernel thread stack usage X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2007 04:49:59 -0000 Marcel Moolenaar wrote: > > On Nov 11, 2007, at 12:43 PM, Alexander Motin wrote: > >> Marcel Moolenaar wrote: >>> This is not theoretical at all: On ia64 there are 2 stacks. One >>> growing down and one growing up. The downward stack is used for >>> stack-based variables and the pward growing stack is used by >>> the processor for stacked registers. >> >> Hmm, interesting. And which one is pointed by td_kstack there? Or they >> are using same segment but from opposite sides? > > The latter. The td_kstack variable points to the bottom, > which is where the register stack starts. The memory stack > start from td_kstack + td_kstack_size. > >>> The code suggested will not be meaningful on ia64. >> >> Why? If variable stack growing down and it's segment is pointed by >> td_kstack then where is the problem? Or you mean that system will die >> earlier when those two stacks in same segment will reach each other? > > It's the register stack that grows faster in general and > yes, they grow towards each other so they can eventually > run into each other. > so one could write something that detects tha tyou are getting close, but it would have to be machine dependent..