• Andrew Morton's avatar
    [PATCH] handle radix_tree_node allocation failures · c3ed96a7
    Andrew Morton authored
    This patch uses the radix_tree_preload() API in add_to_page_cache().
    
    A new gfp_mask argument is added to add_to_page_cache(), which is then passed
    on to radix_tree_preload().   It's pretty simple.
    
    In the case of adding pages to swapcache we're still using GFP_ATOMIC, so
    these addition attempts can still fail.  That's OK, because the error is
    handled and, unlike file pages, it will not cause user applicaton failures.
    This codepath (radix-tree node exhaustion on swapout) was well tested in the
    days when the swapper_space radix tree was fragmented all over the place due
    to unfortunate swp_entry bit layout.
    c3ed96a7
readahead.c 13.9 KB