Skip to content

Commit bc4b444

Browse files
JoonsooKimtorvalds
authored andcommitted
mm: move pgtable related functions to right place
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 <iamjoonsoo.kim@lge.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Minchan Kim <minchan@kernel.org> Cc: Mel Gorman <mgorman@suse.de> Cc: Rik van Riel <riel@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent e66f097 commit bc4b444

2 files changed

Lines changed: 24 additions & 24 deletions

File tree

‎mm/memory.c‎

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -372,30 +372,6 @@ void tlb_remove_table(struct mmu_gather *tlb, void *table)
372372

373373
#endif /* CONFIG_HAVE_RCU_TABLE_FREE */
374374

375-
/*
376-
* If a p?d_bad entry is found while walking page tables, report
377-
* the error, before resetting entry to p?d_none. Usually (but
378-
* very seldom) called out from the p?d_none_or_clear_bad macros.
379-
*/
380-
381-
void pgd_clear_bad(pgd_t *pgd)
382-
{
383-
pgd_ERROR(*pgd);
384-
pgd_clear(pgd);
385-
}
386-
387-
void pud_clear_bad(pud_t *pud)
388-
{
389-
pud_ERROR(*pud);
390-
pud_clear(pud);
391-
}
392-
393-
void pmd_clear_bad(pmd_t *pmd)
394-
{
395-
pmd_ERROR(*pmd);
396-
pmd_clear(pmd);
397-
}
398-
399375
/*
400376
* Note: this doesn't free the actual pages themselves. That
401377
* has been handled earlier when unmapping all the memory regions.

‎mm/pgtable-generic.c‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,30 @@
1010
#include <asm/tlb.h>
1111
#include <asm-generic/pgtable.h>
1212

13+
/*
14+
* If a p?d_bad entry is found while walking page tables, report
15+
* the error, before resetting entry to p?d_none. Usually (but
16+
* very seldom) called out from the p?d_none_or_clear_bad macros.
17+
*/
18+
19+
void pgd_clear_bad(pgd_t *pgd)
20+
{
21+
pgd_ERROR(*pgd);
22+
pgd_clear(pgd);
23+
}
24+
25+
void pud_clear_bad(pud_t *pud)
26+
{
27+
pud_ERROR(*pud);
28+
pud_clear(pud);
29+
}
30+
31+
void pmd_clear_bad(pmd_t *pmd)
32+
{
33+
pmd_ERROR(*pmd);
34+
pmd_clear(pmd);
35+
}
36+
1337
#ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
1438
/*
1539
* Only sets the access flags (dirty, accessed), as well as write

0 commit comments

Comments
 (0)