powerpc/mm: Avoid useless lock with single page fragments
[linux-2.6-block.git] / arch / powerpc / mm / pgtable-book3s64.c
index 0c0fd173208a39a0052e084276c287c076571307..f3c31f5e1026fca9f2e01da261e1319dccbceaf0 100644 (file)
@@ -244,6 +244,9 @@ static pmd_t *get_pmd_from_cache(struct mm_struct *mm)
 {
        void *pmd_frag, *ret;
 
+       if (PMD_FRAG_NR == 1)
+               return NULL;
+
        spin_lock(&mm->page_table_lock);
        ret = mm->context.pmd_frag;
        if (ret) {