| From | Sent On | Attachments |
|---|---|---|
| Lev Serebryakov | Aug 30, 2011 12:10 pm | |
| Lev Serebryakov | Aug 30, 2011 12:17 pm | |
| Kirk McKusick | Aug 30, 2011 1:08 pm | |
| Lev Serebryakov | Aug 30, 2011 3:13 pm | |
| Lev Serebryakov | Aug 30, 2011 3:29 pm | |
| Lev Serebryakov | Aug 30, 2011 3:31 pm | |
| Bob Friesenhahn | Aug 30, 2011 3:39 pm | |
| Kirk McKusick | Aug 30, 2011 4:00 pm | |
| Jeremy Chadwick | Aug 30, 2011 5:42 pm | |
| Daniel Kalchev | Aug 31, 2011 12:10 am | |
| Lev Serebryakov | Aug 31, 2011 12:38 am | |
| Lev Serebryakov | Aug 31, 2011 1:02 am | |
| Lev Serebryakov | Aug 31, 2011 1:10 am | |
| Lev Serebryakov | Aug 31, 2011 1:18 am | |
| Lev Serebryakov | Aug 31, 2011 1:36 am | |
| Daniel Kalchev | Aug 31, 2011 1:48 am | |
| Lev Serebryakov | Aug 31, 2011 2:03 am | |
| Jeremy Chadwick | Aug 31, 2011 3:11 am | |
| Lev Serebryakov | Aug 31, 2011 4:36 am | |
| Daniel Kalchev | Aug 31, 2011 4:46 am | |
| Lev Serebryakov | Aug 31, 2011 5:49 am |
| Subject: | Re: Very inconsistent (read) speed on UFS2 | |
|---|---|---|
| From: | Lev Serebryakov (le...@serebryakov.spb.ru) | |
| Date: | Aug 31, 2011 12:38:07 am | |
| List: | org.freebsd.freebsd-fs | |
Hello, Bob. You wrote 31 августа 2011 г., 2:40:07:
I'll try this experiment with mmap() and touching every 4096-th byte of mapped memory instead of read(2).
Strange enough, it gives only 40-50MiB/s and results are very consistent.
It really surprise me. I didn't think, that there will be so much difference, I was sure, that it will be almost equivalent speed.
FreeBSD does not seem to default to sequential read-ahead when memory mapping is used with sequential page access. Try using madvise() with the MADV_SEQUENTIAL option and see if it helps.
It were results with MADV_SEQUENTIAL. Code looks like this: (error checking is skipped here, but not in real code, of course):
fd = open(fileName, O_RDONLY | O_DIRECT); buf = mmap(NULL, fileSize, PROT_READ, 0, fd, 0); madvise(buf, fileSize, MADV_SEQUENTIAL); gettimeofday(&start, NULL); for (rd = 0; rd < fileSize; rd += 4096) c = buf[rd]; gettimeofday(&end, NULL); munmap(buf, fileSize); close(fd);
There are also MADV_WILLNEED, MADV_DONTNEED, and MADV_FREE. Careful use of these options can help performance quite a lot when data is large compared to memory.
It is too complex for simple linear read test :)
-- // Black Lion AKA Lev Serebryakov <le...@serebryakov.spb.ru>
_______________________________________________ free...@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-fs To unsubscribe, send any mail to "free...@freebsd.org"





