readahead: readahead page allocations are OK to fail

Pass __GFP_NORETRY|__GFP_NOWARN for readahead page allocations.

readahead page allocations are completely optional.  They are OK to fail
and in particular shall not trigger OOM on themselves.

Reported-by: Dave Young <[email protected]>
Reviewed-by: KOSAKI Motohiro <[email protected]>
Signed-off-by: Wu Fengguang <[email protected]>
Reviewed-by: Minchan Kim <[email protected]>
Reviewed-by: Pekka Enberg <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Wu Fengguang 2011-05-24 17:12:25 -07:00 • committed by Linus Torvalds
commit 7b1de5868b
2 changed files with 7 additions and 1 deletions

View file

@ -180,7 +180,7 @@ __do_page_cache_readahead(struct address_space *mapping, struct file *filp,
if (page)
continue;
page = page_cache_alloc_cold(mapping);
page = page_cache_alloc_readahead(mapping);
if (!page)
break;
page->index = page_offset;