Skip to content

Commit

Permalink
mm: move pgtable related functions to right place
Browse files Browse the repository at this point in the history
pgtable related functions are mostly in pgtable-generic.c.
So move remaining functions from memory.c to pgtable-generic.c.

Signed-off-by: Joonsoo Kim <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: Rik van Riel <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
JoonsooKim authored and torvalds committed Sep 11, 2013
1 parent e66f097 commit bc4b444
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
24 changes: 0 additions & 24 deletions mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,30 +372,6 @@ void tlb_remove_table(struct mmu_gather *tlb, void *table)

#endif /* CONFIG_HAVE_RCU_TABLE_FREE */

/*
* If a p?d_bad entry is found while walking page tables, report
* the error, before resetting entry to p?d_none. Usually (but
* very seldom) called out from the p?d_none_or_clear_bad macros.
*/

void pgd_clear_bad(pgd_t *pgd)
{
pgd_ERROR(*pgd);
pgd_clear(pgd);
}

void pud_clear_bad(pud_t *pud)
{
pud_ERROR(*pud);
pud_clear(pud);
}

void pmd_clear_bad(pmd_t *pmd)
{
pmd_ERROR(*pmd);
pmd_clear(pmd);
}

/*
* Note: this doesn't free the actual pages themselves. That
* has been handled earlier when unmapping all the memory regions.
Expand Down
24 changes: 24 additions & 0 deletions mm/pgtable-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,30 @@
#include <asm/tlb.h>
#include <asm-generic/pgtable.h>

/*
* If a p?d_bad entry is found while walking page tables, report
* the error, before resetting entry to p?d_none. Usually (but
* very seldom) called out from the p?d_none_or_clear_bad macros.
*/

void pgd_clear_bad(pgd_t *pgd)
{
pgd_ERROR(*pgd);
pgd_clear(pgd);
}

void pud_clear_bad(pud_t *pud)
{
pud_ERROR(*pud);
pud_clear(pud);
}

void pmd_clear_bad(pmd_t *pmd)
{
pmd_ERROR(*pmd);
pmd_clear(pmd);
}

#ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
/*
* Only sets the access flags (dirty, accessed), as well as write
Expand Down

0 comments on commit bc4b444

Please sign in to comment.