Re: [PATCH] Cpuset: alloc_pages_node overrides cpuset constraints

From: Andi Kleen
Date: Wed Mar 22 2006 - 12:12:26 EST


On Saturday 18 March 2006 21:40, Paul Jackson wrote:

> --- 2.6.16-rc6.orig/kernel/cpuset.c 2006-03-13 20:19:36.000000000 -0800
> +++ 2.6.16-rc6/kernel/cpuset.c 2006-03-17 21:52:18.000000000 -0800
> @@ -2164,6 +2164,8 @@ int __cpuset_zone_allowed(struct zone *z
> node = z->zone_pgdat->node_id;
> if (node_isset(node, current->mems_allowed))
> return 1;
> + if (gfp_mask & __GFP_NOCPUSET)
> + return 1;
> if (gfp_mask & __GFP_HARDWALL) /* If hardwall request, stop here */
> return 0;

Faster would be if (gfp_mask & (__GFP_NOCPUSET|__GFP_HARDWALL)) { /* sort them out */ }
That would only give a single test for the common case of no such flag set.

-Andi

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