Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Apr 2001 15:43:20 -0400 (EDT)
From:      Daniel Eischen <eischen@vigrid.com>
To:        "Daniel C. Sobral" <dcs@newsguy.com>
Cc:        Julian Elischer <julian@elischer.org>, Arch@FreeBSD.ORG, alfred@FreeBSD.ORG, Robert Watson <rwatson@FreeBSD.ORG>
Subject:   Re: KSE threading support (first parts)
Message-ID:  <Pine.SUN.3.91.1010427151727.12501A-100000@pcnet1.pcnet.com>
In-Reply-To: <3AE9B93C.E8060911@newsguy.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 27 Apr 2001, Daniel C. Sobral wrote:
> Daniel Eischen wrote:
> > 
> > Right, like I've said before, it's easier just to combine the KSEG and KSE
> > into one entity and forget about fair scheduling.  Limit the number of
> > "combined KSE/KSEGs" to the number of processors (scope system threads
> > still get their own "combined KSE/KSEG" to satisfy POSIX).  The common
> > case is a single processor system anyways, and in that case it doesn't
> > make sense to have more than 1 KSE in a KSEG.
> 
> First and foremost, you must preserve the current behavior (because
> that's what I want, that's what we have atm, and it's there in POSIX),
> where a process quanta is a process quanta and that's that, no matter
> how many threads the process has.

You get that if you don't use pthread_setconcurrency() and don't
create any system scope threads.  This means you get 1 KSE in
1 KSEG.

> If you happen to want the "system" scope, which is also in POSIX, then
> each thread has a quanta of it's own.
> 
> Process scope: one KSEG, N KSE.

Not quite.  1 KSEG, 1 KSE by default.  You have to set the concurrency
level to get more than 1 KSE.

When you use pthread_setconcurrency() under Solaris, you get a LWP
for each concurrency level that Solaris grants to you.  Each LWP
under Solaris gets its own quantum.  With the proposed implementation
for FreeBSD, pthread_setconcurrency would give you multiple KSEs
(limited to CPUs) within the same KSEG, but these KSEs wouldn't
give you additional quantum.

I'd rather see us emulate Solaris if possible, but whatever.

> System scope: N KSEG, 1 KSE per KSEG.

Right.  And for Process _and_ System scope: S+1 KSEG, S+1 KSE, where
S=number of system scope threads.

> > In a multiprocessor system, if you have an extra quantum, who really
> > cares?  If someone really does care, then it can be a kernel tunable
> > or resource limit.
> > 
> > I just don't see any benefit for the added complexity.  It certainly
> > is easier for the UTS with a combined KSE/KSEG.
> 
> Yes, but I want to see you do process scope and system scope without it.

Read what I've written again.  You don't need more than 1 KSE within
the _same_ KSEG to do this.  You can have as many process scope
threads as you want with one KSE in the main process' KSEG.  If you
want to additionally create system scope threads, then no problem;
each system scope thread gets its own KSEG/KSE pair. 

-- 
Dan Eischen

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.SUN.3.91.1010427151727.12501A-100000>