Re: [patch 3/4] mempolicy: add MPOL_F_STATIC_NODES flag

From: David Rientjes
Date: Tue Feb 12 2008 - 23:04:58 EST


On Tue, 12 Feb 2008, Paul Jackson wrote:

> > 1) we've discussed the issue of returning EINVAL for non-empty nodemasks
> > with MPOL_DEFAULT. By removing this restriction, we run the risk of
> > breaking applications if we should ever want to define a semantic to
> > non-empty node mask for MPOL_DEFAULT.
>
> The bigger risk, in my view, is breaking some piece of existing user code.
> Properly written user code wouldn't break, but that doesn't mean much.
> Changes, even minor corner case changes, often break something, so should
> not be done with out cause. Whether or not code cleanup in mempolicy.c is
> sufficient cause here is not clear to me.
>
> Future room for growth doesn't mean so much for me here; if we close one
> future alternative, we always have others, such as more mode flag bits.
>

I've redone my patchset based on the feedback that I've received, and in
my latest revisions I folded the entire equivalent of mpol_check_policy()
into mpol_new().

Lee, you feel strongly that non-empty nodemasks passed with MPOL_DEFAULT
should be considered invalid and rejected by the kernel, as the current
implementation does. I've brought up a counter-argument based on the
set_mempolicy() man page and the Linux documentation that don't specify
anything about what the nodemask shall contain if it's not a NULL pointer.

My position was to give the user the benefit of the doubt. Because Linux
has been vague in specifying what the nodemask shall contain, that (to me)
means that it can contain anything. It's undefined, in a standards sense.
The only thing that we should look for is whether the user passed
MPOL_DEFAULT as the first parameter and then we should effect that policy
because it's clearly the intention.

I don't think there's a super strong case for either behavior, and that's
why I just folded the mpol_check_policy() logic straight into mpol_new().

David
--
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/