diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-06-24 22:08:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-06-24 22:08:33 -0400 |
commit | 086e3eb65e3b04d7186f5e527aa6fc375dd5495c (patch) | |
tree | 7fe649363b52bbc00c875ce30b90dbfa1afb71e6 | |
parent | aebe9bb85e6358dc85f81533b14f5c2dfe14c8b4 (diff) | |
parent | 0fd5ed8d897cffdc74903931bd7fcc9d8d154460 (diff) |
Merge branch 'akpm' (patches from Andrew)
Merge misc fixes from Andrew Morton:
"Two weeks worth of fixes here"
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (41 commits)
init/main.c: fix initcall_blacklisted on ia64, ppc64 and parisc64
autofs: don't get stuck in a loop if vfs_write() returns an error
mm/page_owner: avoid null pointer dereference
tools/vm/slabinfo: fix spelling mistake: "Ocurrences" -> "Occurrences"
fs/nilfs2: fix potential underflow in call to crc32_le
oom, suspend: fix oom_reaper vs. oom_killer_disable race
ocfs2: disable BUG assertions in reading blocks
mm, compaction: abort free scanner if split fails
mm: prevent KASAN false positives in kmemleak
mm/hugetlb: clear compound_mapcount when freeing gigantic pages
mm/swap.c: flush lru pvecs on compound page arrival
memcg: css_alloc should return an ERR_PTR value on error
memcg: mem_cgroup_migrate() may be called with irq disabled
hugetlb: fix nr_pmds accounting with shared page tables
Revert "mm: disable fault around on emulated access bit architecture"
Revert "mm: make faultaround produce old ptes"
mailmap: add Boris Brezillon's email
mailmap: add Antoine Tenart's email
mm, sl[au]b: add __GFP_ATOMIC to the GFP reclaim mask
mm: mempool: kasan: don't poot mempool objects in quarantine
...
67 files changed, 178 insertions, 207 deletions
@@ -21,6 +21,7 @@ Andrey Ryabinin <ryabinin.a.a@gmail.com> <a.ryabinin@samsung.com> | |||
21 | Andrew Morton <akpm@linux-foundation.org> | 21 | Andrew Morton <akpm@linux-foundation.org> |
22 | Andrew Vasquez <andrew.vasquez@qlogic.com> | 22 | Andrew Vasquez <andrew.vasquez@qlogic.com> |
23 | Andy Adamson <andros@citi.umich.edu> | 23 | Andy Adamson <andros@citi.umich.edu> |
24 | Antoine Tenart <antoine.tenart@free-electrons.com> | ||
24 | Antonio Ospite <ao2@ao2.it> <ao2@amarulasolutions.com> | 25 | Antonio Ospite <ao2@ao2.it> <ao2@amarulasolutions.com> |
25 | Archit Taneja <archit@ti.com> | 26 | Archit Taneja <archit@ti.com> |
26 | Arnaud Patard <arnaud.patard@rtp-net.org> | 27 | Arnaud Patard <arnaud.patard@rtp-net.org> |
@@ -30,6 +31,9 @@ Axel Lin <axel.lin@gmail.com> | |||
30 | Ben Gardner <bgardner@wabtec.com> | 31 | Ben Gardner <bgardner@wabtec.com> |
31 | Ben M Cahill <ben.m.cahill@intel.com> | 32 | Ben M Cahill <ben.m.cahill@intel.com> |
32 | Björn Steinbrink <B.Steinbrink@gmx.de> | 33 | Björn Steinbrink <B.Steinbrink@gmx.de> |
34 | Boris Brezillon <boris.brezillon@free-electrons.com> | ||
35 | Boris Brezillon <boris.brezillon@free-electrons.com> <b.brezillon.dev@gmail.com> | ||
36 | Boris Brezillon <boris.brezillon@free-electrons.com> <b.brezillon@overkiz.com> | ||
33 | Brian Avery <b.avery@hp.com> | 37 | Brian Avery <b.avery@hp.com> |
34 | Brian King <brking@us.ibm.com> | 38 | Brian King <brking@us.ibm.com> |
35 | Christoph Hellwig <hch@lst.de> | 39 | Christoph Hellwig <hch@lst.de> |
diff --git a/MAINTAINERS b/MAINTAINERS index e1b090f86e0d..952fd2aba7b7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -2776,9 +2776,9 @@ F: include/net/caif/ | |||
2776 | F: net/caif/ | 2776 | F: net/caif/ |
2777 | 2777 | ||
2778 | CALGARY x86-64 IOMMU | 2778 | CALGARY x86-64 IOMMU |
2779 | M: Muli Ben-Yehuda <muli@il.ibm.com> | 2779 | M: Muli Ben-Yehuda <mulix@mulix.org> |
2780 | M: "Jon D. Mason" <jdmason@kudzu.us> | 2780 | M: Jon Mason <jdmason@kudzu.us> |
2781 | L: discuss@x86-64.org | 2781 | L: iommu@lists.linux-foundation.org |
2782 | S: Maintained | 2782 | S: Maintained |
2783 | F: arch/x86/kernel/pci-calgary_64.c | 2783 | F: arch/x86/kernel/pci-calgary_64.c |
2784 | F: arch/x86/kernel/tce_64.c | 2784 | F: arch/x86/kernel/tce_64.c |
diff --git a/arch/alpha/include/asm/pgalloc.h b/arch/alpha/include/asm/pgalloc.h index aab14a019c20..c2ebb6f36c9d 100644 --- a/arch/alpha/include/asm/pgalloc.h +++ b/arch/alpha/include/asm/pgalloc.h | |||
@@ -40,7 +40,7 @@ pgd_free(struct mm_struct *mm, pgd_t *pgd) | |||
40 | static inline pmd_t * | 40 | static inline pmd_t * |
41 | pmd_alloc_one(struct mm_struct *mm, unsigned long address) | 41 | pmd_alloc_one(struct mm_struct *mm, unsigned long address) |
42 | { | 42 | { |
43 | pmd_t *ret = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); | 43 | pmd_t *ret = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO); |
44 | return ret; | 44 | return ret; |
45 | } | 45 | } |
46 | 46 | ||
@@ -53,7 +53,7 @@ pmd_free(struct mm_struct *mm, pmd_t *pmd) | |||
53 | static inline pte_t * | 53 | static inline pte_t * |
54 | pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) | 54 | pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) |
55 | { | 55 | { |
56 | pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); | 56 | pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO); |
57 | return pte; | 57 | return pte; |
58 | } | 58 | } |
59 | 59 | ||
diff --git a/arch/arc/include/asm/pgalloc.h b/arch/arc/include/asm/pgalloc.h index 86ed671286df..3749234b7419 100644 --- a/arch/arc/include/asm/pgalloc.h +++ b/arch/arc/include/asm/pgalloc.h | |||
@@ -95,7 +95,7 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | |||
95 | { | 95 | { |
96 | pte_t *pte; | 96 | pte_t *pte; |
97 | 97 | ||
98 | pte = (pte_t *) __get_free_pages(GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO, | 98 | pte = (pte_t *) __get_free_pages(GFP_KERNEL | __GFP_ZERO, |
99 | __get_order_pte()); | 99 | __get_order_pte()); |
100 | 100 | ||
101 | return pte; | 101 | return pte; |
@@ -107,7 +107,7 @@ pte_alloc_one(struct mm_struct *mm, unsigned long address) | |||
107 | pgtable_t pte_pg; | 107 | pgtable_t pte_pg; |
108 | struct page *page; | 108 | struct page *page; |
109 | 109 | ||
110 | pte_pg = (pgtable_t)__get_free_pages(GFP_KERNEL | __GFP_REPEAT, __get_order_pte()); | 110 | pte_pg = (pgtable_t)__get_free_pages(GFP_KERNEL, __get_order_pte()); |
111 | if (!pte_pg) | 111 | if (!pte_pg) |
112 | return 0; | 112 | return 0; |
113 | memzero((void *)pte_pg, PTRS_PER_PTE * sizeof(pte_t)); | 113 | memzero((void *)pte_pg, PTRS_PER_PTE * sizeof(pte_t)); |
diff --git a/arch/arm/include/asm/pgalloc.h b/arch/arm/include/asm/pgalloc.h index 19cfab526d13..20febb368844 100644 --- a/arch/arm/include/asm/pgalloc.h +++ b/arch/arm/include/asm/pgalloc.h | |||
@@ -29,7 +29,7 @@ | |||
29 | 29 | ||
30 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) | 30 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) |
31 | { | 31 | { |
32 | return (pmd_t *)get_zeroed_page(GFP_KERNEL | __GFP_REPEAT); | 32 | return (pmd_t *)get_zeroed_page(GFP_KERNEL); |
33 | } | 33 | } |
34 | 34 | ||
35 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) | 35 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
diff --git a/arch/arm64/include/asm/pgalloc.h b/arch/arm64/include/asm/pgalloc.h index ff98585d085a..d25f4f137c2a 100644 --- a/arch/arm64/include/asm/pgalloc.h +++ b/arch/arm64/include/asm/pgalloc.h | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #define check_pgt_cache() do { } while (0) | 27 | #define check_pgt_cache() do { } while (0) |
28 | 28 | ||
29 | #define PGALLOC_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_REPEAT | __GFP_ZERO) | 29 | #define PGALLOC_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO) |
30 | #define PGD_SIZE (PTRS_PER_PGD * sizeof(pgd_t)) | 30 | #define PGD_SIZE (PTRS_PER_PGD * sizeof(pgd_t)) |
31 | 31 | ||
32 | #if CONFIG_PGTABLE_LEVELS > 2 | 32 | #if CONFIG_PGTABLE_LEVELS > 2 |
diff --git a/arch/avr32/include/asm/pgalloc.h b/arch/avr32/include/asm/pgalloc.h index 1aba19d68c5e..db039cb368be 100644 --- a/arch/avr32/include/asm/pgalloc.h +++ b/arch/avr32/include/asm/pgalloc.h | |||
@@ -43,7 +43,7 @@ static inline void pgd_ctor(void *x) | |||
43 | */ | 43 | */ |
44 | static inline pgd_t *pgd_alloc(struct mm_struct *mm) | 44 | static inline pgd_t *pgd_alloc(struct mm_struct *mm) |
45 | { | 45 | { |
46 | return quicklist_alloc(QUICK_PGD, GFP_KERNEL | __GFP_REPEAT, pgd_ctor); | 46 | return quicklist_alloc(QUICK_PGD, GFP_KERNEL, pgd_ctor); |
47 | } | 47 | } |
48 | 48 | ||
49 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) | 49 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
@@ -54,7 +54,7 @@ static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) | |||
54 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | 54 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, |
55 | unsigned long address) | 55 | unsigned long address) |
56 | { | 56 | { |
57 | return quicklist_alloc(QUICK_PT, GFP_KERNEL | __GFP_REPEAT, NULL); | 57 | return quicklist_alloc(QUICK_PT, GFP_KERNEL, NULL); |
58 | } | 58 | } |
59 | 59 | ||
60 | static inline pgtable_t pte_alloc_one(struct mm_struct *mm, | 60 | static inline pgtable_t pte_alloc_one(struct mm_struct *mm, |
@@ -63,7 +63,7 @@ static inline pgtable_t pte_alloc_one(struct mm_struct *mm, | |||
63 | struct page *page; | 63 | struct page *page; |
64 | void *pg; | 64 | void *pg; |
65 | 65 | ||
66 | pg = quicklist_alloc(QUICK_PT, GFP_KERNEL | __GFP_REPEAT, NULL); | 66 | pg = quicklist_alloc(QUICK_PT, GFP_KERNEL, NULL); |
67 | if (!pg) | 67 | if (!pg) |
68 | return NULL; | 68 | return NULL; |
69 | 69 | ||
diff --git a/arch/cris/include/asm/pgalloc.h b/arch/cris/include/asm/pgalloc.h index 235ece437ddd..42f1affb9c2d 100644 --- a/arch/cris/include/asm/pgalloc.h +++ b/arch/cris/include/asm/pgalloc.h | |||
@@ -24,14 +24,14 @@ static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) | |||
24 | 24 | ||
25 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) | 25 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) |
26 | { | 26 | { |
27 | pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); | 27 | pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO); |
28 | return pte; | 28 | return pte; |
29 | } | 29 | } |
30 | 30 | ||
31 | static inline pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address) | 31 | static inline pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address) |
32 | { | 32 | { |
33 | struct page *pte; | 33 | struct page *pte; |
34 | pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0); | 34 | pte = alloc_pages(GFP_KERNEL|__GFP_ZERO, 0); |
35 | if (!pte) | 35 | if (!pte) |
36 | return NULL; | 36 | return NULL; |
37 | if (!pgtable_page_ctor(pte)) { | 37 | if (!pgtable_page_ctor(pte)) { |
diff --git a/arch/frv/mm/pgalloc.c b/arch/frv/mm/pgalloc.c index 41907d25ed38..c9ed14f6c67d 100644 --- a/arch/frv/mm/pgalloc.c +++ b/arch/frv/mm/pgalloc.c | |||
@@ -22,7 +22,7 @@ pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((aligned(PAGE_SIZE))); | |||
22 | 22 | ||
23 | pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) | 23 | pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) |
24 | { | 24 | { |
25 | pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); | 25 | pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL); |
26 | if (pte) | 26 | if (pte) |
27 | clear_page(pte); | 27 | clear_page(pte); |
28 | return pte; | 28 | return pte; |
@@ -33,9 +33,9 @@ pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address) | |||
33 | struct page *page; | 33 | struct page *page; |
34 | 34 | ||
35 | #ifdef CONFIG_HIGHPTE | 35 | #ifdef CONFIG_HIGHPTE |
36 | page = alloc_pages(GFP_KERNEL|__GFP_HIGHMEM|__GFP_REPEAT, 0); | 36 | page = alloc_pages(GFP_KERNEL|__GFP_HIGHMEM, 0); |
37 | #else | 37 | #else |
38 | page = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); | 38 | page = alloc_pages(GFP_KERNEL, 0); |
39 | #endif | 39 | #endif |
40 | if (!page) | 40 | if (!page) |
41 | return NULL; | 41 | return NULL; |
diff --git a/arch/hexagon/include/asm/pgalloc.h b/arch/hexagon/include/asm/pgalloc.h index 77da3b0ae3c2..eeebf862c46c 100644 --- a/arch/hexagon/include/asm/pgalloc.h +++ b/arch/hexagon/include/asm/pgalloc.h | |||
@@ -64,7 +64,7 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, | |||
64 | { | 64 | { |
65 | struct page *pte; | 65 | struct page *pte; |
66 | 66 | ||
67 | pte = alloc_page(GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO); | 67 | pte = alloc_page(GFP_KERNEL | __GFP_ZERO); |
68 | if (!pte) | 68 | if (!pte) |
69 | return NULL; | 69 | return NULL; |
70 | if (!pgtable_page_ctor(pte)) { | 70 | if (!pgtable_page_ctor(pte)) { |
@@ -78,7 +78,7 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, | |||
78 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | 78 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, |
79 | unsigned long address) | 79 | unsigned long address) |
80 | { | 80 | { |
81 | gfp_t flags = GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO; | 81 | gfp_t flags = GFP_KERNEL | __GFP_ZERO; |
82 | return (pte_t *) __get_free_page(flags); | 82 | return (pte_t *) __get_free_page(flags); |
83 | } | 83 | } |
84 | 84 | ||
diff --git a/arch/m68k/include/asm/mcf_pgalloc.h b/arch/m68k/include/asm/mcf_pgalloc.h index f9924fbcfe42..fb95aed5f428 100644 --- a/arch/m68k/include/asm/mcf_pgalloc.h +++ b/arch/m68k/include/asm/mcf_pgalloc.h | |||
@@ -14,7 +14,7 @@ extern const char bad_pmd_string[]; | |||
14 | extern inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | 14 | extern inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, |
15 | unsigned long address) | 15 | unsigned long address) |
16 | { | 16 | { |
17 | unsigned long page = __get_free_page(GFP_DMA|__GFP_REPEAT); | 17 | unsigned long page = __get_free_page(GFP_DMA); |
18 | 18 | ||
19 | if (!page) | 19 | if (!page) |
20 | return NULL; | 20 | return NULL; |
@@ -51,7 +51,7 @@ static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t page, | |||
51 | static inline struct page *pte_alloc_one(struct mm_struct *mm, | 51 | static inline struct page *pte_alloc_one(struct mm_struct *mm, |
52 | unsigned long address) | 52 | unsigned long address) |
53 | { | 53 | { |
54 | struct page *page = alloc_pages(GFP_DMA|__GFP_REPEAT, 0); | 54 | struct page *page = alloc_pages(GFP_DMA, 0); |
55 | pte_t *pte; | 55 | pte_t *pte; |
56 | 56 | ||
57 | if (!page) | 57 | if (!page) |
diff --git a/arch/m68k/include/asm/motorola_pgalloc.h b/arch/m68k/include/asm/motorola_pgalloc.h index 24bcba496c75..c895b987202c 100644 --- a/arch/m68k/include/asm/motorola_pgalloc.h +++ b/arch/m68k/include/asm/motorola_pgalloc.h | |||
@@ -11,7 +11,7 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long ad | |||
11 | { | 11 | { |
12 | pte_t *pte; | 12 | pte_t *pte; |
13 | 13 | ||
14 | pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); | 14 | pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO); |
15 | if (pte) { | 15 | if (pte) { |
16 | __flush_page_to_ram(pte); | 16 | __flush_page_to_ram(pte); |
17 | flush_tlb_kernel_page(pte); | 17 | flush_tlb_kernel_page(pte); |
@@ -32,7 +32,7 @@ static inline pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long addres | |||
32 | struct page *page; | 32 | struct page *page; |
33 | pte_t *pte; | 33 | pte_t *pte; |
34 | 34 | ||
35 | page = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0); | 35 | page = alloc_pages(GFP_KERNEL|__GFP_ZERO, 0); |
36 | if(!page) | 36 | if(!page) |
37 | return NULL; | 37 | return NULL; |
38 | if (!pgtable_page_ctor(page)) { | 38 | if (!pgtable_page_ctor(page)) { |
diff --git a/arch/m68k/include/asm/sun3_pgalloc.h b/arch/m68k/include/asm/sun3_pgalloc.h index 0931388de47f..1901f61f926f 100644 --- a/arch/m68k/include/asm/sun3_pgalloc.h +++ b/arch/m68k/include/asm/sun3_pgalloc.h | |||
@@ -37,7 +37,7 @@ do { \ | |||
37 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | 37 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, |
38 | unsigned long address) | 38 | unsigned long address) |
39 | { | 39 | { |
40 | unsigned long page = __get_free_page(GFP_KERNEL|__GFP_REPEAT); | 40 | unsigned long page = __get_free_page(GFP_KERNEL); |
41 | 41 | ||
42 | if (!page) | 42 | if (!page) |
43 | return NULL; | 43 | return NULL; |
@@ -49,7 +49,7 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | |||
49 | static inline pgtable_t pte_alloc_one(struct mm_struct *mm, | 49 | static inline pgtable_t pte_alloc_one(struct mm_struct *mm, |
50 | unsigned long address) | 50 | unsigned long address) |
51 | { | 51 | { |
52 | struct page *page = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); | 52 | struct page *page = alloc_pages(GFP_KERNEL, 0); |
53 | 53 | ||
54 | if (page == NULL) | 54 | if (page == NULL) |
55 | return NULL; | 55 | return NULL; |
diff --git a/arch/metag/include/asm/pgalloc.h b/arch/metag/include/asm/pgalloc.h index 3104df0a4822..c2caa1ee4360 100644 --- a/arch/metag/include/asm/pgalloc.h +++ b/arch/metag/include/asm/pgalloc.h | |||
@@ -42,8 +42,7 @@ static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) | |||
42 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | 42 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, |
43 | unsigned long address) | 43 | unsigned long address) |
44 | { | 44 | { |
45 | pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL | __GFP_REPEAT | | 45 | pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO); |
46 | __GFP_ZERO); | ||
47 | return pte; | 46 | return pte; |
48 | } | 47 | } |
49 | 48 | ||
@@ -51,7 +50,7 @@ static inline pgtable_t pte_alloc_one(struct mm_struct *mm, | |||
51 | unsigned long address) | 50 | unsigned long address) |
52 | { | 51 | { |
53 | struct page *pte; | 52 | struct page *pte; |
54 | pte = alloc_pages(GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO, 0); | 53 | pte = alloc_pages(GFP_KERNEL | __GFP_ZERO, 0); |
55 | if (!pte) | 54 | if (!pte) |
56 | return NULL; | 55 | return NULL; |
57 | if (!pgtable_page_ctor(pte)) { | 56 | if (!pgtable_page_ctor(pte)) { |
diff --git a/arch/microblaze/include/asm/pgalloc.h b/arch/microblaze/include/asm/pgalloc.h index 61436d69775c..7c89390c0c13 100644 --- a/arch/microblaze/include/asm/pgalloc.h +++ b/arch/microblaze/include/asm/pgalloc.h | |||
@@ -116,9 +116,9 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, | |||
116 | struct page *ptepage; | 116 | struct page *ptepage; |
117 | 117 | ||
118 | #ifdef CONFIG_HIGHPTE | 118 | #ifdef CONFIG_HIGHPTE |
119 | int flags = GFP_KERNEL | __GFP_HIGHMEM | __GFP_REPEAT; | 119 | int flags = GFP_KERNEL | __GFP_HIGHMEM; |
120 | #else | 120 | #else |
121 | int flags = GFP_KERNEL | __GFP_REPEAT; | 121 | int flags = GFP_KERNEL; |
122 | #endif | 122 | #endif |
123 | 123 | ||
124 | ptepage = alloc_pages(flags, 0); | 124 | ptepage = alloc_pages(flags, 0); |
diff --git a/arch/microblaze/mm/pgtable.c b/arch/microblaze/mm/pgtable.c index 4f4520e779a5..eb99fcc76088 100644 --- a/arch/microblaze/mm/pgtable.c +++ b/arch/microblaze/mm/pgtable.c | |||
@@ -239,8 +239,7 @@ __init_refok pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | |||
239 | { | 239 | { |
240 | pte_t *pte; | 240 | pte_t *pte; |
241 | if (mem_init_done) { | 241 | if (mem_init_done) { |
242 | pte = (pte_t *)__get_free_page(GFP_KERNEL | | 242 | pte = (pte_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO); |
243 | __GFP_REPEAT | __GFP_ZERO); | ||
244 | } else { | 243 | } else { |
245 | pte = (pte_t *)early_get_page(); | 244 | pte = (pte_t *)early_get_page(); |
246 | if (pte) | 245 | if (pte) |
diff --git a/arch/mips/include/asm/pgalloc.h b/arch/mips/include/asm/pgalloc.h index b336037e8768..93c079a1cfc8 100644 --- a/arch/mips/include/asm/pgalloc.h +++ b/arch/mips/include/asm/pgalloc.h | |||
@@ -69,7 +69,7 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | |||
69 | { | 69 | { |
70 | pte_t *pte; | 70 | pte_t *pte; |
71 | 71 | ||
72 | pte = (pte_t *) __get_free_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, PTE_ORDER); | 72 | pte = (pte_t *) __get_free_pages(GFP_KERNEL|__GFP_ZERO, PTE_ORDER); |
73 | 73 | ||
74 | return pte; | 74 | return pte; |
75 | } | 75 | } |
@@ -79,7 +79,7 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, | |||
79 | { | 79 | { |
80 | struct page *pte; | 80 | struct page *pte; |
81 | 81 | ||
82 | pte = alloc_pages(GFP_KERNEL | __GFP_REPEAT, PTE_ORDER); | 82 | pte = alloc_pages(GFP_KERNEL, PTE_ORDER); |
83 | if (!pte) | 83 | if (!pte) |
84 | return NULL; | 84 | return NULL; |
85 | clear_highpage(pte); | 85 | clear_highpage(pte); |
@@ -113,7 +113,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) | |||
113 | { | 113 | { |
114 | pmd_t *pmd; | 114 | pmd_t *pmd; |
115 | 115 | ||
116 | pmd = (pmd_t *) __get_free_pages(GFP_KERNEL|__GFP_REPEAT, PMD_ORDER); | 116 | pmd = (pmd_t *) __get_free_pages(GFP_KERNEL, PMD_ORDER); |
117 | if (pmd) | 117 | if (pmd) |
118 | pmd_init((unsigned long)pmd, (unsigned long)invalid_pte_table); | 118 | pmd_init((unsigned long)pmd, (unsigned long)invalid_pte_table); |
119 | return pmd; | 119 | return pmd; |
diff --git a/arch/mn10300/mm/pgtable.c b/arch/mn10300/mm/pgtable.c index e77a7c728081..9577cf768875 100644 --- a/arch/mn10300/mm/pgtable.c +++ b/arch/mn10300/mm/pgtable.c | |||
@@ -63,7 +63,7 @@ void set_pmd_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags) | |||
63 | 63 | ||
64 | pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) | 64 | pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) |
65 | { | 65 | { |
66 | pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); | 66 | pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL); |
67 | if (pte) | 67 | if (pte) |
68 | clear_page(pte); | 68 | clear_page(pte); |
69 | return pte; | 69 | return pte; |
@@ -74,9 +74,9 @@ struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) | |||
74 | struct page *pte; | 74 | struct page *pte; |
75 | 75 | ||
76 | #ifdef CONFIG_HIGHPTE | 76 | #ifdef CONFIG_HIGHPTE |
77 | pte = alloc_pages(GFP_KERNEL|__GFP_HIGHMEM|__GFP_REPEAT, 0); | 77 | pte = alloc_pages(GFP_KERNEL|__GFP_HIGHMEM, 0); |
78 | #else | 78 | #else |
79 | pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); | 79 | pte = alloc_pages(GFP_KERNEL, 0); |
80 | #endif | 80 | #endif |
81 | if (!pte) | 81 | if (!pte) |
82 | return NULL; | 82 | return NULL; |
diff --git a/arch/nios2/include/asm/pgalloc.h b/arch/nios2/include/asm/pgalloc.h index 6e2985e0a7b9..bb47d08c8ef7 100644 --- a/arch/nios2/include/asm/pgalloc.h +++ b/arch/nios2/include/asm/pgalloc.h | |||
@@ -42,8 +42,7 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | |||
42 | { | 42 | { |
43 | pte_t *pte; | 43 | pte_t *pte; |
44 | 44 | ||
45 | pte = (pte_t *) __get_free_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, | 45 | pte = (pte_t *) __get_free_pages(GFP_KERNEL|__GFP_ZERO, PTE_ORDER); |
46 | PTE_ORDER); | ||
47 | 46 | ||
48 | return pte; | 47 | return pte; |
49 | } | 48 | } |
@@ -53,7 +52,7 @@ static inline pgtable_t pte_alloc_one(struct mm_struct *mm, | |||
53 | { | 52 | { |
54 | struct page *pte; | 53 | struct page *pte; |
55 | 54 | ||
56 | pte = alloc_pages(GFP_KERNEL | __GFP_REPEAT, PTE_ORDER); | 55 | pte = alloc_pages(GFP_KERNEL, PTE_ORDER); |
57 | if (pte) { | 56 | if (pte) { |
58 | if (!pgtable_page_ctor(pte)) { | 57 | if (!pgtable_page_ctor(pte)) { |
59 | __free_page(pte); | 58 | __free_page(pte); |
diff --git a/arch/openrisc/include/asm/pgalloc.h b/arch/openrisc/include/asm/pgalloc.h index 21484e5b9e9a..87eebd185089 100644 --- a/arch/openrisc/include/asm/pgalloc.h +++ b/arch/openrisc/include/asm/pgalloc.h | |||
@@ -77,7 +77,7 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, | |||
77 | unsigned long address) | 77 | unsigned long address) |
78 | { | 78 | { |
79 | struct page *pte; | 79 | struct page *pte; |
80 | pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT, 0); | 80 | pte = alloc_pages(GFP_KERNEL, 0); |
81 | if (!pte) | 81 | if (!pte) |
82 | return NULL; | 82 | return NULL; |
83 | clear_page(page_address(pte)); | 83 | clear_page(page_address(pte)); |
diff --git a/arch/openrisc/mm/ioremap.c b/arch/openrisc/mm/ioremap.c index 62b08ef392be..5b2a95116e8f 100644 --- a/arch/openrisc/mm/ioremap.c +++ b/arch/openrisc/mm/ioremap.c | |||
@@ -122,7 +122,7 @@ pte_t __init_refok *pte_alloc_one_kernel(struct mm_struct *mm, | |||
122 | pte_t *pte; | 122 | pte_t *pte; |
123 | 123 | ||
124 | if (likely(mem_init_done)) { | 124 | if (likely(mem_init_done)) { |
125 | pte = (pte_t *) __get_free_page(GFP_KERNEL | __GFP_REPEAT); | 125 | pte = (pte_t *) __get_free_page(GFP_KERNEL); |
126 | } else { | 126 | } else { |
127 | pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE); | 127 | pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE); |
128 | #if 0 | 128 | #if 0 |
diff --git a/arch/parisc/include/asm/pgalloc.h b/arch/parisc/include/asm/pgalloc.h index f2fd327dce2e..f08dda3f0995 100644 --- a/arch/parisc/include/asm/pgalloc.h +++ b/arch/parisc/include/asm/pgalloc.h | |||
@@ -63,8 +63,7 @@ static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmd) | |||
63 | 63 | ||
64 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) | 64 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) |
65 | { | 65 | { |
66 | pmd_t *pmd = (pmd_t *)__get_free_pages(GFP_KERNEL|__GFP_REPEAT, | 66 | pmd_t *pmd = (pmd_t *)__get_free_pages(GFP_KERNEL, PMD_ORDER); |
67 | PMD_ORDER); | ||
68 | if (pmd) | 67 | if (pmd) |
69 | memset(pmd, 0, PAGE_SIZE<<PMD_ORDER); | 68 | memset(pmd, 0, PAGE_SIZE<<PMD_ORDER); |
70 | return pmd; | 69 | return pmd; |
@@ -124,7 +123,7 @@ pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte) | |||
124 | static inline pgtable_t | 123 | static inline pgtable_t |
125 | pte_alloc_one(struct mm_struct *mm, unsigned long address) | 124 | pte_alloc_one(struct mm_struct *mm, unsigned long address) |
126 | { | 125 | { |
127 | struct page *page = alloc_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); | 126 | struct page *page = alloc_page(GFP_KERNEL|__GFP_ZERO); |
128 | if (!page) | 127 | if (!page) |
129 | return NULL; | 128 | return NULL; |
130 | if (!pgtable_page_ctor(page)) { | 129 | if (!pgtable_page_ctor(page)) { |
@@ -137,7 +136,7 @@ pte_alloc_one(struct mm_struct *mm, unsigned long address) | |||
137 | static inline pte_t * | 136 | static inline pte_t * |
138 | pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr) | 137 | pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr) |
139 | { | 138 | { |
140 | pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); | 139 | pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO); |
141 | return pte; | 140 | return pte; |
142 | } | 141 | } |
143 | 142 | ||
diff --git a/arch/powerpc/include/asm/book3s/64/pgalloc.h b/arch/powerpc/include/asm/book3s/64/pgalloc.h index 488279edb1f0..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) |
@@ -151,7 +149,7 @@ static inline pgtable_t pmd_pgtable(pmd_t pmd) | |||
151 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | 149 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, |
152 | unsigned long address) | 150 | unsigned long address) |
153 | { | 151 | { |
154 | return (pte_t *)__get_free_page(GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO); | 152 | return (pte_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO); |
155 | } | 153 | } |
156 | 154 | ||
157 | static inline pgtable_t pte_alloc_one(struct mm_struct *mm, | 155 | static inline pgtable_t pte_alloc_one(struct mm_struct *mm, |
diff --git a/arch/powerpc/include/asm/nohash/64/pgalloc.h b/arch/powerpc/include/asm/nohash/64/pgalloc.h index 069369f6414b..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) |
@@ -88,7 +87,7 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, | |||
88 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | 87 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, |
89 | unsigned long address) | 88 | unsigned long address) |
90 | { | 89 | { |
91 | return (pte_t *)__get_free_page(GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO); | 90 | return (pte_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO); |
92 | } | 91 | } |
93 | 92 | ||
94 | static inline pgtable_t pte_alloc_one(struct mm_struct *mm, | 93 | static inline pgtable_t pte_alloc_one(struct mm_struct *mm, |
@@ -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); |
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c index bf7bf32b54f8..7f922f557936 100644 --- a/arch/powerpc/mm/pgtable_32.c +++ b/arch/powerpc/mm/pgtable_32.c | |||
@@ -84,7 +84,7 @@ __init_refok pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long add | |||
84 | pte_t *pte; | 84 | pte_t *pte; |
85 | 85 | ||
86 | if (slab_is_available()) { | 86 | if (slab_is_available()) { |
87 | pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); | 87 | pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO); |
88 | } else { | 88 | } else { |
89 | pte = __va(memblock_alloc(PAGE_SIZE, PAGE_SIZE)); | 89 | pte = __va(memblock_alloc(PAGE_SIZE, PAGE_SIZE)); |
90 | if (pte) | 90 | if (pte) |
@@ -97,7 +97,7 @@ pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address) | |||
97 | { | 97 | { |
98 | struct page *ptepage; | 98 | struct page *ptepage; |
99 | 99 | ||
100 | gfp_t flags = GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO; | 100 | gfp_t flags = GFP_KERNEL | __GFP_ZERO; |
101 | 101 | ||
102 | ptepage = alloc_pages(flags, 0); | 102 | ptepage = alloc_pages(flags, 0); |
103 | if (!ptepage) | 103 | if (!ptepage) |
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c index e009e0604a8a..f5e8d4edb808 100644 --- a/arch/powerpc/mm/pgtable_64.c +++ b/arch/powerpc/mm/pgtable_64.c | |||
@@ -350,8 +350,7 @@ static pte_t *get_from_cache(struct mm_struct *mm) | |||
350 | static pte_t *__alloc_for_cache(struct mm_struct *mm, int kernel) | 350 | static pte_t *__alloc_for_cache(struct mm_struct *mm, int kernel) |
351 | { | 351 | { |
352 | void *ret = NULL; | 352 | void *ret = NULL; |
353 | struct page *page = alloc_page(GFP_KERNEL | __GFP_NOTRACK | | 353 | struct page *page = alloc_page(GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO); |
354 | __GFP_REPEAT | __GFP_ZERO); | ||
355 | if (!page) | 354 | if (!page) |
356 | return NULL; | 355 | return NULL; |
357 | if (!kernel && !pgtable_page_ctor(page)) { | 356 | if (!kernel && !pgtable_page_ctor(page)) { |
diff --git a/arch/s390/mm/pgalloc.c b/arch/s390/mm/pgalloc.c index e8b5962ac12a..e2565d2d0c32 100644 --- a/arch/s390/mm/pgalloc.c +++ b/arch/s390/mm/pgalloc.c | |||
@@ -169,7 +169,7 @@ unsigned long *page_table_alloc(struct mm_struct *mm) | |||
169 | return table; | 169 | return table; |
170 | } | 170 | } |
171 | /* Allocate a fresh page */ | 171 | /* Allocate a fresh page */ |
172 | page = alloc_page(GFP_KERNEL|__GFP_REPEAT); | 172 | page = alloc_page(GFP_KERNEL); |
173 | if (!page) | 173 | if (!page) |
174 | return NULL; | 174 | return NULL; |
175 | if (!pgtable_page_ctor(page)) { | 175 | if (!pgtable_page_ctor(page)) { |
diff --git a/arch/score/include/asm/pgalloc.h b/arch/score/include/asm/pgalloc.h index 2e067657db98..49b012d78c1a 100644 --- a/arch/score/include/asm/pgalloc.h +++ b/arch/score/include/asm/pgalloc.h | |||
@@ -42,8 +42,7 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | |||
42 | { | 42 | { |
43 | pte_t *pte; | 43 | pte_t *pte; |
44 | 44 | ||
45 | pte = (pte_t *) __get_free_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, | 45 | pte = (pte_t *) __get_free_pages(GFP_KERNEL|__GFP_ZERO, PTE_ORDER); |
46 | PTE_ORDER); | ||
47 | 46 | ||
48 | return pte; | 47 | return pte; |
49 | } | 48 | } |
@@ -53,7 +52,7 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, | |||
53 | { | 52 | { |
54 | struct page *pte; | 53 | struct page *pte; |
55 | 54 | ||
56 | pte = alloc_pages(GFP_KERNEL | __GFP_REPEAT, PTE_ORDER); | 55 | pte = alloc_pages(GFP_KERNEL, PTE_ORDER); |
57 | if (!pte) | 56 | if (!pte) |
58 | return NULL; | 57 | return NULL; |
59 | clear_highpage(pte); | 58 | clear_highpage(pte); |
diff --git a/arch/sh/include/asm/pgalloc.h b/arch/sh/include/asm/pgalloc.h index a33673b3687d..f3f42c84c40f 100644 --- a/arch/sh/include/asm/pgalloc.h +++ b/arch/sh/include/asm/pgalloc.h | |||
@@ -34,7 +34,7 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, | |||
34 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | 34 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, |
35 | unsigned long address) | 35 | unsigned long address) |
36 | { | 36 | { |
37 | return quicklist_alloc(QUICK_PT, GFP_KERNEL | __GFP_REPEAT, NULL); | 37 | return quicklist_alloc(QUICK_PT, GFP_KERNEL, NULL); |
38 | } | 38 | } |
39 | 39 | ||
40 | static inline pgtable_t pte_alloc_one(struct mm_struct *mm, | 40 | static inline pgtable_t pte_alloc_one(struct mm_struct *mm, |
@@ -43,7 +43,7 @@ static inline pgtable_t pte_alloc_one(struct mm_struct *mm, | |||
43 | struct page *page; | 43 | struct page *page; |
44 | void *pg; | 44 | void *pg; |
45 | 45 | ||
46 | pg = quicklist_alloc(QUICK_PT, GFP_KERNEL | __GFP_REPEAT, NULL); | 46 | pg = quicklist_alloc(QUICK_PT, GFP_KERNEL, NULL); |
47 | if (!pg) | 47 | if (!pg) |
48 | return NULL; | 48 | return NULL; |
49 | page = virt_to_page(pg); | 49 | page = virt_to_page(pg); |
diff --git a/arch/sh/mm/pgtable.c b/arch/sh/mm/pgtable.c index 26e03a1f7ca4..a62bd8696779 100644 --- a/arch/sh/mm/pgtable.c +++ b/arch/sh/mm/pgtable.c | |||
@@ -1,7 +1,7 @@ | |||
1 | #include <linux/mm.h> | 1 | #include <linux/mm.h> |
2 | #include <linux/slab.h> | 2 | #include <linux/slab.h> |
3 | 3 | ||
4 | #define PGALLOC_GFP GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO | 4 | #define PGALLOC_GFP GFP_KERNEL | __GFP_ZERO |
5 | 5 | ||
6 | static struct kmem_cache *pgd_cachep; | 6 | static struct kmem_cache *pgd_cachep; |
7 | #if PAGETABLE_LEVELS > 2 | 7 | #if PAGETABLE_LEVELS > 2 |
diff --git a/arch/sparc/include/asm/pgalloc_64.h b/arch/sparc/include/asm/pgalloc_64.h index 5e3187185b4a..3529f1378cd8 100644 --- a/arch/sparc/include/asm/pgalloc_64.h +++ b/arch/sparc/include/asm/pgalloc_64.h | |||
@@ -41,8 +41,7 @@ static inline void __pud_populate(pud_t *pud, pmd_t *pmd) | |||
41 | 41 | ||
42 | static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) | 42 | static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) |
43 | { | 43 | { |
44 | return kmem_cache_alloc(pgtable_cache, | 44 | return kmem_cache_alloc(pgtable_cache, GFP_KERNEL); |
45 | GFP_KERNEL|__GFP_REPEAT); | ||
46 | } | 45 | } |
47 | 46 | ||
48 | static inline void pud_free(struct mm_struct *mm, pud_t *pud) | 47 | static inline void pud_free(struct mm_struct *mm, pud_t *pud) |
@@ -52,8 +51,7 @@ static inline void pud_free(struct mm_struct *mm, pud_t *pud) | |||
52 | 51 | ||
53 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) | 52 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) |
54 | { | 53 | { |
55 | return kmem_cache_alloc(pgtable_cache, | 54 | return kmem_cache_alloc(pgtable_cache, GFP_KERNEL); |
56 | GFP_KERNEL|__GFP_REPEAT); | ||
57 | } | 55 | } |
58 | 56 | ||
59 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) | 57 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index 14bb0d5ed3c6..aec508e37490 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c | |||
@@ -2704,8 +2704,7 @@ void __flush_tlb_all(void) | |||
2704 | pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | 2704 | pte_t *pte_alloc_one_kernel(struct mm_struct *mm, |
2705 | unsigned long address) | 2705 | unsigned long address) |
2706 | { | 2706 | { |
2707 | struct page *page = alloc_page(GFP_KERNEL | __GFP_NOTRACK | | 2707 | struct page *page = alloc_page(GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO); |
2708 | __GFP_REPEAT | __GFP_ZERO); | ||
2709 | pte_t *pte = NULL; | 2708 | pte_t *pte = NULL; |
2710 | 2709 | ||
2711 | if (page) | 2710 | if (page) |
@@ -2717,8 +2716,7 @@ pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | |||
2717 | pgtable_t pte_alloc_one(struct mm_struct *mm, | 2716 | pgtable_t pte_alloc_one(struct mm_struct *mm, |
2718 | unsigned long address) | 2717 | unsigned long address) |
2719 | { | 2718 | { |
2720 | struct page *page = alloc_page(GFP_KERNEL | __GFP_NOTRACK | | 2719 | struct page *page = alloc_page(GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO); |
2721 | __GFP_REPEAT | __GFP_ZERO); | ||
2722 | if (!page) | 2720 | if (!page) |
2723 | return NULL; | 2721 | return NULL; |
2724 | if (!pgtable_page_ctor(page)) { | 2722 | if (!pgtable_page_ctor(page)) { |
diff --git a/arch/tile/mm/pgtable.c b/arch/tile/mm/pgtable.c index 7bf2491a9c1f..c4d5bf841a7f 100644 --- a/arch/tile/mm/pgtable.c +++ b/arch/tile/mm/pgtable.c | |||
@@ -231,7 +231,7 @@ void pgd_free(struct mm_struct *mm, pgd_t *pgd) | |||
231 | struct page *pgtable_alloc_one(struct mm_struct *mm, unsigned long address, | 231 | struct page *pgtable_alloc_one(struct mm_struct *mm, unsigned long address, |
232 | int order) | 232 | int order) |
233 | { | 233 | { |
234 | gfp_t flags = GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO; | 234 | gfp_t flags = GFP_KERNEL|__GFP_ZERO; |
235 | struct page *p; | 235 | struct page *p; |
236 | int i; | 236 | int i; |
237 | 237 | ||
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index b2a2dff50b4e..e7437ec62710 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c | |||
@@ -204,7 +204,7 @@ pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) | |||
204 | { | 204 | { |
205 | pte_t *pte; | 205 | pte_t *pte; |
206 | 206 | ||
207 | pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); | 207 | pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO); |
208 | return pte; | 208 | return pte; |
209 | } | 209 | } |
210 | 210 | ||
@@ -212,7 +212,7 @@ pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address) | |||
212 | { | 212 | { |
213 | struct page *pte; | 213 | struct page *pte; |
214 | 214 | ||
215 | pte = alloc_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); | 215 | pte = alloc_page(GFP_KERNEL|__GFP_ZERO); |
216 | if (!pte) | 216 | if (!pte) |
217 | return NULL; | 217 | return NULL; |
218 | if (!pgtable_page_ctor(pte)) { | 218 | if (!pgtable_page_ctor(pte)) { |
diff --git a/arch/unicore32/include/asm/pgalloc.h b/arch/unicore32/include/asm/pgalloc.h index 2e02d1356fdf..26775793c204 100644 --- a/arch/unicore32/include/asm/pgalloc.h +++ b/arch/unicore32/include/asm/pgalloc.h | |||
@@ -28,7 +28,7 @@ extern void free_pgd_slow(struct mm_struct *mm, pgd_t *pgd); | |||
28 | #define pgd_alloc(mm) get_pgd_slow(mm) | 28 | #define pgd_alloc(mm) get_pgd_slow(mm) |
29 | #define pgd_free(mm, pgd) free_pgd_slow(mm, pgd) | 29 | #define pgd_free(mm, pgd) free_pgd_slow(mm, pgd) |
30 | 30 | ||
31 | #define PGALLOC_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_REPEAT | __GFP_ZERO) | 31 | #define PGALLOC_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO) |
32 | 32 | ||
33 | /* | 33 | /* |
34 | * Allocate one PTE table. | 34 | * Allocate one PTE table. |
diff --git a/arch/x86/include/asm/pgalloc.h b/arch/x86/include/asm/pgalloc.h index bf7f8b55b0f9..574c23cf761a 100644 --- a/arch/x86/include/asm/pgalloc.h +++ b/arch/x86/include/asm/pgalloc.h | |||
@@ -81,7 +81,7 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, | |||
81 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) | 81 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) |
82 | { | 82 | { |
83 | struct page *page; | 83 | struct page *page; |
84 | page = alloc_pages(GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO, 0); | 84 | page = alloc_pages(GFP_KERNEL | __GFP_ZERO, 0); |
85 | if (!page) | 85 | if (!page) |
86 | return NULL; | 86 | return NULL; |
87 | if (!pgtable_pmd_page_ctor(page)) { | 87 | if (!pgtable_pmd_page_ctor(page)) { |
@@ -125,7 +125,7 @@ static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pud_t *pud) | |||
125 | 125 | ||
126 | static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) | 126 | static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) |
127 | { | 127 | { |
128 | return (pud_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); | 128 | return (pud_t *)get_zeroed_page(GFP_KERNEL); |
129 | } | 129 | } |
130 | 130 | ||
131 | static inline void pud_free(struct mm_struct *mm, pud_t *pud) | 131 | static inline void pud_free(struct mm_struct *mm, pud_t *pud) |
diff --git a/arch/x86/kernel/espfix_64.c b/arch/x86/kernel/espfix_64.c index 4d38416e2a7f..04f89caef9c4 100644 --- a/arch/x86/kernel/espfix_64.c +++ b/arch/x86/kernel/espfix_64.c | |||
@@ -57,7 +57,7 @@ | |||
57 | # error "Need more than one PGD for the ESPFIX hack" | 57 | # error "Need more than one PGD for the ESPFIX hack" |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | #define PGALLOC_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_REPEAT | __GFP_ZERO) | 60 | #define PGALLOC_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO) |
61 | 61 | ||
62 | /* This contains the *bottom* address of the espfix stack */ | 62 | /* This contains the *bottom* address of the espfix stack */ |
63 | DEFINE_PER_CPU_READ_MOSTLY(unsigned long, espfix_stack); | 63 | DEFINE_PER_CPU_READ_MOSTLY(unsigned long, espfix_stack); |
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c index 4eb287e25043..aa0ff4b02a96 100644 --- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include <asm/fixmap.h> | 6 | #include <asm/fixmap.h> |
7 | #include <asm/mtrr.h> | 7 | #include <asm/mtrr.h> |
8 | 8 | ||
9 | #define PGALLOC_GFP GFP_KERNEL | __GFP_NOTRACK | __GFP_REPEAT | __GFP_ZERO | 9 | #define PGALLOC_GFP GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO |
10 | 10 | ||
11 | #ifdef CONFIG_HIGHPTE | 11 | #ifdef CONFIG_HIGHPTE |
12 | #define PGALLOC_USER_GFP __GFP_HIGHMEM | 12 | #define PGALLOC_USER_GFP __GFP_HIGHMEM |
diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c index 6e7242be1c87..b226b3f497f1 100644 --- a/arch/x86/platform/efi/efi_64.c +++ b/arch/x86/platform/efi/efi_64.c | |||
@@ -139,7 +139,7 @@ int __init efi_alloc_page_tables(void) | |||
139 | if (efi_enabled(EFI_OLD_MEMMAP)) | 139 | if (efi_enabled(EFI_OLD_MEMMAP)) |
140 | return 0; | 140 | return 0; |
141 | 141 | ||
142 | gfp_mask = GFP_KERNEL | __GFP_NOTRACK | __GFP_REPEAT | __GFP_ZERO; | 142 | gfp_mask = GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO; |
143 | efi_pgd = (pgd_t *)__get_free_page(gfp_mask); | 143 | efi_pgd = (pgd_t *)__get_free_page(gfp_mask); |
144 | if (!efi_pgd) | 144 | if (!efi_pgd) |
145 | return -ENOMEM; | 145 | return -ENOMEM; |
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index cab9f766bb06..dd2a49a8aacc 100644 --- a/arch/x86/xen/p2m.c +++ b/arch/x86/xen/p2m.c | |||
@@ -182,7 +182,7 @@ static void * __ref alloc_p2m_page(void) | |||
182 | if (unlikely(!slab_is_available())) | 182 | if (unlikely(!slab_is_available())) |
183 | return alloc_bootmem_align(PAGE_SIZE, PAGE_SIZE); | 183 | return alloc_bootmem_align(PAGE_SIZE, PAGE_SIZE); |
184 | 184 | ||
185 | return (void *)__get_free_page(GFP_KERNEL | __GFP_REPEAT); | 185 | return (void *)__get_free_page(GFP_KERNEL); |
186 | } | 186 | } |
187 | 187 | ||
188 | static void __ref free_p2m_page(void *p) | 188 | static void __ref free_p2m_page(void *p) |
diff --git a/arch/xtensa/include/asm/pgalloc.h b/arch/xtensa/include/asm/pgalloc.h index d38eb9237e64..1065bc8bcae5 100644 --- a/arch/xtensa/include/asm/pgalloc.h +++ b/arch/xtensa/include/asm/pgalloc.h | |||
@@ -44,7 +44,7 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | |||
44 | pte_t *ptep; | 44 | pte_t *ptep; |
45 | int i; | 45 | int i; |
46 | 46 | ||
47 | ptep = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT); | 47 | ptep = (pte_t *)__get_free_page(GFP_KERNEL); |
48 | if (!ptep) | 48 | if (!ptep) |
49 | return NULL; | 49 | return NULL; |
50 | for (i = 0; i < 1024; i++) | 50 | for (i = 0; i < 1024; i++) |
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index d597e432e195..ab19adb07a12 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c | |||
@@ -1750,7 +1750,7 @@ aoecmd_init(void) | |||
1750 | int ret; | 1750 | int ret; |
1751 | 1751 | ||
1752 | /* get_zeroed_page returns page with ref count 1 */ | 1752 | /* get_zeroed_page returns page with ref count 1 */ |
1753 | p = (void *) get_zeroed_page(GFP_KERNEL | __GFP_REPEAT); | 1753 | p = (void *) get_zeroed_page(GFP_KERNEL); |
1754 | if (!p) | 1754 | if (!p) |
1755 | return -ENOMEM; | 1755 | return -ENOMEM; |
1756 | empty_page = virt_to_page(p); | 1756 | empty_page = virt_to_page(p); |
diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c index 0146d911f468..631f1554c87b 100644 --- a/fs/autofs4/waitq.c +++ b/fs/autofs4/waitq.c | |||
@@ -66,11 +66,12 @@ static int autofs4_write(struct autofs_sb_info *sbi, | |||
66 | set_fs(KERNEL_DS); | 66 | set_fs(KERNEL_DS); |
67 | 67 | ||
68 | mutex_lock(&sbi->pipe_mutex); | 68 | mutex_lock(&sbi->pipe_mutex); |
69 | wr = __vfs_write(file, data, bytes, &file->f_pos); | 69 | while (bytes) { |
70 | while (bytes && wr) { | 70 | wr = __vfs_write(file, data, bytes, &file->f_pos); |
71 | if (wr <= 0) | ||
72 | break; | ||
71 | data += wr; | 73 | data += wr; |
72 | bytes -= wr; | 74 | bytes -= wr; |
73 | wr = __vfs_write(file, data, bytes, &file->f_pos); | ||
74 | } | 75 | } |
75 | mutex_unlock(&sbi->pipe_mutex); | 76 | mutex_unlock(&sbi->pipe_mutex); |
76 | 77 | ||
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index b31852f76f46..e3ca4b4cac84 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c | |||
@@ -2329,18 +2329,10 @@ void *jbd2_alloc(size_t size, gfp_t flags) | |||
2329 | 2329 | ||
2330 | BUG_ON(size & (size-1)); /* Must be a power of 2 */ | 2330 | BUG_ON(size & (size-1)); /* Must be a power of 2 */ |
2331 | 2331 | ||
2332 | flags |= __GFP_REPEAT; | 2332 | if (size < PAGE_SIZE) |
2333 | if (size == PAGE_SIZE) | ||
2334 | ptr = (void *)__get_free_pages(flags, 0); | ||
2335 | else if (size > PAGE_SIZE) { | ||
2336 | int order = get_order(size); | ||
2337 | |||
2338 | if (order < 3) | ||
2339 | ptr = (void *)__get_free_pages(flags, order); | ||
2340 | else | ||
2341 | ptr = vmalloc(size); | ||
2342 | } else | ||
2343 | ptr = kmem_cache_alloc(get_slab(size), flags); | 2333 | ptr = kmem_cache_alloc(get_slab(size), flags); |
2334 | else | ||
2335 | ptr = (void *)__get_free_pages(flags, get_order(size)); | ||
2344 | 2336 | ||
2345 | /* Check alignment; SLUB has gotten this wrong in the past, | 2337 | /* Check alignment; SLUB has gotten this wrong in the past, |
2346 | * and this can lead to user data corruption! */ | 2338 | * and this can lead to user data corruption! */ |
@@ -2351,20 +2343,10 @@ void *jbd2_alloc(size_t size, gfp_t flags) | |||
2351 | 2343 | ||
2352 | void jbd2_free(void *ptr, size_t size) | 2344 | void jbd2_free(void *ptr, size_t size) |
2353 | { | 2345 | { |
2354 | if (size == PAGE_SIZE) { | 2346 | if (size < PAGE_SIZE) |
2355 | free_pages((unsigned long)ptr, 0); | 2347 | kmem_cache_free(get_slab(size), ptr); |
2356 | return; | 2348 | else |
2357 | } | 2349 | free_pages((unsigned long)ptr, get_order(size)); |
2358 | if (size > PAGE_SIZE) { | ||
2359 | int order = get_order(size); | ||
2360 | |||
2361 | if (order < 3) | ||
2362 | free_pages((unsigned long)ptr, order); | ||
2363 | else | ||
2364 | vfree(ptr); | ||
2365 | return; | ||
2366 | } | ||
2367 | kmem_cache_free(get_slab(size), ptr); | ||
2368 | }; | 2350 | }; |
2369 | 2351 | ||
2370 | /* | 2352 | /* |
diff --git a/fs/nilfs2/the_nilfs.c b/fs/nilfs2/the_nilfs.c index 809bd2de7ad0..e9fd241b9a0a 100644 --- a/fs/nilfs2/the_nilfs.c +++ b/fs/nilfs2/the_nilfs.c | |||
@@ -439,7 +439,7 @@ static int nilfs_valid_sb(struct nilfs_super_block *sbp) | |||
439 | if (!sbp || le16_to_cpu(sbp->s_magic) != NILFS_SUPER_MAGIC) | 439 | if (!sbp || le16_to_cpu(sbp->s_magic) != NILFS_SUPER_MAGIC) |
440 | return 0; | 440 | return 0; |
441 | bytes = le16_to_cpu(sbp->s_bytes); | 441 | bytes = le16_to_cpu(sbp->s_bytes); |
442 | if (bytes > BLOCK_SIZE) | 442 | if (bytes < sumoff + 4 || bytes > BLOCK_SIZE) |
443 | return 0; | 443 | return 0; |
444 | crc = crc32_le(le32_to_cpu(sbp->s_crc_seed), (unsigned char *)sbp, | 444 | crc = crc32_le(le32_to_cpu(sbp->s_crc_seed), (unsigned char *)sbp, |
445 | sumoff); | 445 | sumoff); |
diff --git a/fs/ocfs2/Makefile b/fs/ocfs2/Makefile index e27e6527912b..4342c7ee7d20 100644 --- a/fs/ocfs2/Makefile +++ b/fs/ocfs2/Makefile | |||
@@ -1,7 +1,5 @@ | |||
1 | ccflags-y := -Ifs/ocfs2 | 1 | ccflags-y := -Ifs/ocfs2 |
2 | 2 | ||
3 | ccflags-y += -DCATCH_BH_JBD_RACES | ||
4 | |||
5 | obj-$(CONFIG_OCFS2_FS) += \ | 3 | obj-$(CONFIG_OCFS2_FS) += \ |
6 | ocfs2.o \ | 4 | ocfs2.o \ |
7 | ocfs2_stackglue.o | 5 | ocfs2_stackglue.o |
diff --git a/fs/ocfs2/buffer_head_io.c b/fs/ocfs2/buffer_head_io.c index fe50ded1b4ce..498641eed2db 100644 --- a/fs/ocfs2/buffer_head_io.c +++ b/fs/ocfs2/buffer_head_io.c | |||
@@ -139,11 +139,16 @@ int ocfs2_read_blocks_sync(struct ocfs2_super *osb, u64 block, | |||
139 | 139 | ||
140 | lock_buffer(bh); | 140 | lock_buffer(bh); |
141 | if (buffer_jbd(bh)) { | 141 | if (buffer_jbd(bh)) { |
142 | #ifdef CATCH_BH_JBD_RACES | ||
142 | mlog(ML_ERROR, | 143 | mlog(ML_ERROR, |
143 | "block %llu had the JBD bit set " | 144 | "block %llu had the JBD bit set " |
144 | "while I was in lock_buffer!", | 145 | "while I was in lock_buffer!", |
145 | (unsigned long long)bh->b_blocknr); | 146 | (unsigned long long)bh->b_blocknr); |
146 | BUG(); | 147 | BUG(); |
148 | #else | ||
149 | unlock_buffer(bh); | ||
150 | continue; | ||
151 | #endif | ||
147 | } | 152 | } |
148 | 153 | ||
149 | clear_buffer_uptodate(bh); | 154 | clear_buffer_uptodate(bh); |
diff --git a/include/linux/kasan.h b/include/linux/kasan.h index 611927f5870d..ac4b3c46a84d 100644 --- a/include/linux/kasan.h +++ b/include/linux/kasan.h | |||
@@ -59,14 +59,13 @@ void kasan_poison_object_data(struct kmem_cache *cache, void *object); | |||
59 | 59 | ||
60 | void kasan_kmalloc_large(const void *ptr, size_t size, gfp_t flags); | 60 | void kasan_kmalloc_large(const void *ptr, size_t size, gfp_t flags); |
61 | void kasan_kfree_large(const void *ptr); | 61 | void kasan_kfree_large(const void *ptr); |
62 | void kasan_kfree(void *ptr); | 62 | void kasan_poison_kfree(void *ptr); |
63 | void kasan_kmalloc(struct kmem_cache *s, const void *object, size_t size, | 63 | void kasan_kmalloc(struct kmem_cache *s, const void *object, size_t size, |
64 | gfp_t flags); | 64 | gfp_t flags); |
65 | void kasan_krealloc(const void *object, size_t new_size, gfp_t flags); | 65 | void kasan_krealloc(const void *object, size_t new_size, gfp_t flags); |
66 | 66 | ||
67 | void kasan_slab_alloc(struct kmem_cache *s, void *object, gfp_t flags); | 67 | void kasan_slab_alloc(struct kmem_cache *s, void *object, gfp_t flags); |
68 | bool kasan_slab_free(struct kmem_cache *s, void *object); | 68 | bool kasan_slab_free(struct kmem_cache *s, void *object); |
69 | void kasan_poison_slab_free(struct kmem_cache *s, void *object); | ||
70 | 69 | ||
71 | struct kasan_cache { | 70 | struct kasan_cache { |
72 | int alloc_meta_offset; | 71 | int alloc_meta_offset; |
@@ -76,6 +75,9 @@ struct kasan_cache { | |||
76 | int kasan_module_alloc(void *addr, size_t size); | 75 | int kasan_module_alloc(void *addr, size_t size); |
77 | void kasan_free_shadow(const struct vm_struct *vm); | 76 | void kasan_free_shadow(const struct vm_struct *vm); |
78 | 77 | ||
78 | size_t ksize(const void *); | ||
79 | static inline void kasan_unpoison_slab(const void *ptr) { ksize(ptr); } | ||
80 | |||
79 | #else /* CONFIG_KASAN */ | 81 | #else /* CONFIG_KASAN */ |
80 | 82 | ||
81 | static inline void kasan_unpoison_shadow(const void *address, size_t size) {} | 83 | static inline void kasan_unpoison_shadow(const void *address, size_t size) {} |
@@ -102,7 +104,7 @@ static inline void kasan_poison_object_data(struct kmem_cache *cache, | |||
102 | 104 | ||
103 | static inline void kasan_kmalloc_large(void *ptr, size_t size, gfp_t flags) {} | 105 | static inline void kasan_kmalloc_large(void *ptr, size_t size, gfp_t flags) {} |
104 | static inline void kasan_kfree_large(const void *ptr) {} | 106 | static inline void kasan_kfree_large(const void *ptr) {} |
105 | static inline void kasan_kfree(void *ptr) {} | 107 | static inline void kasan_poison_kfree(void *ptr) {} |
106 | static inline void kasan_kmalloc(struct kmem_cache *s, const void *object, | 108 | static inline void kasan_kmalloc(struct kmem_cache *s, const void *object, |
107 | size_t size, gfp_t flags) {} | 109 | size_t size, gfp_t flags) {} |
108 | static inline void kasan_krealloc(const void *object, size_t new_size, | 110 | static inline void kasan_krealloc(const void *object, size_t new_size, |
@@ -114,11 +116,12 @@ static inline bool kasan_slab_free(struct kmem_cache *s, void *object) | |||
114 | { | 116 | { |
115 | return false; | 117 | return false; |
116 | } | 118 | } |
117 | static inline void kasan_poison_slab_free(struct kmem_cache *s, void *object) {} | ||
118 | 119 | ||
119 | static inline int kasan_module_alloc(void *addr, size_t size) { return 0; } | 120 | static inline int kasan_module_alloc(void *addr, size_t size) { return 0; } |
120 | static inline void kasan_free_shadow(const struct vm_struct *vm) {} | 121 | static inline void kasan_free_shadow(const struct vm_struct *vm) {} |
121 | 122 | ||
123 | static inline void kasan_unpoison_slab(const void *ptr) { } | ||
124 | |||
122 | #endif /* CONFIG_KASAN */ | 125 | #endif /* CONFIG_KASAN */ |
123 | 126 | ||
124 | #endif /* LINUX_KASAN_H */ | 127 | #endif /* LINUX_KASAN_H */ |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 5df5feb49575..ece042dfe23c 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -602,7 +602,7 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma) | |||
602 | } | 602 | } |
603 | 603 | ||
604 | void do_set_pte(struct vm_area_struct *vma, unsigned long address, | 604 | void do_set_pte(struct vm_area_struct *vma, unsigned long address, |
605 | struct page *page, pte_t *pte, bool write, bool anon, bool old); | 605 | struct page *page, pte_t *pte, bool write, bool anon); |
606 | #endif | 606 | #endif |
607 | 607 | ||
608 | /* | 608 | /* |
diff --git a/init/main.c b/init/main.c index 826fd57fa3aa..eae02aa03c9e 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -708,11 +708,13 @@ static bool __init_or_module initcall_blacklisted(initcall_t fn) | |||
708 | { | 708 | { |
709 | struct blacklist_entry *entry; | 709 | struct blacklist_entry *entry; |
710 | char fn_name[KSYM_SYMBOL_LEN]; | 710 | char fn_name[KSYM_SYMBOL_LEN]; |
711 | unsigned long addr; | ||
711 | 712 | ||
712 | if (list_empty(&blacklisted_initcalls)) | 713 | if (list_empty(&blacklisted_initcalls)) |
713 | return false; | 714 | return false; |
714 | 715 | ||
715 | sprint_symbol_no_offset(fn_name, (unsigned long)fn); | 716 | addr = (unsigned long) dereference_function_descriptor(fn); |
717 | sprint_symbol_no_offset(fn_name, addr); | ||
716 | 718 | ||
717 | list_for_each_entry(entry, &blacklisted_initcalls, next) { | 719 | list_for_each_entry(entry, &blacklisted_initcalls, next) { |
718 | if (!strcmp(fn_name, entry->buf)) { | 720 | if (!strcmp(fn_name, entry->buf)) { |
diff --git a/kernel/power/process.c b/kernel/power/process.c index df058bed53ce..0c2ee9761d57 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c | |||
@@ -146,6 +146,18 @@ int freeze_processes(void) | |||
146 | if (!error && !oom_killer_disable()) | 146 | if (!error && !oom_killer_disable()) |
147 | error = -EBUSY; | 147 | error = -EBUSY; |
148 | 148 | ||
149 | /* | ||
150 | * There is a hard to fix race between oom_reaper kernel thread | ||
151 | * and oom_killer_disable. oom_reaper calls exit_oom_victim | ||
152 | * before the victim reaches exit_mm so try to freeze all the tasks | ||
153 | * again and catch such a left over task. | ||
154 | */ | ||
155 | if (!error) { | ||
156 | pr_info("Double checking all user space processes after OOM killer disable... "); | ||
157 | error = try_to_freeze_tasks(true); | ||
158 | pr_cont("\n"); | ||
159 | } | ||
160 | |||
149 | if (error) | 161 | if (error) |
150 | thaw_processes(); | 162 | thaw_processes(); |
151 | return error; | 163 | return error; |
diff --git a/mm/compaction.c b/mm/compaction.c index 1427366ad673..79bfe0e06907 100644 --- a/mm/compaction.c +++ b/mm/compaction.c | |||
@@ -441,25 +441,23 @@ static unsigned long isolate_freepages_block(struct compact_control *cc, | |||
441 | 441 | ||
442 | /* Found a free page, break it into order-0 pages */ | 442 | /* Found a free page, break it into order-0 pages */ |
443 | isolated = split_free_page(page); | 443 | isolated = split_free_page(page); |
444 | if (!isolated) | ||
445 | break; | ||
446 | |||
444 | total_isolated += isolated; | 447 | total_isolated += isolated; |
448 | cc->nr_freepages += isolated; | ||
445 | for (i = 0; i < isolated; i++) { | 449 | for (i = 0; i < isolated; i++) { |
446 | list_add(&page->lru, freelist); | 450 | list_add(&page->lru, freelist); |
447 | page++; | 451 | page++; |
448 | } | 452 | } |
449 | 453 | if (!strict && cc->nr_migratepages <= cc->nr_freepages) { | |
450 | /* If a page was split, advance to the end of it */ | 454 | blockpfn += isolated; |
451 | if (isolated) { | 455 | break; |
452 | cc->nr_freepages += isolated; | ||
453 | if (!strict && | ||
454 | cc->nr_migratepages <= cc->nr_freepages) { | ||
455 | blockpfn += isolated; | ||
456 | break; | ||
457 | } | ||
458 | |||
459 | blockpfn += isolated - 1; | ||
460 | cursor += isolated - 1; | ||
461 | continue; | ||
462 | } | 456 | } |
457 | /* Advance to the end of split page */ | ||
458 | blockpfn += isolated - 1; | ||
459 | cursor += isolated - 1; | ||
460 | continue; | ||
463 | 461 | ||
464 | isolate_fail: | 462 | isolate_fail: |
465 | if (strict) | 463 | if (strict) |
@@ -469,6 +467,9 @@ isolate_fail: | |||
469 | 467 | ||
470 | } | 468 | } |
471 | 469 | ||
470 | if (locked) | ||
471 | spin_unlock_irqrestore(&cc->zone->lock, flags); | ||
472 | |||
472 | /* | 473 | /* |
473 | * There is a tiny chance that we have read bogus compound_order(), | 474 | * There is a tiny chance that we have read bogus compound_order(), |
474 | * so be careful to not go outside of the pageblock. | 475 | * so be careful to not go outside of the pageblock. |
@@ -490,9 +491,6 @@ isolate_fail: | |||
490 | if (strict && blockpfn < end_pfn) | 491 | if (strict && blockpfn < end_pfn) |
491 | total_isolated = 0; | 492 | total_isolated = 0; |
492 | 493 | ||
493 | if (locked) | ||
494 | spin_unlock_irqrestore(&cc->zone->lock, flags); | ||
495 | |||
496 | /* Update the pageblock-skip if the whole pageblock was scanned */ | 494 | /* Update the pageblock-skip if the whole pageblock was scanned */ |
497 | if (blockpfn == end_pfn) | 495 | if (blockpfn == end_pfn) |
498 | update_pageblock_skip(cc, valid_page, total_isolated, false); | 496 | update_pageblock_skip(cc, valid_page, total_isolated, false); |
@@ -1011,6 +1009,7 @@ static void isolate_freepages(struct compact_control *cc) | |||
1011 | block_end_pfn = block_start_pfn, | 1009 | block_end_pfn = block_start_pfn, |
1012 | block_start_pfn -= pageblock_nr_pages, | 1010 | block_start_pfn -= pageblock_nr_pages, |
1013 | isolate_start_pfn = block_start_pfn) { | 1011 | isolate_start_pfn = block_start_pfn) { |
1012 | unsigned long isolated; | ||
1014 | 1013 | ||
1015 | /* | 1014 | /* |
1016 | * This can iterate a massively long zone without finding any | 1015 | * This can iterate a massively long zone without finding any |
@@ -1035,8 +1034,12 @@ static void isolate_freepages(struct compact_control *cc) | |||
1035 | continue; | 1034 | continue; |
1036 | 1035 | ||
1037 | /* Found a block suitable for isolating free pages from. */ | 1036 | /* Found a block suitable for isolating free pages from. */ |
1038 | isolate_freepages_block(cc, &isolate_start_pfn, | 1037 | isolated = isolate_freepages_block(cc, &isolate_start_pfn, |
1039 | block_end_pfn, freelist, false); | 1038 | block_end_pfn, freelist, false); |
1039 | /* If isolation failed early, do not continue needlessly */ | ||
1040 | if (!isolated && isolate_start_pfn < block_end_pfn && | ||
1041 | cc->nr_migratepages > cc->nr_freepages) | ||
1042 | break; | ||
1040 | 1043 | ||
1041 | /* | 1044 | /* |
1042 | * If we isolated enough freepages, or aborted due to async | 1045 | * If we isolated enough freepages, or aborted due to async |
diff --git a/mm/filemap.c b/mm/filemap.c index 00ae878b2a38..20f3b1f33f0e 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
@@ -2186,7 +2186,7 @@ repeat: | |||
2186 | if (file->f_ra.mmap_miss > 0) | 2186 | if (file->f_ra.mmap_miss > 0) |
2187 | file->f_ra.mmap_miss--; | 2187 | file->f_ra.mmap_miss--; |
2188 | addr = address + (page->index - vmf->pgoff) * PAGE_SIZE; | 2188 | addr = address + (page->index - vmf->pgoff) * PAGE_SIZE; |
2189 | do_set_pte(vma, addr, page, pte, false, false, true); | 2189 | do_set_pte(vma, addr, page, pte, false, false); |
2190 | unlock_page(page); | 2190 | unlock_page(page); |
2191 | goto next; | 2191 | goto next; |
2192 | unlock: | 2192 | unlock: |
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 388c2bb9b55c..c1f3c0be150a 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -1030,6 +1030,7 @@ static void destroy_compound_gigantic_page(struct page *page, | |||
1030 | int nr_pages = 1 << order; | 1030 | int nr_pages = 1 << order; |
1031 | struct page *p = page + 1; | 1031 | struct page *p = page + 1; |
1032 | 1032 | ||
1033 | atomic_set(compound_mapcount_ptr(page), 0); | ||
1033 | for (i = 1; i < nr_pages; i++, p = mem_map_next(p, page, i)) { | 1034 | for (i = 1; i < nr_pages; i++, p = mem_map_next(p, page, i)) { |
1034 | clear_compound_head(p); | 1035 | clear_compound_head(p); |
1035 | set_page_refcounted(p); | 1036 | set_page_refcounted(p); |
@@ -4228,7 +4229,6 @@ pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud) | |||
4228 | if (saddr) { | 4229 | if (saddr) { |
4229 | spte = huge_pte_offset(svma->vm_mm, saddr); | 4230 | spte = huge_pte_offset(svma->vm_mm, saddr); |
4230 | if (spte) { | 4231 | if (spte) { |
4231 | mm_inc_nr_pmds(mm); | ||
4232 | get_page(virt_to_page(spte)); | 4232 | get_page(virt_to_page(spte)); |
4233 | break; | 4233 | break; |
4234 | } | 4234 | } |
@@ -4243,9 +4243,9 @@ pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud) | |||
4243 | if (pud_none(*pud)) { | 4243 | if (pud_none(*pud)) { |
4244 | pud_populate(mm, pud, | 4244 | pud_populate(mm, pud, |
4245 | (pmd_t *)((unsigned long)spte & PAGE_MASK)); | 4245 | (pmd_t *)((unsigned long)spte & PAGE_MASK)); |
4246 | mm_inc_nr_pmds(mm); | ||
4246 | } else { | 4247 | } else { |
4247 | put_page(virt_to_page(spte)); | 4248 | put_page(virt_to_page(spte)); |
4248 | mm_inc_nr_pmds(mm); | ||
4249 | } | 4249 | } |
4250 | spin_unlock(ptl); | 4250 | spin_unlock(ptl); |
4251 | out: | 4251 | out: |
diff --git a/mm/internal.h b/mm/internal.h index a37e5b6f9d25..2524ec880e24 100644 --- a/mm/internal.h +++ b/mm/internal.h | |||
@@ -24,7 +24,8 @@ | |||
24 | */ | 24 | */ |
25 | #define GFP_RECLAIM_MASK (__GFP_RECLAIM|__GFP_HIGH|__GFP_IO|__GFP_FS|\ | 25 | #define GFP_RECLAIM_MASK (__GFP_RECLAIM|__GFP_HIGH|__GFP_IO|__GFP_FS|\ |
26 | __GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|\ | 26 | __GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|\ |
27 | __GFP_NORETRY|__GFP_MEMALLOC|__GFP_NOMEMALLOC) | 27 | __GFP_NORETRY|__GFP_MEMALLOC|__GFP_NOMEMALLOC|\ |
28 | __GFP_ATOMIC) | ||
28 | 29 | ||
29 | /* The GFP flags allowed during early boot */ | 30 | /* The GFP flags allowed during early boot */ |
30 | #define GFP_BOOT_MASK (__GFP_BITS_MASK & ~(__GFP_RECLAIM|__GFP_IO|__GFP_FS)) | 31 | #define GFP_BOOT_MASK (__GFP_BITS_MASK & ~(__GFP_RECLAIM|__GFP_IO|__GFP_FS)) |
diff --git a/mm/kasan/kasan.c b/mm/kasan/kasan.c index 28439acda6ec..6845f9294696 100644 --- a/mm/kasan/kasan.c +++ b/mm/kasan/kasan.c | |||
@@ -508,7 +508,7 @@ void kasan_slab_alloc(struct kmem_cache *cache, void *object, gfp_t flags) | |||
508 | kasan_kmalloc(cache, object, cache->object_size, flags); | 508 | kasan_kmalloc(cache, object, cache->object_size, flags); |
509 | } | 509 | } |
510 | 510 | ||
511 | void kasan_poison_slab_free(struct kmem_cache *cache, void *object) | 511 | static void kasan_poison_slab_free(struct kmem_cache *cache, void *object) |
512 | { | 512 | { |
513 | unsigned long size = cache->object_size; | 513 | unsigned long size = cache->object_size; |
514 | unsigned long rounded_up_size = round_up(size, KASAN_SHADOW_SCALE_SIZE); | 514 | unsigned long rounded_up_size = round_up(size, KASAN_SHADOW_SCALE_SIZE); |
@@ -626,7 +626,7 @@ void kasan_krealloc(const void *object, size_t size, gfp_t flags) | |||
626 | kasan_kmalloc(page->slab_cache, object, size, flags); | 626 | kasan_kmalloc(page->slab_cache, object, size, flags); |
627 | } | 627 | } |
628 | 628 | ||
629 | void kasan_kfree(void *ptr) | 629 | void kasan_poison_kfree(void *ptr) |
630 | { | 630 | { |
631 | struct page *page; | 631 | struct page *page; |
632 | 632 | ||
@@ -636,7 +636,7 @@ void kasan_kfree(void *ptr) | |||
636 | kasan_poison_shadow(ptr, PAGE_SIZE << compound_order(page), | 636 | kasan_poison_shadow(ptr, PAGE_SIZE << compound_order(page), |
637 | KASAN_FREE_PAGE); | 637 | KASAN_FREE_PAGE); |
638 | else | 638 | else |
639 | kasan_slab_free(page->slab_cache, ptr); | 639 | kasan_poison_slab_free(page->slab_cache, ptr); |
640 | } | 640 | } |
641 | 641 | ||
642 | void kasan_kfree_large(const void *ptr) | 642 | void kasan_kfree_large(const void *ptr) |
diff --git a/mm/kmemleak.c b/mm/kmemleak.c index e6429926e957..04320d3adbef 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c | |||
@@ -307,8 +307,10 @@ static void hex_dump_object(struct seq_file *seq, | |||
307 | len = min_t(size_t, object->size, HEX_MAX_LINES * HEX_ROW_SIZE); | 307 | len = min_t(size_t, object->size, HEX_MAX_LINES * HEX_ROW_SIZE); |
308 | 308 | ||
309 | seq_printf(seq, " hex dump (first %zu bytes):\n", len); | 309 | seq_printf(seq, " hex dump (first %zu bytes):\n", len); |
310 | kasan_disable_current(); | ||
310 | seq_hex_dump(seq, " ", DUMP_PREFIX_NONE, HEX_ROW_SIZE, | 311 | seq_hex_dump(seq, " ", DUMP_PREFIX_NONE, HEX_ROW_SIZE, |
311 | HEX_GROUP_SIZE, ptr, len, HEX_ASCII); | 312 | HEX_GROUP_SIZE, ptr, len, HEX_ASCII); |
313 | kasan_enable_current(); | ||
312 | } | 314 | } |
313 | 315 | ||
314 | /* | 316 | /* |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 75e74408cc8f..ac8664db3823 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -4203,7 +4203,7 @@ mem_cgroup_css_alloc(struct cgroup_subsys_state *parent_css) | |||
4203 | return &memcg->css; | 4203 | return &memcg->css; |
4204 | fail: | 4204 | fail: |
4205 | mem_cgroup_free(memcg); | 4205 | mem_cgroup_free(memcg); |
4206 | return NULL; | 4206 | return ERR_PTR(-ENOMEM); |
4207 | } | 4207 | } |
4208 | 4208 | ||
4209 | static int | 4209 | static int |
@@ -5544,6 +5544,7 @@ void mem_cgroup_migrate(struct page *oldpage, struct page *newpage) | |||
5544 | struct mem_cgroup *memcg; | 5544 | struct mem_cgroup *memcg; |
5545 | unsigned int nr_pages; | 5545 | unsigned int nr_pages; |
5546 | bool compound; | 5546 | bool compound; |
5547 | unsigned long flags; | ||
5547 | 5548 | ||
5548 | VM_BUG_ON_PAGE(!PageLocked(oldpage), oldpage); | 5549 | VM_BUG_ON_PAGE(!PageLocked(oldpage), oldpage); |
5549 | VM_BUG_ON_PAGE(!PageLocked(newpage), newpage); | 5550 | VM_BUG_ON_PAGE(!PageLocked(newpage), newpage); |
@@ -5574,10 +5575,10 @@ void mem_cgroup_migrate(struct page *oldpage, struct page *newpage) | |||
5574 | 5575 | ||
5575 | commit_charge(newpage, memcg, false); | 5576 | commit_charge(newpage, memcg, false); |
5576 | 5577 | ||
5577 | local_irq_disable(); | 5578 | local_irq_save(flags); |
5578 | mem_cgroup_charge_statistics(memcg, newpage, compound, nr_pages); | 5579 | mem_cgroup_charge_statistics(memcg, newpage, compound, nr_pages); |
5579 | memcg_check_events(memcg, newpage); | 5580 | memcg_check_events(memcg, newpage); |
5580 | local_irq_enable(); | 5581 | local_irq_restore(flags); |
5581 | } | 5582 | } |
5582 | 5583 | ||
5583 | DEFINE_STATIC_KEY_FALSE(memcg_sockets_enabled_key); | 5584 | DEFINE_STATIC_KEY_FALSE(memcg_sockets_enabled_key); |
diff --git a/mm/memory.c b/mm/memory.c index 15322b73636b..cd1f29e4897e 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -2877,7 +2877,7 @@ static int __do_fault(struct vm_area_struct *vma, unsigned long address, | |||
2877 | * vm_ops->map_pages. | 2877 | * vm_ops->map_pages. |
2878 | */ | 2878 | */ |
2879 | void do_set_pte(struct vm_area_struct *vma, unsigned long address, | 2879 | void do_set_pte(struct vm_area_struct *vma, unsigned long address, |
2880 | struct page *page, pte_t *pte, bool write, bool anon, bool old) | 2880 | struct page *page, pte_t *pte, bool write, bool anon) |
2881 | { | 2881 | { |
2882 | pte_t entry; | 2882 | pte_t entry; |
2883 | 2883 | ||
@@ -2885,8 +2885,6 @@ void do_set_pte(struct vm_area_struct *vma, unsigned long address, | |||
2885 | entry = mk_pte(page, vma->vm_page_prot); | 2885 | entry = mk_pte(page, vma->vm_page_prot); |
2886 | if (write) | 2886 | if (write) |
2887 | entry = maybe_mkwrite(pte_mkdirty(entry), vma); | 2887 | entry = maybe_mkwrite(pte_mkdirty(entry), vma); |
2888 | if (old) | ||
2889 | entry = pte_mkold(entry); | ||
2890 | if (anon) { | 2888 | if (anon) { |
2891 | inc_mm_counter_fast(vma->vm_mm, MM_ANONPAGES); | 2889 | inc_mm_counter_fast(vma->vm_mm, MM_ANONPAGES); |
2892 | page_add_new_anon_rmap(page, vma, address, false); | 2890 | page_add_new_anon_rmap(page, vma, address, false); |
@@ -2900,16 +2898,8 @@ void do_set_pte(struct vm_area_struct *vma, unsigned long address, | |||
2900 | update_mmu_cache(vma, address, pte); | 2898 | update_mmu_cache(vma, address, pte); |
2901 | } | 2899 | } |
2902 | 2900 | ||
2903 | /* | ||
2904 | * If architecture emulates "accessed" or "young" bit without HW support, | ||
2905 | * there is no much gain with fault_around. | ||
2906 | */ | ||
2907 | static unsigned long fault_around_bytes __read_mostly = | 2901 | static unsigned long fault_around_bytes __read_mostly = |
2908 | #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS | ||
2909 | PAGE_SIZE; | ||
2910 | #else | ||
2911 | rounddown_pow_of_two(65536); | 2902 | rounddown_pow_of_two(65536); |
2912 | #endif | ||
2913 | 2903 | ||
2914 | #ifdef CONFIG_DEBUG_FS | 2904 | #ifdef CONFIG_DEBUG_FS |
2915 | static int fault_around_bytes_get(void *data, u64 *val) | 2905 | static int fault_around_bytes_get(void *data, u64 *val) |
@@ -3032,20 +3022,9 @@ static int do_read_fault(struct mm_struct *mm, struct vm_area_struct *vma, | |||
3032 | */ | 3022 | */ |
3033 | if (vma->vm_ops->map_pages && fault_around_bytes >> PAGE_SHIFT > 1) { | 3023 | if (vma->vm_ops->map_pages && fault_around_bytes >> PAGE_SHIFT > 1) { |
3034 | pte = pte_offset_map_lock(mm, pmd, address, &ptl); | 3024 | pte = pte_offset_map_lock(mm, pmd, address, &ptl); |
3035 | if (!pte_same(*pte, orig_pte)) | ||
3036 | goto unlock_out; | ||
3037 | do_fault_around(vma, address, pte, pgoff, flags); | 3025 | do_fault_around(vma, address, pte, pgoff, flags); |
3038 | /* Check if the fault is handled by faultaround */ | 3026 | if (!pte_same(*pte, orig_pte)) |
3039 | if (!pte_same(*pte, orig_pte)) { | ||
3040 | /* | ||
3041 | * Faultaround produce old pte, but the pte we've | ||
3042 | * handler fault for should be young. | ||
3043 | */ | ||
3044 | pte_t entry = pte_mkyoung(*pte); | ||
3045 | if (ptep_set_access_flags(vma, address, pte, entry, 0)) | ||
3046 | update_mmu_cache(vma, address, pte); | ||
3047 | goto unlock_out; | 3027 | goto unlock_out; |
3048 | } | ||
3049 | pte_unmap_unlock(pte, ptl); | 3028 | pte_unmap_unlock(pte, ptl); |
3050 | } | 3029 | } |
3051 | 3030 | ||
@@ -3060,7 +3039,7 @@ static int do_read_fault(struct mm_struct *mm, struct vm_area_struct *vma, | |||
3060 | put_page(fault_page); | 3039 | put_page(fault_page); |
3061 | return ret; | 3040 | return ret; |
3062 | } | 3041 | } |
3063 | do_set_pte(vma, address, fault_page, pte, false, false, false); | 3042 | do_set_pte(vma, address, fault_page, pte, false, false); |
3064 | unlock_page(fault_page); | 3043 | unlock_page(fault_page); |
3065 | unlock_out: | 3044 | unlock_out: |
3066 | pte_unmap_unlock(pte, ptl); | 3045 | pte_unmap_unlock(pte, ptl); |
@@ -3111,7 +3090,7 @@ static int do_cow_fault(struct mm_struct *mm, struct vm_area_struct *vma, | |||
3111 | } | 3090 | } |
3112 | goto uncharge_out; | 3091 | goto uncharge_out; |
3113 | } | 3092 | } |
3114 | do_set_pte(vma, address, new_page, pte, true, true, false); | 3093 | do_set_pte(vma, address, new_page, pte, true, true); |
3115 | mem_cgroup_commit_charge(new_page, memcg, false, false); | 3094 | mem_cgroup_commit_charge(new_page, memcg, false, false); |
3116 | lru_cache_add_active_or_unevictable(new_page, vma); | 3095 | lru_cache_add_active_or_unevictable(new_page, vma); |
3117 | pte_unmap_unlock(pte, ptl); | 3096 | pte_unmap_unlock(pte, ptl); |
@@ -3164,7 +3143,7 @@ static int do_shared_fault(struct mm_struct *mm, struct vm_area_struct *vma, | |||
3164 | put_page(fault_page); | 3143 | put_page(fault_page); |
3165 | return ret; | 3144 | return ret; |
3166 | } | 3145 | } |
3167 | do_set_pte(vma, address, fault_page, pte, true, false, false); | 3146 | do_set_pte(vma, address, fault_page, pte, true, false); |
3168 | pte_unmap_unlock(pte, ptl); | 3147 | pte_unmap_unlock(pte, ptl); |
3169 | 3148 | ||
3170 | if (set_page_dirty(fault_page)) | 3149 | if (set_page_dirty(fault_page)) |
diff --git a/mm/mempool.c b/mm/mempool.c index 9e075f829d0d..8f65464da5de 100644 --- a/mm/mempool.c +++ b/mm/mempool.c | |||
@@ -104,20 +104,16 @@ static inline void poison_element(mempool_t *pool, void *element) | |||
104 | 104 | ||
105 | static void kasan_poison_element(mempool_t *pool, void *element) | 105 | static void kasan_poison_element(mempool_t *pool, void *element) |
106 | { | 106 | { |
107 | if (pool->alloc == mempool_alloc_slab) | 107 | if (pool->alloc == mempool_alloc_slab || pool->alloc == mempool_kmalloc) |
108 | kasan_poison_slab_free(pool->pool_data, element); | 108 | kasan_poison_kfree(element); |
109 | if (pool->alloc == mempool_kmalloc) | ||
110 | kasan_kfree(element); | ||
111 | if (pool->alloc == mempool_alloc_pages) | 109 | if (pool->alloc == mempool_alloc_pages) |
112 | kasan_free_pages(element, (unsigned long)pool->pool_data); | 110 | kasan_free_pages(element, (unsigned long)pool->pool_data); |
113 | } | 111 | } |
114 | 112 | ||
115 | static void kasan_unpoison_element(mempool_t *pool, void *element, gfp_t flags) | 113 | static void kasan_unpoison_element(mempool_t *pool, void *element, gfp_t flags) |
116 | { | 114 | { |
117 | if (pool->alloc == mempool_alloc_slab) | 115 | if (pool->alloc == mempool_alloc_slab || pool->alloc == mempool_kmalloc) |
118 | kasan_slab_alloc(pool->pool_data, element, flags); | 116 | kasan_unpoison_slab(element); |
119 | if (pool->alloc == mempool_kmalloc) | ||
120 | kasan_krealloc(element, (size_t)pool->pool_data, flags); | ||
121 | if (pool->alloc == mempool_alloc_pages) | 117 | if (pool->alloc == mempool_alloc_pages) |
122 | kasan_alloc_pages(element, (unsigned long)pool->pool_data); | 118 | kasan_alloc_pages(element, (unsigned long)pool->pool_data); |
123 | } | 119 | } |
diff --git a/mm/oom_kill.c b/mm/oom_kill.c index acbc432d1a52..ddf74487f848 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c | |||
@@ -474,13 +474,8 @@ static bool __oom_reap_task(struct task_struct *tsk) | |||
474 | p = find_lock_task_mm(tsk); | 474 | p = find_lock_task_mm(tsk); |
475 | if (!p) | 475 | if (!p) |
476 | goto unlock_oom; | 476 | goto unlock_oom; |
477 | |||
478 | mm = p->mm; | 477 | mm = p->mm; |
479 | if (!atomic_inc_not_zero(&mm->mm_users)) { | 478 | atomic_inc(&mm->mm_users); |
480 | task_unlock(p); | ||
481 | goto unlock_oom; | ||
482 | } | ||
483 | |||
484 | task_unlock(p); | 479 | task_unlock(p); |
485 | 480 | ||
486 | if (!down_read_trylock(&mm->mmap_sem)) { | 481 | if (!down_read_trylock(&mm->mmap_sem)) { |
diff --git a/mm/page_owner.c b/mm/page_owner.c index c6cda3e36212..fedeba88c9cb 100644 --- a/mm/page_owner.c +++ b/mm/page_owner.c | |||
@@ -207,13 +207,15 @@ void __dump_page_owner(struct page *page) | |||
207 | .nr_entries = page_ext->nr_entries, | 207 | .nr_entries = page_ext->nr_entries, |
208 | .entries = &page_ext->trace_entries[0], | 208 | .entries = &page_ext->trace_entries[0], |
209 | }; | 209 | }; |
210 | gfp_t gfp_mask = page_ext->gfp_mask; | 210 | gfp_t gfp_mask; |
211 | int mt = gfpflags_to_migratetype(gfp_mask); | 211 | int mt; |
212 | 212 | ||
213 | if (unlikely(!page_ext)) { | 213 | if (unlikely(!page_ext)) { |
214 | pr_alert("There is not page extension available.\n"); | 214 | pr_alert("There is not page extension available.\n"); |
215 | return; | 215 | return; |
216 | } | 216 | } |
217 | gfp_mask = page_ext->gfp_mask; | ||
218 | mt = gfpflags_to_migratetype(gfp_mask); | ||
217 | 219 | ||
218 | if (!test_bit(PAGE_EXT_OWNER, &page_ext->flags)) { | 220 | if (!test_bit(PAGE_EXT_OWNER, &page_ext->flags)) { |
219 | pr_alert("page_owner info is not active (free page?)\n"); | 221 | pr_alert("page_owner info is not active (free page?)\n"); |
diff --git a/mm/shmem.c b/mm/shmem.c index a36144909b28..24463b67b6ef 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
@@ -2227,7 +2227,7 @@ static long shmem_fallocate(struct file *file, int mode, loff_t offset, | |||
2227 | /* Remove the !PageUptodate pages we added */ | 2227 | /* Remove the !PageUptodate pages we added */ |
2228 | shmem_undo_range(inode, | 2228 | shmem_undo_range(inode, |
2229 | (loff_t)start << PAGE_SHIFT, | 2229 | (loff_t)start << PAGE_SHIFT, |
2230 | (loff_t)index << PAGE_SHIFT, true); | 2230 | ((loff_t)index << PAGE_SHIFT) - 1, true); |
2231 | goto undone; | 2231 | goto undone; |
2232 | } | 2232 | } |
2233 | 2233 | ||
@@ -242,7 +242,7 @@ void rotate_reclaimable_page(struct page *page) | |||
242 | get_page(page); | 242 | get_page(page); |
243 | local_irq_save(flags); | 243 | local_irq_save(flags); |
244 | pvec = this_cpu_ptr(&lru_rotate_pvecs); | 244 | pvec = this_cpu_ptr(&lru_rotate_pvecs); |
245 | if (!pagevec_add(pvec, page)) | 245 | if (!pagevec_add(pvec, page) || PageCompound(page)) |
246 | pagevec_move_tail(pvec); | 246 | pagevec_move_tail(pvec); |
247 | local_irq_restore(flags); | 247 | local_irq_restore(flags); |
248 | } | 248 | } |
@@ -296,7 +296,7 @@ void activate_page(struct page *page) | |||
296 | struct pagevec *pvec = &get_cpu_var(activate_page_pvecs); | 296 | struct pagevec *pvec = &get_cpu_var(activate_page_pvecs); |
297 | 297 | ||
298 | get_page(page); | 298 | get_page(page); |
299 | if (!pagevec_add(pvec, page)) | 299 | if (!pagevec_add(pvec, page) || PageCompound(page)) |
300 | pagevec_lru_move_fn(pvec, __activate_page, NULL); | 300 | pagevec_lru_move_fn(pvec, __activate_page, NULL); |
301 | put_cpu_var(activate_page_pvecs); | 301 | put_cpu_var(activate_page_pvecs); |
302 | } | 302 | } |
@@ -391,9 +391,8 @@ static void __lru_cache_add(struct page *page) | |||
391 | struct pagevec *pvec = &get_cpu_var(lru_add_pvec); | 391 | struct pagevec *pvec = &get_cpu_var(lru_add_pvec); |
392 | 392 | ||
393 | get_page(page); | 393 | get_page(page); |
394 | if (!pagevec_space(pvec)) | 394 | if (!pagevec_add(pvec, page) || PageCompound(page)) |
395 | __pagevec_lru_add(pvec); | 395 | __pagevec_lru_add(pvec); |
396 | pagevec_add(pvec, page); | ||
397 | put_cpu_var(lru_add_pvec); | 396 | put_cpu_var(lru_add_pvec); |
398 | } | 397 | } |
399 | 398 | ||
@@ -628,7 +627,7 @@ void deactivate_file_page(struct page *page) | |||
628 | if (likely(get_page_unless_zero(page))) { | 627 | if (likely(get_page_unless_zero(page))) { |
629 | struct pagevec *pvec = &get_cpu_var(lru_deactivate_file_pvecs); | 628 | struct pagevec *pvec = &get_cpu_var(lru_deactivate_file_pvecs); |
630 | 629 | ||
631 | if (!pagevec_add(pvec, page)) | 630 | if (!pagevec_add(pvec, page) || PageCompound(page)) |
632 | pagevec_lru_move_fn(pvec, lru_deactivate_file_fn, NULL); | 631 | pagevec_lru_move_fn(pvec, lru_deactivate_file_fn, NULL); |
633 | put_cpu_var(lru_deactivate_file_pvecs); | 632 | put_cpu_var(lru_deactivate_file_pvecs); |
634 | } | 633 | } |
@@ -648,7 +647,7 @@ void deactivate_page(struct page *page) | |||
648 | struct pagevec *pvec = &get_cpu_var(lru_deactivate_pvecs); | 647 | struct pagevec *pvec = &get_cpu_var(lru_deactivate_pvecs); |
649 | 648 | ||
650 | get_page(page); | 649 | get_page(page); |
651 | if (!pagevec_add(pvec, page)) | 650 | if (!pagevec_add(pvec, page) || PageCompound(page)) |
652 | pagevec_lru_move_fn(pvec, lru_deactivate_fn, NULL); | 651 | pagevec_lru_move_fn(pvec, lru_deactivate_fn, NULL); |
653 | put_cpu_var(lru_deactivate_pvecs); | 652 | put_cpu_var(lru_deactivate_pvecs); |
654 | } | 653 | } |
diff --git a/tools/testing/selftests/vm/compaction_test.c b/tools/testing/selftests/vm/compaction_test.c index 932ff577ffc0..00c4f65d12da 100644 --- a/tools/testing/selftests/vm/compaction_test.c +++ b/tools/testing/selftests/vm/compaction_test.c | |||
@@ -136,7 +136,7 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size) | |||
136 | printf("No of huge pages allocated = %d\n", | 136 | printf("No of huge pages allocated = %d\n", |
137 | (atoi(nr_hugepages))); | 137 | (atoi(nr_hugepages))); |
138 | 138 | ||
139 | if (write(fd, initial_nr_hugepages, sizeof(initial_nr_hugepages)) | 139 | if (write(fd, initial_nr_hugepages, strlen(initial_nr_hugepages)) |
140 | != strlen(initial_nr_hugepages)) { | 140 | != strlen(initial_nr_hugepages)) { |
141 | perror("Failed to write to /proc/sys/vm/nr_hugepages\n"); | 141 | perror("Failed to write to /proc/sys/vm/nr_hugepages\n"); |
142 | goto close_fd; | 142 | goto close_fd; |
diff --git a/tools/vm/slabinfo.c b/tools/vm/slabinfo.c index 1889163f2f05..7cf6e1769903 100644 --- a/tools/vm/slabinfo.c +++ b/tools/vm/slabinfo.c | |||
@@ -492,7 +492,7 @@ static void slab_stats(struct slabinfo *s) | |||
492 | s->deactivate_to_head + s->deactivate_to_tail + s->deactivate_bypass; | 492 | s->deactivate_to_head + s->deactivate_to_tail + s->deactivate_bypass; |
493 | 493 | ||
494 | if (total) { | 494 | if (total) { |
495 | printf("\nSlab Deactivation Ocurrences %%\n"); | 495 | printf("\nSlab Deactivation Occurrences %%\n"); |
496 | printf("-------------------------------------------------\n"); | 496 | printf("-------------------------------------------------\n"); |
497 | printf("Slab full %7lu %3lu%%\n", | 497 | printf("Slab full %7lu %3lu%%\n", |
498 | s->deactivate_full, (s->deactivate_full * 100) / total); | 498 | s->deactivate_full, (s->deactivate_full * 100) / total); |