mm: remove __GFP_COLD
authorMel Gorman <mgorman@techsingularity.net>
Thu, 16 Nov 2017 01:38:03 +0000 (17:38 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 16 Nov 2017 02:21:06 +0000 (18:21 -0800)
commit453f85d43fa9ee243f0fc3ac4e1be45615301e3f
treef414b8ef3a3c92903c960225a2ded020a7158494
parent2d4894b5d2ae0fe1725ea7abd57b33bfbbe45492
mm: remove __GFP_COLD

As the page free path makes no distinction between cache hot and cold
pages, there is no real useful ordering of pages in the free list that
allocation requests can take advantage of.  Juding from the users of
__GFP_COLD, it is likely that a number of them are the result of copying
other sites instead of actually measuring the impact.  Remove the
__GFP_COLD parameter which simplifies a number of paths in the page
allocator.

This is potentially controversial but bear in mind that the size of the
per-cpu pagelists versus modern cache sizes means that the whole per-cpu
list can often fit in the L3 cache.  Hence, there is only a potential
benefit for microbenchmarks that alloc/free pages in a tight loop.  It's
even worse when THP is taken into account which has little or no chance
of getting a cache-hot page as the per-cpu list is bypassed and the
zeroing of multiple pages will thrash the cache anyway.

The truncate microbenchmarks are not shown as this patch affects the
allocation path and not the free path.  A page fault microbenchmark was
tested but it showed no sigificant difference which is not surprising
given that the __GFP_COLD branches are a miniscule percentage of the
fault path.

Link: http://lkml.kernel.org/r/20171018075952.10627-9-mgorman@techsingularity.net
Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
25 files changed:
drivers/net/ethernet/amazon/ena/ena_netdev.c
drivers/net/ethernet/amd/xgbe/xgbe-desc.c
drivers/net/ethernet/aquantia/atlantic/aq_ring.c
drivers/net/ethernet/cavium/liquidio/octeon_network.h
drivers/net/ethernet/mellanox/mlx4/en_rx.c
drivers/net/ethernet/netronome/nfp/nfp_net_common.c
drivers/net/ethernet/qlogic/qlge/qlge_main.c
drivers/net/ethernet/sfc/falcon/rx.c
drivers/net/ethernet/sfc/rx.c
drivers/net/ethernet/synopsys/dwc-xlgmac-desc.c
drivers/net/ethernet/ti/netcp_core.c
drivers/net/virtio_net.c
drivers/staging/lustre/lustre/mdc/mdc_request.c
fs/cachefiles/rdwr.c
include/linux/gfp.h
include/linux/pagemap.h
include/linux/skbuff.h
include/linux/slab.h
include/trace/events/mmflags.h
kernel/power/snapshot.c
mm/filemap.c
mm/page_alloc.c
mm/percpu-vm.c
net/core/skbuff.c
tools/perf/builtin-kmem.c