> But, why wouldn't this work there? Define a percpu variable, and assign > it to the target page in readahead's read_pages() and in > do_generic_file_read() which deal with pages one at a time and not in lists. > > struct page *read_me_once; > void hint_page_read_once(struct page *page) > { > read_me_once = page; > } > > Then check for (read_me_once == page) in add_page_to_lru_list() instead > of the page flag. Then, make read_me_once per-cpu. This won't be > preempt safe, but we're talking about readahead and hints here, so we > can probably just bail in the cases where we race. Thanks for clarifying that. The problem now is that by the time we get to add_page_to_lru_list we're dealing with multiple pages again, because of the buffering in pagevecs. We could do the (read_me_once == page) check in __lru_cache_add and then add it to a (new) lru_add_tail_pvec that adds its pages to the tail of the lru_lists. If this way isn't feasible, we'll take a look at Andrew and Michal's DONTNEED lite idea. However, with a DONTNEED lite implemented in the posix_fadvise, the syscall would be more cumbersome to use for application programmers. They would need to call it after every read. The tail-pvec approach only needs a single syscall after open, as do NORMAL, SEQUENTIAL and RANDOM. Furthermore we suspect that implementing it in a way that respects other processes (unlike DONTNEED) won't be much simpler than the tail-pvec approach. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>