Re: mmap() versus read()

Perry Harrington (pedward@sun4.apsoft.com)
Tue, 10 Mar 1998 16:32:48 -0800 (PST)


>
>
> MOLNAR Ingo <mingo@chiara.csoma.elte.hu> writes:
> > On Mon, 9 Mar 1998, Perry Harrington wrote:
> >
> > > > > I think everyone will
> > > > > agree that the current clone() method of creating threads is costly
> > > > > at best. [...]
> > > >
> > > > uhm, ~20 usecs on a 200 MHz PPro, is that 'costly at best'?
> > >
> > > I still count in clock ticks. 35000 something IIRC last time I knew
> > > for a fork()/clone(). [...]
> >
> > oops, it's more than 20 usecs, i accidentally have measured it on an SMP
> > system. On uniprocessors it's ~40 usecs on a 200 MHz PPro (should be
> > ~11000 cycles on your box i think).
>
> Hang on.
>
> Running Ingo's program on my 233MHz (overclocked) PPro (UP), with an
> egcs-1.01 built 2.1.89 kernel, I get around 2050. That's 8 usecs; at
> 200MHz it would probably be 9 or 10 usecs.
>
> I have my own program which makes a similar test, and it gets a
> similar result. It also mesures various aspects of LinuxThreads,
> including pthread_create() for which I get just under 35000
> cycles. Could Perry inadvertently be quoting a pthread_create() time?

Yes, that seems right. Question to the gurus:

Is it possible to make a process run as a "sandbox" to child TSSes? Meaning,
could you create a process in which it ran in a ring that was identical to
the children TSSes? This way you could appropriate the "expensive" stuff to
a process (IO mask maintenance and other system stuff) and make lightweight
subprocesses.

Also, did anyone catch that remark about the non-inherited IO perms for clone()d
threads? Also, are there any plans in the near future to implement MMX extensions
in the Linux kernel for bulk copies and such?

I'm far from being an Intel Biggot, unfortunately the
price/performance/compatibility/availability is better than the
AMD alternative. FWIW, I ran an AMD processor for > 4 years, I reluctantly chose
an MMX, it was the performance results + bigger cache that convinced me. I
tried to find a simple breakdown on what MMX *really* offers, but intel's PDF are
so stodgey, it's hard. I wanted something between their marketing hype and an
opcode list...what exactly *does* each of the '57 new instructions' do? I heard
that a new 64bit bulk copy was available (memcpy on speed???).

>
> Dave Wragg
>

--Perry

-- 
Perry Harrington       Linux rules all OSes.    APSoft      ()
email: perry@apsoft.com 			Think Blue. /\

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu