Re: [PATCH 1/10] Mempolicy man pages: misc cleanup of get_mempolicy(2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2008-08-07 at 18:20 +0200, Michael Kerrisk wrote:
> On Thu, Aug 7, 2008 at 5:27 PM, Lee Schermerhorn
> <Lee.Schermerhorn@xxxxxx> wrote:
> > On Thu, 2008-08-07 at 15:33 +0200, Michael Kerrisk wrote:
> >> Lee,
> >>
> >> Lee Schermerhorn wrote:
> >> > Misc cleanup of get_mempolicy(2):
> >> >
> >> > + mention that any mode flags will be saved with mode.
> >> >   I don't bother to document mode flags here because we
> >> >   already have a pointer to set_mempolicy(2) for more info
> >> >   on memory policy.  mode flags are discussed there.
> >> >
> >> > + remove some old, obsolete [IMO] NOTES
> >>
> >> Can you say a little more about the rationale for removing that piece of
> >> text.  (I'm not objecting: I'd just like al little more context to the change.)
> >
> > 1) no longer true that we have no cpuset man page to refer to.
> >
> > 2) We documented MPOL_F_NODE several man page revisions ago.  So the old
> > comment that it's not documented, and my rationale for documenting
> > it--effectively, Christoph and Andi agreed--are both old news.  The
> > changes should be captured in your change logs, so I think the in-line
> > comments can be removed.
> 
> Sorry -- maybe I should have been clearer.  I meant, what's the
> rationale for removing this piece of text:
> 
> -If the mode of the process policy or the policy governing allocations at the
> -specified address is
> -.B MPOL_PREFERRED
> -and this policy was installed with an empty
> -.IR nodemask \(emspecifying
> -local allocation,
> -.BR get_mempolicy ()
> -will return the mask of on-line node IDs in the location pointed to by
> -a non-NULL
> -.I nodemask
> -argument.
> -This mask does not take into consideration any administratively imposed
> -restrictions on the process's context.


Ah, yes.  Well, it doesn't do that.  get_mempolicy() always returns the
mempolicy that can be used by set_mempolicy() [or mbind()], to establish
the same policy.  So, if one specified MPOL_PREFERRED with a NULL or
empty nodemask, that's what get_mempolicy() returns [even tho' it's
stored differently internally].

> 
> Cheers,
> 
> Michael
> 
> >
> >>
> >> Cheers,
> >>
> >> Michael
> >>
> >> > and 'roff comments.
> >> >
> >> > Signed-off-by: Lee Schermerhorn <lee.schermerhorn@xxxxxx>
> >> >
> >> >  man2/get_mempolicy.2 |   44 +++++++++++++-------------------------------
> >> >  1 files changed, 13 insertions(+), 31 deletions(-)
> >> >
> >> > Index: man-pages-3.05/man2/get_mempolicy.2
> >> > ===================================================================
> >> > --- man-pages-3.05.orig/man2/get_mempolicy.2        2008-07-29 16:43:07.000000000 -0400
> >> > +++ man-pages-3.05/man2/get_mempolicy.2     2008-07-29 16:43:40.000000000 -0400
> >> > @@ -53,6 +53,15 @@ then information about the calling proce
> >> >  (as set by
> >> >  .BR set_mempolicy (2))
> >> >  is returned.
> >> > +The policy returned
> >> > +.RI [ mode
> >> > +and
> >> > +.IR nodemask ]
> >> > +may be used to restore the process' policy to it's state at
> >> > +the time of the call to
> >> > +.BR get_mempolicy ()
> >> > +using
> >> > +.BR set_mempolicy (2).
> >> >
> >> >  If
> >> >  .I flags
> >> > @@ -72,7 +81,10 @@ If the
> >> >  .I mode
> >> >  argument is not NULL, then
> >> >  .BR get_mempolicy ()
> >> > -will store the policy mode of the requested NUMA policy in the location
> >> > +will store the policy mode
> >> > +and any optional
> >> > +.I "mode flags"
> >> > +of the requested NUMA policy in the location
> >> >  pointed to by this argument.
> >> >  If
> >> >  .I nodemask
> >> > @@ -188,36 +200,6 @@ cases.)
> >> >  .SH CONFORMING TO
> >> >  This system call is Linux-specific.
> >> >  .SH NOTES
> >> > -If the mode of the process policy or the policy governing allocations at the
> >> > -specified address is
> >> > -.B MPOL_PREFERRED
> >> > -and this policy was installed with an empty
> >> > -.IR nodemask \(emspecifying
> >> > -local allocation,
> >> > -.BR get_mempolicy ()
> >> > -will return the mask of on-line node IDs in the location pointed to by
> >> > -a non-NULL
> >> > -.I nodemask
> >> > -argument.
> >> > -This mask does not take into consideration any administratively imposed
> >> > -restrictions on the process's context.
> >> > -.\" FIXME
> >> > -.\" "context" above refers to cpusets.
> >> > -.\" No man page to reference. --Lee Schermerhorn
> >> > -.\"
> >> > -.\"  Christoph says the following is untrue.  These are "fully supported."
> >> > -.\"  Andi concedes that he has lost this battle and approves [?]
> >> > -.\"  updating the man pages to document the behavior.  --Lee Schermerhorn
> >> > -.\" This manual page is incomplete:
> >> > -.\" it does not document the details the
> >> > -.\" .BR MPOL_F_NODE
> >> > -.\" flag,
> >> > -.\" which modifies the operation of
> >> > -.\" .BR get_mempolicy ().
> >> > -.\" This is deliberate: this flag is not intended for application use,
> >> > -.\" and its operation may change or it may be removed altogether in
> >> > -.\" future kernel versions.
> >> > -.\" .B Do not use it.
> >> >  .SS "Versions and Library Support"
> >> >  See
> >> >  .BR mbind (2).
> >> >
> >>
> >
> >
> 
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-numa" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]     [Devices]

  Powered by Linux