LWN.net Logo

Pathological cases

Pathological cases

Posted Feb 5, 2010 11:03 UTC (Fri) by farnz (guest, #17727)
In reply to: Pathological cases by alex
Parent article: Improving readahead

That sort of situation is what posix_fadvise is meant for. If you know in advance that readahead will be wasted, posix_fadvise(fd, 0, 0, POSIX_FADV_RANDOM); tells the kernel not to bother.

In general, if you know that you have an abnormal access pattern ahead of time, the right call to posix_fadvise won't hurt you, and can help.


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds