Skip to content

Commit

Permalink
mm/hmm: move hmm_pfns_clear() closer to where it is used
Browse files Browse the repository at this point in the history
Move hmm_pfns_clear() closer to where it is used to make it clear it is
not use by page table walkers.

Link: http://lkml.kernel.org/r/20180323005527.758-13-jglisse@redhat.com
Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Cc: Evgeny Baskakov <ebaskakov@nvidia.com>
Cc: Ralph Campbell <rcampbell@nvidia.com>
Cc: Mark Hairgrove <mhairgrove@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Jérôme Glisse authored and Linus Torvalds committed Apr 11, 2018
1 parent b274411 commit 33cd47d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions mm/hmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,14 +340,6 @@ static int hmm_pfns_bad(unsigned long addr,
return 0;
}

static void hmm_pfns_clear(uint64_t *pfns,
unsigned long addr,
unsigned long end)
{
for (; addr < end; addr += PAGE_SIZE, pfns++)
*pfns = 0;
}

/*
* hmm_vma_walk_hole() - handle a range lacking valid pmd or pte(s)
* @start: range virtual start address (inclusive)
Expand Down Expand Up @@ -506,6 +498,14 @@ static int hmm_vma_walk_pmd(pmd_t *pmdp,
return 0;
}

static void hmm_pfns_clear(uint64_t *pfns,
unsigned long addr,
unsigned long end)
{
for (; addr < end; addr += PAGE_SIZE, pfns++)
*pfns = 0;
}

static void hmm_pfns_special(struct hmm_range *range)
{
unsigned long addr = range->start, i = 0;
Expand Down

0 comments on commit 33cd47d

Please sign in to comment.