mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
mm: change direct call of spin_lock(anon_vma->lock) to inline function
Subsitute a direct call of spin_lock(anon_vma->lock) with an inline function doing exactly the same. This makes it easier to do the substitution to the root anon_vma lock in a following patch. We will deal with the handful of special locks (nested, dec_and_lock, etc) separately. Signed-off-by: Rik van Riel <[email protected]> Acked-by: Mel Gorman <[email protected]> Acked-by: KAMEZAWA Hiroyuki <[email protected]> Tested-by: Larry Woodman <[email protected]> Acked-by: Larry Woodman <[email protected]> Reviewed-by: Minchan Kim <[email protected]> Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
bb4a340e07
commit
cba48b98f2
5 changed files with 31 additions and 21 deletions
18
mm/ksm.c
18
mm/ksm.c
|
|
@ -327,7 +327,7 @@ static void drop_anon_vma(struct rmap_item *rmap_item)
|
|||
|
||||
if (atomic_dec_and_lock(&anon_vma->external_refcount, &anon_vma->lock)) {
|
||||
int empty = list_empty(&anon_vma->head);
|
||||
spin_unlock(&anon_vma->lock);
|
||||
anon_vma_unlock(anon_vma);
|
||||
if (empty)
|
||||
anon_vma_free(anon_vma);
|
||||
}
|
||||
|
|
@ -1566,7 +1566,7 @@ again:
|
|||
struct anon_vma_chain *vmac;
|
||||
struct vm_area_struct *vma;
|
||||
|
||||
spin_lock(&anon_vma->lock);
|
||||
anon_vma_lock(anon_vma);
|
||||
list_for_each_entry(vmac, &anon_vma->head, same_anon_vma) {
|
||||
vma = vmac->vma;
|
||||
if (rmap_item->address < vma->vm_start ||
|
||||
|
|
@ -1589,7 +1589,7 @@ again:
|
|||
if (!search_new_forks || !mapcount)
|
||||
break;
|
||||
}
|
||||
spin_unlock(&anon_vma->lock);
|
||||
anon_vma_unlock(anon_vma);
|
||||
if (!mapcount)
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -1619,7 +1619,7 @@ again:
|
|||
struct anon_vma_chain *vmac;
|
||||
struct vm_area_struct *vma;
|
||||
|
||||
spin_lock(&anon_vma->lock);
|
||||
anon_vma_lock(anon_vma);
|
||||
list_for_each_entry(vmac, &anon_vma->head, same_anon_vma) {
|
||||
vma = vmac->vma;
|
||||
if (rmap_item->address < vma->vm_start ||
|
||||
|
|
@ -1637,11 +1637,11 @@ again:
|
|||
ret = try_to_unmap_one(page, vma,
|
||||
rmap_item->address, flags);
|
||||
if (ret != SWAP_AGAIN || !page_mapped(page)) {
|
||||
spin_unlock(&anon_vma->lock);
|
||||
anon_vma_unlock(anon_vma);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
spin_unlock(&anon_vma->lock);
|
||||
anon_vma_unlock(anon_vma);
|
||||
}
|
||||
if (!search_new_forks++)
|
||||
goto again;
|
||||
|
|
@ -1671,7 +1671,7 @@ again:
|
|||
struct anon_vma_chain *vmac;
|
||||
struct vm_area_struct *vma;
|
||||
|
||||
spin_lock(&anon_vma->lock);
|
||||
anon_vma_lock(anon_vma);
|
||||
list_for_each_entry(vmac, &anon_vma->head, same_anon_vma) {
|
||||
vma = vmac->vma;
|
||||
if (rmap_item->address < vma->vm_start ||
|
||||
|
|
@ -1688,11 +1688,11 @@ again:
|
|||
|
||||
ret = rmap_one(page, vma, rmap_item->address, arg);
|
||||
if (ret != SWAP_AGAIN) {
|
||||
spin_unlock(&anon_vma->lock);
|
||||
anon_vma_unlock(anon_vma);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
spin_unlock(&anon_vma->lock);
|
||||
anon_vma_unlock(anon_vma);
|
||||
}
|
||||
if (!search_new_forks++)
|
||||
goto again;
|
||||
|
|
|
|||
Loading…
Reference in a new issue