summaryrefslogtreecommitdiffstats
path: root/mm/workingset.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2018-08-17 18:49:55 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-08-17 19:20:32 -0400
commit6b51e88199ca4f75ff647eff28efd30bfcb08dc4 (patch)
tree6c1411444d28a3a77c36bfddb92576b43469245f /mm/workingset.c
parent6e018968f8d384d84484eba8e4c90489a25d7095 (diff)
mm/list_lru: introduce list_lru_shrink_walk_irq()
Provide list_lru_shrink_walk_irq() and let it behave like list_lru_walk_one() except that it locks the spinlock with spin_lock_irq(). This is used by scan_shadow_nodes() because its lock nests within the i_pages lock which is acquired with IRQ. This change allows to use proper locking promitives instead hand crafted lock_irq_disable() plus spin_lock(). There is no EXPORT_SYMBOL provided because the current user is in-kernel only. Add list_lru_shrink_walk_irq() which acquires the spinlock with the proper locking primitives. Link: http://lkml.kernel.org/r/20180716111921.5365-5-bigeasy@linutronix.de Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Reviewed-by: Vladimir Davydov <vdavydov.dev@gmail.com> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/workingset.c')
-rw-r--r--mm/workingset.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/mm/workingset.c b/mm/workingset.c
index bc72ad029b3e..4516dd790129 100644
--- a/mm/workingset.c
+++ b/mm/workingset.c
@@ -483,13 +483,9 @@ out:
483static unsigned long scan_shadow_nodes(struct shrinker *shrinker, 483static unsigned long scan_shadow_nodes(struct shrinker *shrinker,
484 struct shrink_control *sc) 484 struct shrink_control *sc)
485{ 485{
486 unsigned long ret;
487
488 /* list_lru lock nests inside the IRQ-safe i_pages lock */ 486 /* list_lru lock nests inside the IRQ-safe i_pages lock */
489 local_irq_disable(); 487 return list_lru_shrink_walk_irq(&shadow_nodes, sc, shadow_lru_isolate,
490 ret = list_lru_shrink_walk(&shadow_nodes, sc, shadow_lru_isolate, NULL); 488 NULL);
491 local_irq_enable();
492 return ret;
493} 489}
494 490
495static struct shrinker workingset_shadow_shrinker = { 491static struct shrinker workingset_shadow_shrinker = {