Skip to content

Commit 5f7a75a

Browse files
Mel Gormantorvalds
authored andcommitted
mm: page_alloc: do not cache reclaim distances
pgdat->reclaim_nodes tracks if a remote node is allowed to be reclaimed by zone_reclaim due to its distance. As it is expected that zone_reclaim_mode will be rarely enabled it is unreasonable for all machines to take a penalty. Fortunately, the zone_reclaim_mode() path is already slow and it is the path that takes the hit. Signed-off-by: Mel Gorman <mgorman@suse.de> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Reviewed-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com> Acked-by: Michal Hocko <mhocko@suse.cz> Reviewed-by: Christoph Lameter <cl@linux.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 4f9b16a commit 5f7a75a

2 files changed

Lines changed: 2 additions & 16 deletions

File tree

‎include/linux/mmzone.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,6 @@ typedef struct pglist_data {
763763
unsigned long node_spanned_pages; /* total size of physical page
764764
range, including holes */
765765
int node_id;
766-
nodemask_t reclaim_nodes; /* Nodes allowed to reclaim from */
767766
wait_queue_head_t kswapd_wait;
768767
wait_queue_head_t pfmemalloc_wait;
769768
struct task_struct *kswapd; /* Protected by lock_memory_hotplug() */

‎mm/page_alloc.c‎

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1850,16 +1850,8 @@ static bool zone_local(struct zone *local_zone, struct zone *zone)
18501850

18511851
static bool zone_allows_reclaim(struct zone *local_zone, struct zone *zone)
18521852
{
1853-
return node_isset(local_zone->node, zone->zone_pgdat->reclaim_nodes);
1854-
}
1855-
1856-
static void __paginginit init_zone_allows_reclaim(int nid)
1857-
{
1858-
int i;
1859-
1860-
for_each_node_state(i, N_MEMORY)
1861-
if (node_distance(nid, i) <= RECLAIM_DISTANCE)
1862-
node_set(i, NODE_DATA(nid)->reclaim_nodes);
1853+
return node_distance(zone_to_nid(local_zone), zone_to_nid(zone)) <
1854+
RECLAIM_DISTANCE;
18631855
}
18641856

18651857
#else /* CONFIG_NUMA */
@@ -1893,9 +1885,6 @@ static bool zone_allows_reclaim(struct zone *local_zone, struct zone *zone)
18931885
return true;
18941886
}
18951887

1896-
static inline void init_zone_allows_reclaim(int nid)
1897-
{
1898-
}
18991888
#endif /* CONFIG_NUMA */
19001889

19011890
/*
@@ -4933,8 +4922,6 @@ void __paginginit free_area_init_node(int nid, unsigned long *zones_size,
49334922

49344923
pgdat->node_id = nid;
49354924
pgdat->node_start_pfn = node_start_pfn;
4936-
if (node_state(nid, N_MEMORY))
4937-
init_zone_allows_reclaim(nid);
49384925
#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
49394926
get_pfn_range_for_nid(nid, &start_pfn, &end_pfn);
49404927
#endif

0 commit comments

Comments
 (0)