From owner-freebsd-arch Thu Dec 20 14:40:15 2001 Delivered-To: freebsd-arch@freebsd.org Received: from rwcrmhc51.attbi.com (rwcrmhc51.attbi.com [204.127.198.38]) by hub.freebsd.org (Postfix) with ESMTP id 1E0D737B428; Thu, 20 Dec 2001 14:40:12 -0800 (PST) Received: from InterJet.elischer.org ([12.232.206.8]) by rwcrmhc51.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20011220224011.LNTT19716.rwcrmhc51.attbi.com@InterJet.elischer.org>; Thu, 20 Dec 2001 22:40:11 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id OAA53345; Thu, 20 Dec 2001 14:26:26 -0800 (PST) Date: Thu, 20 Dec 2001 14:26:24 -0800 (PST) From: Julian Elischer To: Poul-Henning Kamp Cc: John Baldwin , arch@FreeBSD.org, Alfred Perlstein Subject: Re: Kernel stack size and stacking: do we have a problem ? In-Reply-To: <3954.1008885976@critter.freebsd.dk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, 20 Dec 2001, Poul-Henning Kamp wrote: > > A) We should probably implement > int enough_stack() a full unoptimised but correct version would be: int enough_stack(u_int needed) { caddr_t addr, addr2; if needed > KSTACK_PAGES * PAGESIZE return 0; /* catch stupid values */ addr1 = &needed; addr2 = (caddr_t)curthread->td_kstack + needed; return (addr1 > addr2) } > and apply it in some strategic places so we can fail gracely > rather than panic when we run out of kernel stack. > > B) We have no idea how to sanely fix VOP_ since it is synchronous. > When I say "sanely" I'm referring to the fact that the VOP > code is scary enough as it is and we don't want to make it even > hairier, lest we loose the few filesystem hackers we have, not > to mention the fact that we would probably never complete the > conversion in the first place (see sys/vnode.h::IS_LOCKING_VFS() > for precedent.) > > C) Variant size kernel stacks are probably not worth the bother, > but sysctl variable kernel stacks might be a good investment. > > C) Netgraph and Geom will use scheduling, possibly with a direct > call optimization to avoid the issue. > Julian hybrid scheme could possibly be adapted to Geom, if it > can be made to maintain ordering (think: softupdates). it does.. > > Thanks for your input gentlemen. The netgraph locking/queueing is an integrated set of code that does both functions. The queing is part and parcel of the locking. it wouldn't work if it were not an async system. > > -- > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > phk@FreeBSD.ORG | TCP/IP since RFC 956 > FreeBSD committer | BSD since 4.3-tahoe > Never attribute to malice what can adequately be explained by incompetence. > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message