[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1102220941200.16060@router.home>
Date: Tue, 22 Feb 2011 09:42:58 -0600 (CST)
From: Christoph Lameter <cl@...ux.com>
To: Andi Kleen <andi@...stfloor.org>
cc: akpm@...ux-foundation.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, aarcange@...hat.com,
lwoodman@...hat.com, Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH 2/8] Change alloc_pages_vma to pass down the policy node
for local policy
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists