From: Hugh Dickins Make add_to_swap_cache static, it's only used by read_swap_cache_async; and since that has just done a GFP_HIGHUSER allocation, surely it's better for add_to_swap_cache to use GFP_KERNEL than GFP_ATOMIC. 25-akpm/include/linux/swap.h | 1 - 25-akpm/mm/swap_state.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff -puN include/linux/swap.h~hugh-03-add_to_swap_cache include/linux/swap.h --- 25/include/linux/swap.h~hugh-03-add_to_swap_cache Tue Mar 25 18:34:45 2003 +++ 25-akpm/include/linux/swap.h Tue Mar 25 18:34:45 2003 @@ -200,7 +200,6 @@ extern int rw_swap_page_sync(int, swp_en extern struct address_space swapper_space; #define total_swapcache_pages swapper_space.nrpages extern void show_swap_cache_info(void); -extern int add_to_swap_cache(struct page *, swp_entry_t); extern int add_to_swap(struct page *); extern void __delete_from_swap_cache(struct page *); extern void delete_from_swap_cache(struct page *); diff -puN mm/swap_state.c~hugh-03-add_to_swap_cache mm/swap_state.c --- 25/mm/swap_state.c~hugh-03-add_to_swap_cache Tue Mar 25 18:34:45 2003 +++ 25-akpm/mm/swap_state.c Tue Mar 25 18:34:45 2003 @@ -68,7 +68,7 @@ void show_swap_cache_info(void) swap_cache_info.noent_race, swap_cache_info.exist_race); } -int add_to_swap_cache(struct page *page, swp_entry_t entry) +static int add_to_swap_cache(struct page *page, swp_entry_t entry) { int error; @@ -78,7 +78,7 @@ int add_to_swap_cache(struct page *page, INC_CACHE_INFO(noent_race); return -ENOENT; } - error = add_to_page_cache(page, &swapper_space, entry.val, GFP_ATOMIC); + error = add_to_page_cache(page, &swapper_space, entry.val, GFP_KERNEL); /* * Anon pages are already on the LRU, we don't run lru_cache_add here. */ _