aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Hocko2017-01-10 18:57:42 -0600
committerLinus Torvalds2017-01-10 20:31:55 -0600
commit41b6167e8f746b475668f1da78599fc4284f18db (patch)
tree359fcc154939bfd41f8cd909513a602afcb5bc7f
parent2df26639e708a88dcc22171949da638a9998f3bc (diff)
downloadmkaricheri-ti-linux-kernel-41b6167e8f746b475668f1da78599fc4284f18db.tar.gz
mkaricheri-ti-linux-kernel-41b6167e8f746b475668f1da78599fc4284f18db.tar.xz
mkaricheri-ti-linux-kernel-41b6167e8f746b475668f1da78599fc4284f18db.zip
mm: get rid of __GFP_OTHER_NODE
The flag was introduced by commit 78afd5612deb ("mm: add __GFP_OTHER_NODE flag") to allow proper accounting of remote node allocations done by kernel daemons on behalf of a process - e.g. khugepaged. After "mm: fix remote numa hits statistics" we do not need and actually use the flag so we can safely remove it because all allocations which are satisfied from their "home" node are accounted properly. [mhocko@suse.com: fix build] Link: http://lkml.kernel.org/r/20170106122225.GK5556@dhcp22.suse.cz Link: http://lkml.kernel.org/r/20170102153057.9451-3-mhocko@kernel.org Signed-off-by: Michal Hocko <mhocko@suse.com> Acked-by: Mel Gorman <mgorman@suse.de> Acked-by: Vlastimil Babka <vbabka@suse.cz> Cc: Michal Hocko <mhocko@suse.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: Taku Izumi <izumi.taku@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/gfp.h13
-rw-r--r--include/trace/events/mmflags.h3
-rw-r--r--mm/huge_memory.c3
-rw-r--r--mm/khugepaged.c5
-rw-r--r--mm/page_alloc.c5
-rw-r--r--tools/perf/builtin-kmem.c1
6 files changed, 9 insertions, 21 deletions
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 4175dca4ac39..7806a8f80abc 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -38,9 +38,8 @@ struct vm_area_struct;
38#define ___GFP_ACCOUNT 0x100000u 38#define ___GFP_ACCOUNT 0x100000u
39#define ___GFP_NOTRACK 0x200000u 39#define ___GFP_NOTRACK 0x200000u
40#define ___GFP_DIRECT_RECLAIM 0x400000u 40#define ___GFP_DIRECT_RECLAIM 0x400000u
41#define ___GFP_OTHER_NODE 0x800000u 41#define ___GFP_WRITE 0x800000u
42#define ___GFP_WRITE 0x1000000u 42#define ___GFP_KSWAPD_RECLAIM 0x1000000u
43#define ___GFP_KSWAPD_RECLAIM 0x2000000u
44/* If the above are modified, __GFP_BITS_SHIFT may need updating */ 43/* If the above are modified, __GFP_BITS_SHIFT may need updating */
45 44
46/* 45/*
@@ -172,11 +171,6 @@ struct vm_area_struct;
172 * __GFP_NOTRACK_FALSE_POSITIVE is an alias of __GFP_NOTRACK. It's a means of 171 * __GFP_NOTRACK_FALSE_POSITIVE is an alias of __GFP_NOTRACK. It's a means of
173 * distinguishing in the source between false positives and allocations that 172 * distinguishing in the source between false positives and allocations that
174 * cannot be supported (e.g. page tables). 173 * cannot be supported (e.g. page tables).
175 *
176 * __GFP_OTHER_NODE is for allocations that are on a remote node but that
177 * should not be accounted for as a remote allocation in vmstat. A
178 * typical user would be khugepaged collapsing a huge page on a remote
179 * node.
180 */ 174 */
181#define __GFP_COLD ((__force gfp_t)___GFP_COLD) 175#define __GFP_COLD ((__force gfp_t)___GFP_COLD)
182#define __GFP_NOWARN ((__force gfp_t)___GFP_NOWARN) 176#define __GFP_NOWARN ((__force gfp_t)___GFP_NOWARN)
@@ -184,10 +178,9 @@ struct vm_area_struct;
184#define __GFP_ZERO ((__force gfp_t)___GFP_ZERO) 178#define __GFP_ZERO ((__force gfp_t)___GFP_ZERO)
185#define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK) 179#define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK)
186#define __GFP_NOTRACK_FALSE_POSITIVE (__GFP_NOTRACK) 180#define __GFP_NOTRACK_FALSE_POSITIVE (__GFP_NOTRACK)
187#define __GFP_OTHER_NODE ((__force gfp_t)___GFP_OTHER_NODE)
188 181
189/* Room for N __GFP_FOO bits */ 182/* Room for N __GFP_FOO bits */
190#define __GFP_BITS_SHIFT 26 183#define __GFP_BITS_SHIFT 25
191#define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) 184#define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1))
192 185
193/* 186/*
diff --git a/include/trace/events/mmflags.h b/include/trace/events/mmflags.h
index 9e687ca9a307..15bf875d0e4a 100644
--- a/include/trace/events/mmflags.h
+++ b/include/trace/events/mmflags.h
@@ -47,8 +47,7 @@
47 {(unsigned long)__GFP_WRITE, "__GFP_WRITE"}, \ 47 {(unsigned long)__GFP_WRITE, "__GFP_WRITE"}, \
48 {(unsigned long)__GFP_RECLAIM, "__GFP_RECLAIM"}, \ 48 {(unsigned long)__GFP_RECLAIM, "__GFP_RECLAIM"}, \
49 {(unsigned long)__GFP_DIRECT_RECLAIM, "__GFP_DIRECT_RECLAIM"},\ 49 {(unsigned long)__GFP_DIRECT_RECLAIM, "__GFP_DIRECT_RECLAIM"},\
50 {(unsigned long)__GFP_KSWAPD_RECLAIM, "__GFP_KSWAPD_RECLAIM"},\ 50 {(unsigned long)__GFP_KSWAPD_RECLAIM, "__GFP_KSWAPD_RECLAIM"}\
51 {(unsigned long)__GFP_OTHER_NODE, "__GFP_OTHER_NODE"} \
52 51
53#define show_gfp_flags(flags) \ 52#define show_gfp_flags(flags) \
54 (flags) ? __print_flags(flags, "|", \ 53 (flags) ? __print_flags(flags, "|", \
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 10eedbf14421..72339a646fb1 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -919,8 +919,7 @@ static int do_huge_pmd_wp_page_fallback(struct vm_fault *vmf, pmd_t orig_pmd,
919 } 919 }
920 920
921 for (i = 0; i < HPAGE_PMD_NR; i++) { 921 for (i = 0; i < HPAGE_PMD_NR; i++) {
922 pages[i] = alloc_page_vma_node(GFP_HIGHUSER_MOVABLE | 922 pages[i] = alloc_page_vma_node(GFP_HIGHUSER_MOVABLE, vma,
923 __GFP_OTHER_NODE, vma,
924 vmf->address, page_to_nid(page)); 923 vmf->address, page_to_nid(page));
925 if (unlikely(!pages[i] || 924 if (unlikely(!pages[i] ||
926 mem_cgroup_try_charge(pages[i], vma->vm_mm, 925 mem_cgroup_try_charge(pages[i], vma->vm_mm,
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index b0924a68cc36..77ae3239c3de 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -943,7 +943,7 @@ static void collapse_huge_page(struct mm_struct *mm,
943 VM_BUG_ON(address & ~HPAGE_PMD_MASK); 943 VM_BUG_ON(address & ~HPAGE_PMD_MASK);
944 944
945 /* Only allocate from the target node */ 945 /* Only allocate from the target node */
946 gfp = alloc_hugepage_khugepaged_gfpmask() | __GFP_OTHER_NODE | __GFP_THISNODE; 946 gfp = alloc_hugepage_khugepaged_gfpmask() | __GFP_THISNODE;
947 947
948 /* 948 /*
949 * Before allocating the hugepage, release the mmap_sem read lock. 949 * Before allocating the hugepage, release the mmap_sem read lock.
@@ -1309,8 +1309,7 @@ static void collapse_shmem(struct mm_struct *mm,
1309 VM_BUG_ON(start & (HPAGE_PMD_NR - 1)); 1309 VM_BUG_ON(start & (HPAGE_PMD_NR - 1));
1310 1310
1311 /* Only allocate from the target node */ 1311 /* Only allocate from the target node */
1312 gfp = alloc_hugepage_khugepaged_gfpmask() | 1312 gfp = alloc_hugepage_khugepaged_gfpmask() | __GFP_THISNODE;
1313 __GFP_OTHER_NODE | __GFP_THISNODE;
1314 1313
1315 new_page = khugepaged_alloc_page(hpage, gfp, node); 1314 new_page = khugepaged_alloc_page(hpage, gfp, node);
1316 if (!new_page) { 1315 if (!new_page) {
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index cba2a64792e6..872caae544ef 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2584,8 +2584,7 @@ int __isolate_free_page(struct page *page, unsigned int order)
2584 * 2584 *
2585 * Must be called with interrupts disabled. 2585 * Must be called with interrupts disabled.
2586 */ 2586 */
2587static inline void zone_statistics(struct zone *preferred_zone, struct zone *z, 2587static inline void zone_statistics(struct zone *preferred_zone, struct zone *z)
2588 gfp_t flags)
2589{ 2588{
2590#ifdef CONFIG_NUMA 2589#ifdef CONFIG_NUMA
2591 enum zone_stat_item local_stat = NUMA_LOCAL; 2590 enum zone_stat_item local_stat = NUMA_LOCAL;
@@ -2667,7 +2666,7 @@ struct page *buffered_rmqueue(struct zone *preferred_zone,
2667 } 2666 }
2668 2667
2669 __count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order); 2668 __count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order);
2670 zone_statistics(preferred_zone, zone, gfp_flags); 2669 zone_statistics(preferred_zone, zone);
2671 local_irq_restore(flags); 2670 local_irq_restore(flags);
2672 2671
2673 VM_BUG_ON_PAGE(bad_range(zone, page), page); 2672 VM_BUG_ON_PAGE(bad_range(zone, page), page);
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
index 35a02f8e5a4a..915869e00d86 100644
--- a/tools/perf/builtin-kmem.c
+++ b/tools/perf/builtin-kmem.c
@@ -655,7 +655,6 @@ static const struct {
655 { "__GFP_RECLAIM", "R" }, 655 { "__GFP_RECLAIM", "R" },
656 { "__GFP_DIRECT_RECLAIM", "DR" }, 656 { "__GFP_DIRECT_RECLAIM", "DR" },
657 { "__GFP_KSWAPD_RECLAIM", "KR" }, 657 { "__GFP_KSWAPD_RECLAIM", "KR" },
658 { "__GFP_OTHER_NODE", "ON" },
659}; 658};
660 659
661static size_t max_gfp_len; 660static size_t max_gfp_len;