Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Jul 2002 07:19:12 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        John Baldwin <jhb@FreeBSD.ORG>
Cc:        FreeBSD current users <current@FreeBSD.ORG>, FreeBSD current users <current@FreeBSD.ORG>, Julian Elischer <julian@elischer.org>
Subject:   RE: userret() , ast() and the end of syscalls
Message-ID:  <20020710071340.R8522-100000@gamplex.bde.org>
In-Reply-To: <XFMail.20020709084025.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 9 Jul 2002, John Baldwin wrote:

> On 09-Jul-2002 John Baldwin wrote:
> >
> > On 09-Jul-2002 Julian Elischer wrote:
> >>
> >> A question to those who know..
> >>
> >> why is userret() called both at the end of trap() or syscall()
> >> and also almost immediatly again (often) at the end of ast().
> >
> > ast() is really a special form of a trap that is triggered by doing
> > a last-minute type check on return to userland to see if we still
> > have work to do.
> >
> >> It seems that really there is no one place that one can put code that will
> >> be called ONCE and ONLY ONCE as a thread progresses to userland.
> >
> > Sure there is.  When you want an action done, set a thread flag marking
> > the request and set TDF_ASTPENDING.  Then handle it in ast() if the flag
> > is set.
>
> Or, if this needs to happen on every return and not conditionally,
> then do it in userret() and use the state of a variable or some flag
> to note when you've already done it.

Hopefully there won't be any unconditional code.  Unconditional code
in userret() pessimizes all syscalls.  Unconditional code added by KSEIII
pessimized basic syscall overhead by 10% according to lmbench2.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




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