Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1212110

[PATCH 05/12] mm, page_alloc: Remove unecessary recheck of nodemask

From Mel Gorman <mgorman@techsingularity.net>
Newsgroups linux.kernel
Subject [PATCH 05/12] mm, page_alloc: Remove unecessary recheck of nodemask
Date 2015-08-24 14:20 +0200
Message-ID <q0YTf-7q8-17@gated-at.bofh.it> (permalink)
References <q0YTf-7q8-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


An allocation request will either use the given nodemask or the cpuset
current tasks mems_allowed. A cpuset retry will recheck the callers nodemask
and while it's trivial overhead during an extremely rare operation, also
unnecessary. This patch fixes it.

Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
---
 mm/page_alloc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 2c1c3bf54d15..32d1cec124bc 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3171,7 +3171,7 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
 	gfp_t alloc_mask; /* The gfp_t that was actually used for allocation */
 	struct alloc_context ac = {
 		.high_zoneidx = gfp_zone(gfp_mask),
-		.nodemask = nodemask,
+		.nodemask = nodemask ? : &cpuset_current_mems_allowed,
 		.migratetype = gfpflags_to_migratetype(gfp_mask),
 	};
 
@@ -3206,8 +3206,7 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
 
 	/* The preferred zone is used for statistics later */
 	preferred_zoneref = first_zones_zonelist(ac.zonelist, ac.high_zoneidx,
-				ac.nodemask ? : &cpuset_current_mems_allowed,
-				&ac.preferred_zone);
+				ac.nodemask, &ac.preferred_zone);
 	if (!ac.preferred_zone)
 		goto out;
 	ac.classzone_idx = zonelist_zone_idx(preferred_zoneref);
-- 
2.4.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH 05/12] mm, page_alloc: Remove unecessary recheck of nodemask Mel Gorman <mgorman@techsingularity.net> - 2015-08-24 14:20 +0200
  Re: [PATCH 05/12] mm, page_alloc: Remove unecessary recheck of  nodemask Vlastimil Babka <vbabka@suse.cz> - 2015-08-25 16:40 +0200

csiph-web