Messages in this thread | | | Subject | Re: mmap() is slower than read() on SCSI/IDE on 2.0 and 2.1 | Date | Tue, 15 Dec 1998 15:37:31 +0100 (MET) | From | (Rogier Wolff) |
| |
Jay Nordwick wrote: > >I'd say that most apps use a fixed "buffer size". "cat" or "dd" use > >0.5 to 8k buffers. That's constant buffer. > > > > With read() you can know that requests are coming in PAGE_SIZE*n, n>1, > so you can prefetch more than a singe page. With mmap() that > information is lost, you only see read os PAGE_SIZE.
What I'm trying to say is: With "dd" the default "n" is 0.5, with "cat" the default "n" is 2. That doesnt' make a large difference.
Many "engineers" writing "fortran" (*) code will be using stdio, reading a few floating point values at a time. stdio will optimize that into 8k chunks. So we're still seeing small to very small read-size.
I still think that "readahead" is working because if you read block 1, block2 will get prefetched. If you indeed access that block, 2 blocks will get prefetched. If you indeed access those blocks, next time 4 blocks get prefetched. This is a very good heuristic, and I don't see why it won't work for the mmapped case.
Roger.
(*) Code that would've been written in fortran if it were written 10 years ago.
-- ** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 ** *-- BitWizard writes Linux device drivers for any device you may have! --* * Never blow in a cat's ear because if you do, usually after three or * * four times, they will bite your lips! And they don't let go for at * * least a minute. -- Lisa Coburn, age 9
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |