summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0022-mm-fix-s390-BUG-by-__set_page_dirty_no_writeback-on-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0022-mm-fix-s390-BUG-by-__set_page_dirty_no_writeback-on-.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0022-mm-fix-s390-BUG-by-__set_page_dirty_no_writeback-on-.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0022-mm-fix-s390-BUG-by-__set_page_dirty_no_writeback-on-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0022-mm-fix-s390-BUG-by-__set_page_dirty_no_writeback-on-.patch
new file mode 100644
index 00000000..4ba10abc
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0022-mm-fix-s390-BUG-by-__set_page_dirty_no_writeback-on-.patch
@@ -0,0 +1,60 @@
1From 8afb43e5f076643f012d0267aebb215cc0f0767b Mon Sep 17 00:00:00 2001
2From: Hugh Dickins <hughd@google.com>
3Date: Mon, 23 Apr 2012 11:14:50 -0700
4Subject: [PATCH 022/165] mm: fix s390 BUG by __set_page_dirty_no_writeback on
5 swap
6
7commit aca50bd3b4c4bb5528a1878158ba7abce41de534 upstream.
8
9Mel reports a BUG_ON(slot == NULL) in radix_tree_tag_set() on s390
103.0.13: called from __set_page_dirty_nobuffers() when page_remove_rmap()
11tries to transfer dirty flag from s390 storage key to struct page and
12radix_tree.
13
14That would be because of reclaim's shrink_page_list() calling
15add_to_swap() on this page at the same time: first PageSwapCache is set
16(causing page_mapping(page) to appear as &swapper_space), then
17page->private set, then tree_lock taken, then page inserted into
18radix_tree - so there's an interval before taking the lock when the
19radix_tree slot is empty.
20
21We could fix this by moving __add_to_swap_cache()'s spin_lock_irq up
22before the SetPageSwapCache. But a better fix is simply to do what's
23five years overdue: Ken Chen introduced __set_page_dirty_no_writeback()
24(if !PageDirty TestSetPageDirty) for tmpfs to skip all the radix_tree
25overhead, and swap is just the same - it ignores the radix_tree tag, and
26does not participate in dirty page accounting, so should be using
27__set_page_dirty_no_writeback() too.
28
29s390 testing now confirms that this does indeed fix the problem.
30
31Reported-by: Mel Gorman <mgorman@suse.de>
32Signed-off-by: Hugh Dickins <hughd@google.com>
33Acked-by: Mel Gorman <mgorman@suse.de>
34Cc: Andrew Morton <akpm@linux-foundation.org>
35Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
36Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
37Cc: Rik van Riel <riel@redhat.com>
38Cc: Ken Chen <kenchen@google.com>
39Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
40Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
41---
42 mm/swap_state.c | 2 +-
43 1 files changed, 1 insertions(+), 1 deletions(-)
44
45diff --git a/mm/swap_state.c b/mm/swap_state.c
46index 78cc4d1..7704d9c 100644
47--- a/mm/swap_state.c
48+++ b/mm/swap_state.c
49@@ -27,7 +27,7 @@
50 */
51 static const struct address_space_operations swap_aops = {
52 .writepage = swap_writepage,
53- .set_page_dirty = __set_page_dirty_nobuffers,
54+ .set_page_dirty = __set_page_dirty_no_writeback,
55 .migratepage = migrate_page,
56 };
57
58--
591.7.7.6
60