mmap() is slower than read() on SCSI/IDE on 2.0 and 2.1
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 9 lines · Marc Lehmann
Quoted 5 lines · Linus Torvalds
Umm, the easiest hint is probably to just look at the faulting address. We have it available, after all.
I suspect that such a simple heuristic would be fairly accurate, and it can be coupled with other heuristics to further increase the accuracy.
file copy, yes. But grep (and probably lots of others) don't access memory sequentially (as faster search algorithms exist)
A fast search algorithm, touches memory every n bytes where n is the size of the largest constant string that you're searching for.
That way "n" is typically small, so that you end up hitting the first n bytes pretty often.
If you're acessing
struct blabla {
int ...
float ...
char [];
}mmapped from a file, you might be looking for a certain float. As long as you're doing a linear search, you'll again hit the first few bytes of a page pretty often.
Roger.
Signature · 10 lines
** [email protected] ** 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 [email protected] Please read the FAQ at http://www.tux.org/lkml/