The patch titled Subject: mm/mempolicy.c: remove unnecessary is_valid_nodemask() has been added to the -mm tree. Its filename is remove-unnecessary-is_valid_nodemask.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/remove-unnecessary-is_valid_nodemask.patch echo and later at echo http://ozlabs.org/~akpm/mmotm/broken-out/remove-unnecessary-is_valid_nodemask.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Zhihui Zhang <zzhsuny@xxxxxxxxx> Subject: mm/mempolicy.c: remove unnecessary is_valid_nodemask() When nodes is true, nsc->mask2 has already been filtered by nsc->mask1, which has already factored in node_states[N_MEMORY]. Signed-off-by: Zhihui Zhang <zzhsuny@xxxxxxxxx> Cc: Mel Gorman <mel@xxxxxxxxx> Cc: Oleg Nesterov <oleg@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/mempolicy.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff -puN mm/mempolicy.c~remove-unnecessary-is_valid_nodemask mm/mempolicy.c --- a/mm/mempolicy.c~remove-unnecessary-is_valid_nodemask +++ a/mm/mempolicy.c @@ -162,12 +162,6 @@ static const struct mempolicy_operations enum mpol_rebind_step step); } mpol_ops[MPOL_MAX]; -/* Check that the nodemask contains at least one populated zone */ -static int is_valid_nodemask(const nodemask_t *nodemask) -{ - return nodes_intersects(*nodemask, node_states[N_MEMORY]); -} - static inline int mpol_store_user_nodemask(const struct mempolicy *pol) { return pol->flags & MPOL_MODE_FLAGS; @@ -202,7 +196,7 @@ static int mpol_new_preferred(struct mem static int mpol_new_bind(struct mempolicy *pol, const nodemask_t *nodes) { - if (!is_valid_nodemask(nodes)) + if (nodes_empty(*nodes)) return -EINVAL; pol->v.nodes = *nodes; return 0; @@ -234,7 +228,7 @@ static int mpol_set_nodemask(struct memp nodes = NULL; /* explicit local allocation */ else { if (pol->flags & MPOL_F_RELATIVE_NODES) - mpol_relative_nodemask(&nsc->mask2, nodes,&nsc->mask1); + mpol_relative_nodemask(&nsc->mask2, nodes, &nsc->mask1); else nodes_and(nsc->mask2, *nodes, nsc->mask1); _ Patches currently in -mm which might be from zzhsuny@xxxxxxxxx are remove-unnecessary-is_valid_nodemask.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html