Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Dec 2001 14:26:24 -0800 (PST)
From:      Julian Elischer <julian@elischer.org>
To:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc:        John Baldwin <jhb@FreeBSD.org>, arch@FreeBSD.org, Alfred Perlstein <bright@mu.org>
Subject:   Re: Kernel stack size and stacking: do we have a problem ? 
Message-ID:  <Pine.BSF.4.21.0112201412310.46573-100000@InterJet.elischer.org>
In-Reply-To: <3954.1008885976@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help


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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0112201412310.46573-100000>