提交 b3807a91 编写于 作者: H Hugh Dickins 提交者: Linus Torvalds

mm: page_vma_mapped_walk(): add a level of indentation

page_vma_mapped_walk() cleanup: add a level of indentation to much of
the body, making no functional change in this commit, but reducing the
later diff when this is all converted to a loop.

[hughd@google.com: : page_vma_mapped_walk(): add a level of indentation fix]
  Link: https://lkml.kernel.org/r/7f817555-3ce1-c785-e438-87d8efdcaf26@google.com

Link: https://lkml.kernel.org/r/efde211-f3e2-fe54-977-ef481419e7f3@google.comSigned-off-by: NHugh Dickins <hughd@google.com>
Acked-by: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Peter Xu <peterx@redhat.com>
Cc: Ralph Campbell <rcampbell@nvidia.com>
Cc: Wang Yugui <wangyugui@e16-tech.com>
Cc: Will Deacon <will@kernel.org>
Cc: Yang Shi <shy828301@gmail.com>
Cc: Zi Yan <ziy@nvidia.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 44828248
...@@ -173,6 +173,7 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw) ...@@ -173,6 +173,7 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw)
if (pvmw->pte) if (pvmw->pte)
goto next_pte; goto next_pte;
restart: restart:
{
pgd = pgd_offset(mm, pvmw->address); pgd = pgd_offset(mm, pvmw->address);
if (!pgd_present(*pgd)) if (!pgd_present(*pgd))
return false; return false;
...@@ -182,6 +183,7 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw) ...@@ -182,6 +183,7 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw)
pud = pud_offset(p4d, pvmw->address); pud = pud_offset(p4d, pvmw->address);
if (!pud_present(*pud)) if (!pud_present(*pud))
return false; return false;
pvmw->pmd = pmd_offset(pud, pvmw->address); pvmw->pmd = pmd_offset(pud, pvmw->address);
/* /*
* Make sure the pmd value isn't cached in a register by the * Make sure the pmd value isn't cached in a register by the
...@@ -189,6 +191,7 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw) ...@@ -189,6 +191,7 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw)
* subsequent update. * subsequent update.
*/ */
pmde = READ_ONCE(*pvmw->pmd); pmde = READ_ONCE(*pvmw->pmd);
if (pmd_trans_huge(pmde) || is_pmd_migration_entry(pmde)) { if (pmd_trans_huge(pmde) || is_pmd_migration_entry(pmde)) {
pvmw->ptl = pmd_lock(mm, pvmw->pmd); pvmw->ptl = pmd_lock(mm, pvmw->pmd);
pmde = *pvmw->pmd; pmde = *pvmw->pmd;
...@@ -220,7 +223,8 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw) ...@@ -220,7 +223,8 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw)
* cannot return prematurely, while zap_huge_pmd() has * cannot return prematurely, while zap_huge_pmd() has
* cleared *pmd but not decremented compound_mapcount(). * cleared *pmd but not decremented compound_mapcount().
*/ */
if ((pvmw->flags & PVMW_SYNC) && PageTransCompound(page)) { if ((pvmw->flags & PVMW_SYNC) &&
PageTransCompound(page)) {
spinlock_t *ptl = pmd_lock(mm, pvmw->pmd); spinlock_t *ptl = pmd_lock(mm, pvmw->pmd);
spin_unlock(ptl); spin_unlock(ptl);
...@@ -229,6 +233,7 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw) ...@@ -229,6 +233,7 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw)
} }
if (!map_pte(pvmw)) if (!map_pte(pvmw))
goto next_pte; goto next_pte;
}
while (1) { while (1) {
unsigned long end; unsigned long end;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册