From: Greg Kroah-Hartman Date: Tue, 24 Apr 2012 16:09:02 +0000 (-0700) Subject: 3.0-stable patches X-Git-Tag: v3.0.30~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=975e45cca990903b04fcc675b7ebc68b091f31c4;p=thirdparty%2Fkernel%2Fstable-queue.git 3.0-stable patches added patches: mm-fix-s390-bug-by-__set_page_dirty_no_writeback-on-swap.patch --- diff --git a/queue-3.0/mm-fix-s390-bug-by-__set_page_dirty_no_writeback-on-swap.patch b/queue-3.0/mm-fix-s390-bug-by-__set_page_dirty_no_writeback-on-swap.patch new file mode 100644 index 00000000000..c00f11974fc --- /dev/null +++ b/queue-3.0/mm-fix-s390-bug-by-__set_page_dirty_no_writeback-on-swap.patch @@ -0,0 +1,57 @@ +From aca50bd3b4c4bb5528a1878158ba7abce41de534 Mon Sep 17 00:00:00 2001 +From: Hugh Dickins +Date: Mon, 23 Apr 2012 11:14:50 -0700 +Subject: mm: fix s390 BUG by __set_page_dirty_no_writeback on swap + +From: Hugh Dickins + +commit aca50bd3b4c4bb5528a1878158ba7abce41de534 upstream. + +Mel reports a BUG_ON(slot == NULL) in radix_tree_tag_set() on s390 +3.0.13: called from __set_page_dirty_nobuffers() when page_remove_rmap() +tries to transfer dirty flag from s390 storage key to struct page and +radix_tree. + +That would be because of reclaim's shrink_page_list() calling +add_to_swap() on this page at the same time: first PageSwapCache is set +(causing page_mapping(page) to appear as &swapper_space), then +page->private set, then tree_lock taken, then page inserted into +radix_tree - so there's an interval before taking the lock when the +radix_tree slot is empty. + +We could fix this by moving __add_to_swap_cache()'s spin_lock_irq up +before the SetPageSwapCache. But a better fix is simply to do what's +five years overdue: Ken Chen introduced __set_page_dirty_no_writeback() +(if !PageDirty TestSetPageDirty) for tmpfs to skip all the radix_tree +overhead, and swap is just the same - it ignores the radix_tree tag, and +does not participate in dirty page accounting, so should be using +__set_page_dirty_no_writeback() too. + +s390 testing now confirms that this does indeed fix the problem. + +Reported-by: Mel Gorman +Signed-off-by: Hugh Dickins +Acked-by: Mel Gorman +Cc: Andrew Morton +Cc: Martin Schwidefsky +Cc: Heiko Carstens +Cc: Rik van Riel +Cc: Ken Chen +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + mm/swap_state.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/mm/swap_state.c ++++ b/mm/swap_state.c +@@ -28,7 +28,7 @@ + */ + static const struct address_space_operations swap_aops = { + .writepage = swap_writepage, +- .set_page_dirty = __set_page_dirty_nobuffers, ++ .set_page_dirty = __set_page_dirty_no_writeback, + .migratepage = migrate_page, + }; + diff --git a/queue-3.0/series b/queue-3.0/series index df27703e0b2..be71ba31ddf 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -12,3 +12,4 @@ uwb-fix-error-handling.patch davinci_mdio-fix-mdio-timeout-check.patch media-rc-core-set-mode-for-winbond-cir.patch cfg80211-fix-interface-combinations-check.patch +mm-fix-s390-bug-by-__set_page_dirty_no_writeback-on-swap.patch