diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2016-08-29 18:03:37 -0400 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2016-08-29 18:03:37 -0400 |
commit | 21ff871160054395f1b4d876659950a5d7cc081a (patch) | |
tree | ef4535b6b149d3fdcab79a79c2b70b3e467520b4 | |
parent | 910bf14e5d8c23b48b715fc0741a7978ded1d08e (diff) | |
download | 4.8-rt-patches-21ff871160054395f1b4d876659950a5d7cc081a.tar.gz |
mm: reindent chunk of workingset patchrt-v4.6-10954-g478a1469a7d2
-rw-r--r-- | patches/mm-workingset-do-not-protect-workingset_shadow_nodes.patch | 63 |
1 files changed, 35 insertions, 28 deletions
diff --git a/patches/mm-workingset-do-not-protect-workingset_shadow_nodes.patch b/patches/mm-workingset-do-not-protect-workingset_shadow_nodes.patch index cfe0da6f4e3584..9f2024f3fab1c2 100644 --- a/patches/mm-workingset-do-not-protect-workingset_shadow_nodes.patch +++ b/patches/mm-workingset-do-not-protect-workingset_shadow_nodes.patch @@ -1,6 +1,8 @@ +From 1fe2f7b694cfb12dfd0255d4b6a1f6e4c614535e Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Thu, 29 Jan 2015 17:19:44 +0100 -Subject: mm/workingset: Do not protect workingset_shadow_nodes with irq off +Subject: [PATCH] mm/workingset: Do not protect workingset_shadow_nodes with + irq off workingset_shadow_nodes is protected by local_irq_disable(). Some users use spin_lock_irq(). @@ -8,13 +10,9 @@ Replace the irq/on with a local_lock(). Rename workingset_shadow_nodes so I catch users of it which will be introduced later. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - include/linux/swap.h | 4 +++- - mm/filemap.c | 11 ++++++++--- - mm/truncate.c | 7 +++++-- - mm/workingset.c | 23 ++++++++++++----------- - 4 files changed, 28 insertions(+), 17 deletions(-) +diff --git a/include/linux/swap.h b/include/linux/swap.h +index 0af2bb2028fd..98d34df40058 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -11,6 +11,7 @@ @@ -35,10 +33,12 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static inline unsigned int workingset_node_pages(struct radix_tree_node *node) { +diff --git a/mm/filemap.c b/mm/filemap.c +index 00ae878b2a38..396158274ea6 100644 --- a/mm/filemap.c +++ b/mm/filemap.c -@@ -169,7 +169,9 @@ static void page_cache_tree_delete(struc - if (!workingset_node_pages(node) && +@@ -154,7 +154,9 @@ static void page_cache_tree_delete(struct address_space *mapping, + if (!dax_mapping(mapping) && !workingset_node_pages(node) && list_empty(&node->private_list)) { node->private_data = mapping; - list_lru_add(&workingset_shadow_nodes, &node->private_list); @@ -48,7 +48,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } } -@@ -618,9 +620,12 @@ static int page_cache_tree_insert(struct +@@ -613,9 +615,12 @@ static int page_cache_tree_insert(struct address_space *mapping, * node->private_list is protected by * mapping->tree_lock. */ @@ -63,26 +63,30 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } return 0; } +diff --git a/mm/truncate.c b/mm/truncate.c +index 4064f8f53daa..7baa4c782375 100644 --- a/mm/truncate.c +++ b/mm/truncate.c -@@ -63,9 +63,12 @@ static void clear_exceptional_entry(stru - * protected by mapping->tree_lock. - */ - if (!workingset_node_shadows(node) && -- !list_empty(&node->private_list)) -- list_lru_del(&workingset_shadow_nodes, -+ !list_empty(&node->private_list)) { -+ local_lock(workingset_shadow_lock); -+ list_lru_del(&__workingset_shadow_nodes, - &node->private_list); -+ local_unlock(workingset_shadow_lock); -+ } - __radix_tree_delete_node(&mapping->page_tree, node); - } +@@ -62,9 +62,12 @@ static void clear_exceptional_entry(struct address_space *mapping, + * protected by mapping->tree_lock. + */ + if (!workingset_node_shadows(node) && +- !list_empty(&node->private_list)) +- list_lru_del(&workingset_shadow_nodes, ++ !list_empty(&node->private_list)) { ++ local_lock(workingset_shadow_lock); ++ list_lru_del(&__workingset_shadow_nodes, + &node->private_list); ++ local_unlock(workingset_shadow_lock); ++ } + __radix_tree_delete_node(&mapping->page_tree, node); unlock: + spin_unlock_irq(&mapping->tree_lock); +diff --git a/mm/workingset.c b/mm/workingset.c +index 8a75f8d2916a..00a38f9f0f37 100644 --- a/mm/workingset.c +++ b/mm/workingset.c -@@ -335,7 +335,8 @@ void workingset_activation(struct page * +@@ -335,7 +335,8 @@ out: * point where they would still be useful. */ @@ -92,7 +96,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> static unsigned long count_shadow_nodes(struct shrinker *shrinker, struct shrink_control *sc) -@@ -345,9 +346,9 @@ static unsigned long count_shadow_nodes( +@@ -345,9 +346,9 @@ static unsigned long count_shadow_nodes(struct shrinker *shrinker, unsigned long pages; /* list_lru lock nests inside IRQ-safe mapping->tree_lock */ @@ -105,7 +109,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (memcg_kmem_enabled()) pages = mem_cgroup_node_nr_lru_pages(sc->memcg, sc->nid, -@@ -440,9 +441,9 @@ static enum lru_status shadow_lru_isolat +@@ -440,9 +441,9 @@ static enum lru_status shadow_lru_isolate(struct list_head *item, spin_unlock(&mapping->tree_lock); ret = LRU_REMOVED_RETRY; out: @@ -117,7 +121,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> spin_lock(lru_lock); return ret; } -@@ -453,10 +454,10 @@ static unsigned long scan_shadow_nodes(s +@@ -453,10 +454,10 @@ static unsigned long scan_shadow_nodes(struct shrinker *shrinker, unsigned long ret; /* list_lru lock nests inside IRQ-safe mapping->tree_lock */ @@ -149,3 +153,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> err: return ret; } +-- +2.5.0 + |