Commit 6ca342d0 authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Linus Torvalds

mm: workingset: make shadow_lru_isolate() use locking suffix

shadow_lru_isolate() disables interrupts and acquires a lock.  It could
use spin_lock_irq() instead.  It also uses local_irq_enable() while it
could use spin_unlock_irq()/xa_unlock_irq().

Use proper suffix for lock/unlock in order to enable/disable interrupts
during release/acquire of a lock.

Link: http://lkml.kernel.org/r/20180622151221.28167-3-bigeasy@linutronix.deSigned-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Kirill Tkhai <ktkhai@virtuozzo.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ae1e16da
...@@ -431,7 +431,7 @@ static enum lru_status shadow_lru_isolate(struct list_head *item, ...@@ -431,7 +431,7 @@ static enum lru_status shadow_lru_isolate(struct list_head *item,
/* Coming from the list, invert the lock order */ /* Coming from the list, invert the lock order */
if (!xa_trylock(&mapping->i_pages)) { if (!xa_trylock(&mapping->i_pages)) {
spin_unlock(lru_lock); spin_unlock_irq(lru_lock);
ret = LRU_RETRY; ret = LRU_RETRY;
goto out; goto out;
} }
...@@ -469,13 +469,11 @@ static enum lru_status shadow_lru_isolate(struct list_head *item, ...@@ -469,13 +469,11 @@ static enum lru_status shadow_lru_isolate(struct list_head *item,
workingset_lookup_update(mapping)); workingset_lookup_update(mapping));
out_invalid: out_invalid:
xa_unlock(&mapping->i_pages); xa_unlock_irq(&mapping->i_pages);
ret = LRU_REMOVED_RETRY; ret = LRU_REMOVED_RETRY;
out: out:
local_irq_enable();
cond_resched(); cond_resched();
local_irq_disable(); spin_lock_irq(lru_lock);
spin_lock(lru_lock);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment