/* If mpol_dup() sees current->cpuset == cpuset_being_rebound, then it rebinds the mempolicy its copying by calling mpol_rebind_policy() with the mems_allowed returned by cpuset_mems_allowed(). This keeps mempolicies cpuset relative after its cpuset moves. See further kernel/cpuset.c update_nodemask().  */
struct mempolicy* __mpol_dup(struct mempolicy *old)
/* If mpol_dup() sees current->cpuset == cpuset_being_rebound, then it rebinds the mempolicy its copying by calling mpol_rebind_policy() with the mems_allowed returned by cpuset_mems_allowed(). This keeps mempolicies cpuset relative after its cpuset moves. See further kernel/cpuset.c update_nodemask().  */
struct mempolicy* __mpol_dup(struct mempolicy *old)
{
	struct mempolicy *new = kmem_cache_alloc(policy_cache, GFP_KERNEL);
	if (!new)
		return ERR_PTR(-ENOMEM);
	if (current_cpuset_is_being_rebound()) {
		nodemask_t mems = cpuset_mems_allowed(current);
		mpol_rebind_policy(old, &mems);
	}
	*new = *old;
	atomic_set(&new->refcnt, 1);
	return new;
}