Re: [PATCH 2/8] Change alloc_pages_vma to pass down the policy nodefor local policy
From: Christoph Lameter
Date: Tue Feb 22 2011 - 10:43:09 EST
On Mon, 21 Feb 2011, Andi Kleen wrote:
> --- a/mm/mempolicy.c
> +++ b/mm/mempolicy.c
> @@ -1524,10 +1524,9 @@ static nodemask_t *policy_nodemask(gfp_t gfp, struct mempolicy *policy)
> }
>
> /* Return a zonelist indicated by gfp for node representing a mempolicy */
> -static struct zonelist *policy_zonelist(gfp_t gfp, struct mempolicy *policy)
> +static struct zonelist *policy_zonelist(gfp_t gfp, struct mempolicy *policy,
> + int nd)
> {
> - int nd = numa_node_id();
> -
> switch (policy->mode) {
> case MPOL_PREFERRED:
> if (!(policy->flags & MPOL_F_LOCAL))
> @@ -1679,7 +1678,7 @@ struct zonelist *huge_zonelist(struct vm_area_struct *vma, unsigned long addr,
> zl = node_zonelist(interleave_nid(*mpol, vma, addr,
> huge_page_shift(hstate_vma(vma))), gfp_flags);
> } else {
> - zl = policy_zonelist(gfp_flags, *mpol);
> + zl = policy_zonelist(gfp_flags, *mpol, numa_node_id());
> if ((*mpol)->mode == MPOL_BIND)
> *nodemask = &(*mpol)->v.nodes;
> }
If we do that then why not also consolidate the MPOL_INTERLEAVE
treatment also in policy_zonelist()? Looks awfully similar now and Would
simplify the code and likely get rid of some functions.
--
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/