mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 06:01:23 +00:00
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>
This commit is contained in:
parent
6e018968f8
commit
6b51e88199
3 changed files with 42 additions and 6 deletions
|
@ -483,13 +483,9 @@ out:
|
|||
static unsigned long scan_shadow_nodes(struct shrinker *shrinker,
|
||||
struct shrink_control *sc)
|
||||
{
|
||||
unsigned long ret;
|
||||
|
||||
/* list_lru lock nests inside the IRQ-safe i_pages lock */
|
||||
local_irq_disable();
|
||||
ret = list_lru_shrink_walk(&shadow_nodes, sc, shadow_lru_isolate, NULL);
|
||||
local_irq_enable();
|
||||
return ret;
|
||||
return list_lru_shrink_walk_irq(&shadow_nodes, sc, shadow_lru_isolate,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static struct shrinker workingset_shadow_shrinker = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue