diff options
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-.patch | 60 |
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 @@ | |||
1 | From 8afb43e5f076643f012d0267aebb215cc0f0767b Mon Sep 17 00:00:00 2001 | ||
2 | From: Hugh Dickins <hughd@google.com> | ||
3 | Date: Mon, 23 Apr 2012 11:14:50 -0700 | ||
4 | Subject: [PATCH 022/165] mm: fix s390 BUG by __set_page_dirty_no_writeback on | ||
5 | swap | ||
6 | |||
7 | commit aca50bd3b4c4bb5528a1878158ba7abce41de534 upstream. | ||
8 | |||
9 | Mel reports a BUG_ON(slot == NULL) in radix_tree_tag_set() on s390 | ||
10 | 3.0.13: called from __set_page_dirty_nobuffers() when page_remove_rmap() | ||
11 | tries to transfer dirty flag from s390 storage key to struct page and | ||
12 | radix_tree. | ||
13 | |||
14 | That would be because of reclaim's shrink_page_list() calling | ||
15 | add_to_swap() on this page at the same time: first PageSwapCache is set | ||
16 | (causing page_mapping(page) to appear as &swapper_space), then | ||
17 | page->private set, then tree_lock taken, then page inserted into | ||
18 | radix_tree - so there's an interval before taking the lock when the | ||
19 | radix_tree slot is empty. | ||
20 | |||
21 | We could fix this by moving __add_to_swap_cache()'s spin_lock_irq up | ||
22 | before the SetPageSwapCache. But a better fix is simply to do what's | ||
23 | five years overdue: Ken Chen introduced __set_page_dirty_no_writeback() | ||
24 | (if !PageDirty TestSetPageDirty) for tmpfs to skip all the radix_tree | ||
25 | overhead, and swap is just the same - it ignores the radix_tree tag, and | ||
26 | does not participate in dirty page accounting, so should be using | ||
27 | __set_page_dirty_no_writeback() too. | ||
28 | |||
29 | s390 testing now confirms that this does indeed fix the problem. | ||
30 | |||
31 | Reported-by: Mel Gorman <mgorman@suse.de> | ||
32 | Signed-off-by: Hugh Dickins <hughd@google.com> | ||
33 | Acked-by: Mel Gorman <mgorman@suse.de> | ||
34 | Cc: Andrew Morton <akpm@linux-foundation.org> | ||
35 | Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> | ||
36 | Cc: Heiko Carstens <heiko.carstens@de.ibm.com> | ||
37 | Cc: Rik van Riel <riel@redhat.com> | ||
38 | Cc: Ken Chen <kenchen@google.com> | ||
39 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
40 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
41 | --- | ||
42 | mm/swap_state.c | 2 +- | ||
43 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
44 | |||
45 | diff --git a/mm/swap_state.c b/mm/swap_state.c | ||
46 | index 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 | -- | ||
59 | 1.7.7.6 | ||
60 | |||