From owner-freebsd-arch@FreeBSD.ORG Sun Sep 30 18:32:30 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 037C116A419 for ; Sun, 30 Sep 2007 18:32:30 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.184]) by mx1.freebsd.org (Postfix) with ESMTP id 88E5813C468 for ; Sun, 30 Sep 2007 18:32:29 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so2474499nfb for ; Sun, 30 Sep 2007 11:32:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=kWDYWYdzApQmLWYOZBozeve+RvdVbn8fsJrGMw7z6KY=; b=DPEUZAN6RjgcvnbjWAkst0j95OOfw5OBhnZ0AAgoRkyboWZVfTN3LXOQhCigsjoplOZM/3ekfy2Ta/XSzlepEuW1k8A4b/bIWUM9aGvL+2bFkuUQ0su7b2EDkLn/hqk9fDNwwGZ8InqVgtX4Ety1/5wjTT6vzZynSTtRtvagk3I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=efK2FApuVBtNdqagKiuojx5cg7wXsLUCpw9Jr2DnzV7C+fxX57gt1mlxsfZfcCVppSE9fCAV7+kZNBY8y4waeUBE/NB5amULC7KmVTvzyoDXwvpLb+noY9WQAY0Hzyy2JseQMZsua1+ZTWCT+cp3R9WKzF98ZemqKyVNB/FH/7U= Received: by 10.78.159.7 with SMTP id h7mr2153750hue.1191177147610; Sun, 30 Sep 2007 11:32:27 -0700 (PDT) Received: by 10.78.97.18 with HTTP; Sun, 30 Sep 2007 11:32:27 -0700 (PDT) Message-ID: <3bbf2fe10709301132j441277e1web97323743d01560@mail.gmail.com> Date: Sun, 30 Sep 2007 20:32:27 +0200 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Alexander Motin" In-Reply-To: <46FFD850.1040508@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <46FFD850.1040508@FreeBSD.org> X-Google-Sender-Auth: da1a032cc9ac9d3f Cc: 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: Sun, 30 Sep 2007 18:32:30 -0000 2007/9/30, Alexander Motin : > Hi. > > As known in netgraph susbystem information passing from one node to > another by direct function calls without queueing. It gives performance > bonuses, but it also gives permanent stack overflow risk on complicated > graphs. Netgraph is still have a queues and able to use them when asked, > but now queueing is a flag which should be controlled by sending node. I > think it would be good to implement some algorithm which could monitor > stack usage on each call and enforce queueing when stack usage become > critical. > > The question is: is there correct way to somehow get current kernel > thread stack usage or just a stack base address? This should be stored in the pcb area of threads (for example, ia32 maintains a pcb_esp0 which points to the stack address at ring0 for the thread which points to). Attilio -- Peace can only be achieved by understanding - A. Einstein