diff options
author | Michal Hocko <mhocko@suse.com> | 2016-06-24 17:49:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-06-24 20:23:52 -0400 |
commit | 2379a23e34b58520dfc8f4909f116a08393138e4 (patch) | |
tree | c75c83a3a70479525083511e26fd7818353a76ce | |
parent | a4135b93898fe38ea4136c6b03b29b746e08c83a (diff) |
powerpc: get rid of superfluous __GFP_REPEAT
__GFP_REPEAT has a rather weak semantic but since it has been introduced
around 2.6.12 it has been ignored for low order allocations.
{pud,pmd}_alloc_one are allocating from {PGT,PUD}_CACHE initialized in
pgtable_cache_init which doesn't have larger than sizeof(void *) << 12
size and that fits into !costly allocation request size.
PGALLOC_GFP is used only in radix__pgd_alloc which uses either order-0
or order-4 requests. The first one doesn't need the flag while the
second does. Drop __GFP_REPEAT from PGALLOC_GFP and add it for the
order-4 one.
This means that this flag has never been actually useful here because it
has always been used only for PAGE_ALLOC_COSTLY requests.
Link: http://lkml.kernel.org/r/1464599699-30131-12-git-send-email-mhocko@kernel.org
Signed-off-by: Michal Hocko <mhocko@suse.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/powerpc/include/asm/book3s/64/pgalloc.h | 10 | ||||
-rw-r--r-- | arch/powerpc/include/asm/nohash/64/pgalloc.h | 6 | ||||
-rw-r--r-- | arch/powerpc/mm/hugetlbpage.c | 2 |
3 files changed, 7 insertions, 11 deletions
diff --git a/arch/powerpc/include/asm/book3s/64/pgalloc.h b/arch/powerpc/include/asm/book3s/64/pgalloc.h index 049b80359db6..d14fcf82c00c 100644 --- a/arch/powerpc/include/asm/book3s/64/pgalloc.h +++ b/arch/powerpc/include/asm/book3s/64/pgalloc.h | |||
@@ -41,7 +41,7 @@ extern struct kmem_cache *pgtable_cache[]; | |||
41 | pgtable_cache[(shift) - 1]; \ | 41 | pgtable_cache[(shift) - 1]; \ |
42 | }) | 42 | }) |
43 | 43 | ||
44 | #define PGALLOC_GFP GFP_KERNEL | __GFP_NOTRACK | __GFP_REPEAT | __GFP_ZERO | 44 | #define PGALLOC_GFP GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO |
45 | 45 | ||
46 | extern pte_t *pte_fragment_alloc(struct mm_struct *, unsigned long, int); | 46 | extern pte_t *pte_fragment_alloc(struct mm_struct *, unsigned long, int); |
47 | extern void pte_fragment_free(unsigned long *, int); | 47 | extern void pte_fragment_free(unsigned long *, int); |
@@ -56,7 +56,7 @@ static inline pgd_t *radix__pgd_alloc(struct mm_struct *mm) | |||
56 | return (pgd_t *)__get_free_page(PGALLOC_GFP); | 56 | return (pgd_t *)__get_free_page(PGALLOC_GFP); |
57 | #else | 57 | #else |
58 | struct page *page; | 58 | struct page *page; |
59 | page = alloc_pages(PGALLOC_GFP, 4); | 59 | page = alloc_pages(PGALLOC_GFP | __GFP_REPEAT, 4); |
60 | if (!page) | 60 | if (!page) |
61 | return NULL; | 61 | return NULL; |
62 | return (pgd_t *) page_address(page); | 62 | return (pgd_t *) page_address(page); |
@@ -93,8 +93,7 @@ static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pud_t *pud) | |||
93 | 93 | ||
94 | static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) | 94 | static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) |
95 | { | 95 | { |
96 | return kmem_cache_alloc(PGT_CACHE(PUD_INDEX_SIZE), | 96 | return kmem_cache_alloc(PGT_CACHE(PUD_INDEX_SIZE), GFP_KERNEL); |
97 | GFP_KERNEL|__GFP_REPEAT); | ||
98 | } | 97 | } |
99 | 98 | ||
100 | static inline void pud_free(struct mm_struct *mm, pud_t *pud) | 99 | static inline void pud_free(struct mm_struct *mm, pud_t *pud) |
@@ -115,8 +114,7 @@ static inline void __pud_free_tlb(struct mmu_gather *tlb, pud_t *pud, | |||
115 | 114 | ||
116 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) | 115 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) |
117 | { | 116 | { |
118 | return kmem_cache_alloc(PGT_CACHE(PMD_CACHE_INDEX), | 117 | return kmem_cache_alloc(PGT_CACHE(PMD_CACHE_INDEX), GFP_KERNEL); |
119 | GFP_KERNEL|__GFP_REPEAT); | ||
120 | } | 118 | } |
121 | 119 | ||
122 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) | 120 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
diff --git a/arch/powerpc/include/asm/nohash/64/pgalloc.h b/arch/powerpc/include/asm/nohash/64/pgalloc.h index 8a8a7d991249..897d2e1c8a9b 100644 --- a/arch/powerpc/include/asm/nohash/64/pgalloc.h +++ b/arch/powerpc/include/asm/nohash/64/pgalloc.h | |||
@@ -57,8 +57,7 @@ static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) | |||
57 | 57 | ||
58 | static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) | 58 | static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) |
59 | { | 59 | { |
60 | return kmem_cache_alloc(PGT_CACHE(PUD_INDEX_SIZE), | 60 | return kmem_cache_alloc(PGT_CACHE(PUD_INDEX_SIZE), GFP_KERNEL); |
61 | GFP_KERNEL|__GFP_REPEAT); | ||
62 | } | 61 | } |
63 | 62 | ||
64 | static inline void pud_free(struct mm_struct *mm, pud_t *pud) | 63 | static inline void pud_free(struct mm_struct *mm, pud_t *pud) |
@@ -190,8 +189,7 @@ static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, | |||
190 | 189 | ||
191 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) | 190 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) |
192 | { | 191 | { |
193 | return kmem_cache_alloc(PGT_CACHE(PMD_CACHE_INDEX), | 192 | return kmem_cache_alloc(PGT_CACHE(PMD_CACHE_INDEX), GFP_KERNEL); |
194 | GFP_KERNEL|__GFP_REPEAT); | ||
195 | } | 193 | } |
196 | 194 | ||
197 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) | 195 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c index 5aac1a3f86cd..119d18611500 100644 --- a/arch/powerpc/mm/hugetlbpage.c +++ b/arch/powerpc/mm/hugetlbpage.c | |||
@@ -73,7 +73,7 @@ static int __hugepte_alloc(struct mm_struct *mm, hugepd_t *hpdp, | |||
73 | cachep = PGT_CACHE(pdshift - pshift); | 73 | cachep = PGT_CACHE(pdshift - pshift); |
74 | #endif | 74 | #endif |
75 | 75 | ||
76 | new = kmem_cache_zalloc(cachep, GFP_KERNEL|__GFP_REPEAT); | 76 | new = kmem_cache_zalloc(cachep, GFP_KERNEL); |
77 | 77 | ||
78 | BUG_ON(pshift > HUGEPD_SHIFT_MASK); | 78 | BUG_ON(pshift > HUGEPD_SHIFT_MASK); |
79 | BUG_ON((unsigned long)new & HUGEPD_SHIFT_MASK); | 79 | BUG_ON((unsigned long)new & HUGEPD_SHIFT_MASK); |