Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Nov 2001 08:34:51 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Julian Elischer <julian@elischer.org>
Cc:        freebsd-arch@FreeBSD.org, Robert Watson <rwatson@FreeBSD.org>
Subject:   Re: cur{thread/proc}, or not.
Message-ID:  <XFMail.011112083451.jhb@FreeBSD.org>
In-Reply-To: <Pine.BSF.4.21.0111110957150.89663-100000@InterJet.elischer.org>

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

On 11-Nov-01 Julian Elischer wrote:
> Also, in SMPng cur{thread,proc} takes some time to get as I'm told that
> dereferencing %fs is very slow.. (Not sure how true that is).

I'm not sure it is any slower than pushing the variable onto the stack and then
reading it from the stack.  Reading the variable off teh stack is still a
memory read, as is reading curproc, so it's not really that slow.  %fs is no
slower than %ds, not anything that compares to the amount of time to go out to
cache or memory and read the thing.

> There are other reasons for needing the pointer than for a credential.
> For example in AIO, the process pointer is stored so that
> address space can be loaned to the aio threads to do the IO.

Yeah, but it isn't used.  All that is used for is to find the vmspace to dink
with the aio thread's vmspace AFAICT.
 
> I have thought about this both ways...
> both have advantages. In some architectures, getting curthread might
> be very expensive.

I don't think it is as expensive as people think it is. :)

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

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?XFMail.011112083451.jhb>