lower throughput when memory is mmap()ed

lower throughput when memory is mmap()ed

Post by Don Newbol » Fri, 24 May 2002 07:22:03



I thought I'd get higher I/O throughput if I gave the application mmap()
access to the
I/O buffers. Throughput was down by 50% on a 166MHz Pentium and by 30% on
a 1.2GHz Duron. I don't do copy_to/from_user() now but throughput is now
lower.
What is going on?

Don

 
 
 

lower throughput when memory is mmap()ed

Post by Karl Heye » Fri, 24 May 2002 07:44:48



> I thought I'd get higher I/O throughput if I gave the application mmap()
> access to the
> I/O buffers. Throughput was down by 50% on a 166MHz Pentium and by 30% on
> a 1.2GHz Duron. I don't do copy_to/from_user() now but throughput is now
> lower.
> What is going on?

IIRC mmap doesn't do read-ahead like normal reads. bear in mind that
using mmap alters the pagetables so it depends on the access pattern.

karl.

 
 
 

lower throughput when memory is mmap()ed

Post by M?ns Rullg? » Fri, 24 May 2002 09:34:12




> > I thought I'd get higher I/O throughput if I gave the application mmap()
> > access to the
> > I/O buffers. Throughput was down by 50% on a 166MHz Pentium and by 30% on
> > a 1.2GHz Duron. I don't do copy_to/from_user() now but throughput is now
> > lower.
> > What is going on?

> IIRC mmap doesn't do read-ahead like normal reads. bear in mind that
> using mmap alters the pagetables so it depends on the access pattern.

Perhaps some kind of prefetching would help. Read a word from next page?

--
M?ns Rullg?rd

 
 
 

lower throughput when memory is mmap()ed

Post by Kasper Dupon » Fri, 24 May 2002 19:50:01





> > > I thought I'd get higher I/O throughput if I gave the application mmap()
> > > access to the
> > > I/O buffers. Throughput was down by 50% on a 166MHz Pentium and by 30% on
> > > a 1.2GHz Duron. I don't do copy_to/from_user() now but throughput is now
> > > lower.
> > > What is going on?

> > IIRC mmap doesn't do read-ahead like normal reads. bear in mind that
> > using mmap alters the pagetables so it depends on the access pattern.

> Perhaps some kind of prefetching would help. Read a word from next page?

Perhaps madvise would be a better choice. (It should be if
madvise is reasonably implemented.)

--
Kasper Dupont -- der bruger for meget tid p? usenet.