[Bug 433646] Re: Kernel hang under memory stress

Petr Vandrovec petr at vmware.com
Mon Mar 22 07:14:55 UTC 2010


It was fixed upstream.  I'm not entirely sure whether 9.10 got this, but
as VMware did not receive any further bug reports I guess it did.

commit 31a5639623a487d6db996c8138c9e53fef2e2d91
Author: Daisuke Nishimura <nishimura at mxp.nes.nec.co.jp>
Date:   Mon Sep 21 17:02:50 2009 -0700

    mm: add_to_swap_cache() must not sleep
    
    After commit 355cfa73 ("mm: modify swap_map and add SWAP_HAS_CACHE flag"),
    read_swap_cache_async() will busy-wait while a entry doesn't exist in swap
    cache but it has SWAP_HAS_CACHE flag.
    
    Such entries can exist on add/delete path of swap cache.  On add path,
    add_to_swap_cache() is called soon after SWAP_HAS_CACHE flag is set, and
    on delete path, swapcache_free() will be called (SWAP_HAS_CACHE flag is
    cleared) soon after __delete_from_swap_cache() is called.  So, the
    busy-wait works well in most cases.
    
    But this mechanism can cause soft lockup if add_to_swap_cache() sleeps and
    read_swap_cache_async() tries to swap-in the same entry on the same cpu.
    
    This patch calls radix_tree_preload() before swapcache_prepare() and
    divides add_to_swap_cache() into two part: radix_tree_preload() part and
    radix_tree_insert() part(define it as __add_to_swap_cache()).
    
    Signed-off-by: Daisuke Nishimura <nishimura at mxp.nes.nec.co.jp>
    Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu at jp.fujitsu.com>
    Cc: Balbir Singh <balbir at linux.vnet.ibm.com>
    Cc: Hugh Dickins <hugh.dickins at tiscali.co.uk>
    Cc: Johannes Weiner <hannes at cmpxchg.org>
    Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>


** Changed in: linux (Ubuntu)
       Status: Incomplete => Fix Released

-- 
Kernel hang under memory stress
https://bugs.launchpad.net/bugs/433646
You received this bug notification because you are a member of Kernel
Bugs, which is subscribed to linux in ubuntu.




More information about the kernel-bugs mailing list