]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mm/huge_memory.c: use lockdep_assert_held()
authorAndi Kleen <ak@linux.intel.com>
Wed, 4 Apr 2012 00:08:25 +0000 (10:08 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 11 Apr 2012 04:45:50 +0000 (14:45 +1000)
Use lockdep_assert_held() to check for locks instead of an opencoded
variant.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Hugh Dickins <hughd@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/huge_memory.c
mm/swap.c

index f0e5306eeb55e8e179da3abbe6c033045b6ad073..439f4f1ee17b24ee215f028e42a235b87db57f4c 100644 (file)
@@ -2076,7 +2076,7 @@ static void collect_mm_slot(struct mm_slot *mm_slot)
 {
        struct mm_struct *mm = mm_slot->mm;
 
-       VM_BUG_ON(NR_CPUS != 1 && !spin_is_locked(&khugepaged_mm_lock));
+       lockdep_assert_held(&khugepaged_mm_lock);
 
        if (khugepaged_test_exit(mm)) {
                /* free mm_slot */
@@ -2106,7 +2106,7 @@ static unsigned int khugepaged_scan_mm_slot(unsigned int pages,
        int progress = 0;
 
        VM_BUG_ON(!pages);
-       VM_BUG_ON(NR_CPUS != 1 && !spin_is_locked(&khugepaged_mm_lock));
+       lockdep_assert_held(&khugepaged_mm_lock);
 
        if (khugepaged_scan.mm_slot)
                mm_slot = khugepaged_scan.mm_slot;
index 60d14daa2b2577c88b370b0787c864704f0a7448..8ff73d83d38ee3684f1868d933d35ba0a51bf0b2 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -653,7 +653,7 @@ void lru_add_page_tail(struct zone* zone,
        VM_BUG_ON(!PageHead(page));
        VM_BUG_ON(PageCompound(page_tail));
        VM_BUG_ON(PageLRU(page_tail));
-       VM_BUG_ON(NR_CPUS != 1 && !spin_is_locked(&zone->lru_lock));
+       lockdep_assert_held(&zone->lru_lock);
 
        SetPageLRU(page_tail);