X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=mm%2Fmemory.c;h=a07120da868bccfec557ea72d28c2ba99e563c18;hb=40fcfc87222e2e8af6379ec366f0cb2a411570cd;hp=156861fcac436e4716537c7e5dff565dded43224;hpb=7c2aed4b5632fb536721b8494d1a4a65852ffb49;p=powerpc.git diff --git a/mm/memory.c b/mm/memory.c index 156861fcac..a07120da86 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1991,6 +1991,7 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma, delayacct_set_flag(DELAYACCT_PF_SWAPIN); page = lookup_swap_cache(entry); if (!page) { + grab_swap_token(); /* Contend for token _before_ read-in */ swapin_readahead(entry, address, vma); page = read_swap_cache_async(entry, vma, address); if (!page) { @@ -2008,7 +2009,6 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma, /* Had to read the page from swap area: Major fault */ ret = VM_FAULT_MAJOR; count_vm_event(PGMAJFAULT); - grab_swap_token(); } delayacct_clear_flag(DELAYACCT_PF_SWAPIN);