aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/list_lru.c19
-rw-r--r--mm/workingset.c3
2 files changed, 18 insertions, 4 deletions
diff --git a/mm/list_lru.c b/mm/list_lru.c
index 79aee70c3b9d..8d9d168c6c38 100644
--- a/mm/list_lru.c
+++ b/mm/list_lru.c
@@ -132,6 +132,21 @@ bool list_lru_del(struct list_lru *lru, struct list_head *item)
132} 132}
133EXPORT_SYMBOL_GPL(list_lru_del); 133EXPORT_SYMBOL_GPL(list_lru_del);
134 134
135void list_lru_isolate(struct list_lru_one *list, struct list_head *item)
136{
137 list_del_init(item);
138 list->nr_items--;
139}
140EXPORT_SYMBOL_GPL(list_lru_isolate);
141
142void list_lru_isolate_move(struct list_lru_one *list, struct list_head *item,
143 struct list_head *head)
144{
145 list_move(item, head);
146 list->nr_items--;
147}
148EXPORT_SYMBOL_GPL(list_lru_isolate_move);
149
135static unsigned long __list_lru_count_one(struct list_lru *lru, 150static unsigned long __list_lru_count_one(struct list_lru *lru,
136 int nid, int memcg_idx) 151 int nid, int memcg_idx)
137{ 152{
@@ -194,13 +209,11 @@ restart:
194 break; 209 break;
195 --*nr_to_walk; 210 --*nr_to_walk;
196 211
197 ret = isolate(item, &nlru->lock, cb_arg); 212 ret = isolate(item, l, &nlru->lock, cb_arg);
198 switch (ret) { 213 switch (ret) {
199 case LRU_REMOVED_RETRY: 214 case LRU_REMOVED_RETRY:
200 assert_spin_locked(&nlru->lock); 215 assert_spin_locked(&nlru->lock);
201 case LRU_REMOVED: 216 case LRU_REMOVED:
202 l->nr_items--;
203 WARN_ON_ONCE(l->nr_items < 0);
204 isolated++; 217 isolated++;
205 /* 218 /*
206 * If the lru lock has been dropped, our list 219 * If the lru lock has been dropped, our list
diff --git a/mm/workingset.c b/mm/workingset.c
index d4fa7fb10a52..aa017133744b 100644
--- a/mm/workingset.c
+++ b/mm/workingset.c
@@ -302,6 +302,7 @@ static unsigned long count_shadow_nodes(struct shrinker *shrinker,
302} 302}
303 303
304static enum lru_status shadow_lru_isolate(struct list_head *item, 304static enum lru_status shadow_lru_isolate(struct list_head *item,
305 struct list_lru_one *lru,
305 spinlock_t *lru_lock, 306 spinlock_t *lru_lock,
306 void *arg) 307 void *arg)
307{ 308{
@@ -332,7 +333,7 @@ static enum lru_status shadow_lru_isolate(struct list_head *item,
332 goto out; 333 goto out;
333 } 334 }
334 335
335 list_del_init(item); 336 list_lru_isolate(lru, item);
336 spin_unlock(lru_lock); 337 spin_unlock(lru_lock);
337 338
338 /* 339 /*