Hmm, I don't remember "caving" on this point; Paul asked me to reconsider
and I said that I would. I think it's also helpful to have more
discussion on the matter by including other people's opinions.
I considered this when I implemented it the way I did, and that was part
of the reason I was in favor of enum mempolicy_mode so much: functions
that had a formal of type 'enum mempolicy_mode' were only the mode and
formals of type 'int' or 'unsigned short' were the combination. I even
stated that difference in Documentation/vm/numa_memory_policy.txt in the
first patchset.
Yes, struct shmem_sb_info stores the 'policy' member as well so it would
need to include a new 'flags' member as well. And the interface between
the two, mpol_shared_policy_init() would need another formal for the
flags.
Yeah, it gets tricky. I'm not too sure about only pulling the mode and
flags apart at mpol_new() time because perhaps, in the future, there will
be flag and mode combinations that are only applicable for set_mempolicy()
and not for mbind(), for example. I can imagine that someday we may add a
flag that applies only to a task mempolicy and not to a VMA mempolicy.
I don't like this because its not consistent. It increases the confusion
of what contains a mode and what contains the combination. I think the
safest thing to do, if we separate the mode and flags out in struct
mempolicy is to do it everywhere. All helper functions will need
additional formals similar to what I did in the first patchset (that was
actually unpopular) and struct shmem_sb_info need to be modified to
include the additional member.
In other words, I'm all in favor of storing the mode and flags however we
want, but I think it should be done consistenty throughout the tree.
While mpol_mode() wrappers may not be favorable all over the place (and I
didn't miss any), it may be easier than the alternative.
David
--