diff options
author | Christophe Leroy <christophe.leroy@c-s.fr> | 2018-11-29 14:06:53 +0000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-12-04 19:45:01 +1100 |
commit | 2a146533bf96af3fba97b1c91efe0416b1b24b95 (patch) | |
tree | 6b088db9efed497fbd2f43fe1b95d25988037ac3 /arch/powerpc/mm/pgtable-book3s64.c | |
parent | a95d133c8643cae40a35f82184640d312ba9f11f (diff) | |
download | linux-stable-2a146533bf96af3fba97b1c91efe0416b1b24b95.tar.gz linux-stable-2a146533bf96af3fba97b1c91efe0416b1b24b95.tar.bz2 linux-stable-2a146533bf96af3fba97b1c91efe0416b1b24b95.zip |
powerpc/mm: Avoid useless lock with single page fragments
There is no point in taking the page table lock as pte_frag or
pmd_frag are always NULL when we have only one fragment.
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm/pgtable-book3s64.c')
-rw-r--r-- | arch/powerpc/mm/pgtable-book3s64.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/powerpc/mm/pgtable-book3s64.c b/arch/powerpc/mm/pgtable-book3s64.c index 0c0fd173208a..f3c31f5e1026 100644 --- a/arch/powerpc/mm/pgtable-book3s64.c +++ b/arch/powerpc/mm/pgtable-book3s64.c @@ -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) { |