On Wed, 19 Jan 2011, KOSAKI Motohiro wrote: > I'm glad to you are keeping fastpath concern. However you don't need > nodemask-and in this case. Because zonelist->zref[0] is always in nodemask. > Please see policy_zonelist(). So, you can just replace nodemask with cpuset_mems_allowed. > > This is not only simple, but also improve a consisteny of mempolicy. > mempolicies have nothing to do with this, they pass their nodemask into the page allocator so the preferred_zone is already allowed; setting a mempolicy with a nodemask that is disallowed by the cpuset is an invalid configuration. > --- > mm/page_alloc.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 07a6544..876de04 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -2146,7 +2146,8 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, > > get_mems_allowed(); > /* The preferred zone is used for statistics later */ > - first_zones_zonelist(zonelist, high_zoneidx, nodemask, &preferred_zone); > + first_zones_zonelist(zonelist, high_zoneidx, > + &cpuset_current_mems_allowed, &preferred_zone); > if (!preferred_zone) { > put_mems_allowed(); > return NULL; As previously mentioned, I didn't want to affect the current behavior of mempolicies when they pass their own nodemask into the page allocator that may be a subset of the set of allowed nodes; in that case, the statistics are probably actually important and we can defer resetting preferred_zone to the slowpath where we know its a __GFP_WAIT allocation instead of the first try in the fastpath. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxxx For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/ Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>