linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* get_mempolicy(2) type mismatch
@ 2016-05-03  0:58 Jörn Engel
  2016-05-03  1:04 ` Jörn Engel
  2016-06-03  2:19 ` Michael Kerrisk (man-pages)
  0 siblings, 2 replies; 4+ messages in thread
From: Jörn Engel @ 2016-05-03  0:58 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages)
  Cc: linux-man-u79uwXL29TY76Z2rM5mHXA,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA

The manpage seems to have the wrong type for "addr".

Manpage:
       int get_mempolicy(int *mode, unsigned long *nodemask,
                         unsigned long maxnode, unsigned long addr,
                         unsigned long flags);

/usr/include/numaif.h:
extern long get_mempolicy(int *policy, const unsigned long *nmask,
                        unsigned long maxnode, void *addr, int flags);

Jörn

--
The more any quantitative social indicator is used for social decision-making,
the more subject it will be to corruption pressures and the more apt it will
be to distort and corrupt the social processes it is intended to monitor.
-- Campbell's law
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: get_mempolicy(2) type mismatch
  2016-05-03  0:58 get_mempolicy(2) type mismatch Jörn Engel
@ 2016-05-03  1:04 ` Jörn Engel
  2016-06-03  2:34   ` Michael Kerrisk (man-pages)
  2016-06-03  2:19 ` Michael Kerrisk (man-pages)
  1 sibling, 1 reply; 4+ messages in thread
From: Jörn Engel @ 2016-05-03  1:04 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

[ Removed linux-fsdevel - shouldn't have been on Cc: ]

On Mon, May 02, 2016 at 05:58:21PM -0700, Jörn Engel wrote:
> The manpage seems to have the wrong type for "addr".
> 
> Manpage:
>        int get_mempolicy(int *mode, unsigned long *nodemask,
>                          unsigned long maxnode, unsigned long addr,
>                          unsigned long flags);
> 
> /usr/include/numaif.h:
> extern long get_mempolicy(int *policy, const unsigned long *nmask,
>                         unsigned long maxnode, void *addr, int flags);

Found another problem.

"is always rounded to a multiple of sizeof(unsigned long)"

I suspect the rounding should be done to a multiple of BITS_PER_LONG, or
"sizeof(unsigned long) * 8".

Jörn, wondering how many others actually care about NUMA

--
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it.
-- Brian W. Kernighan
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: get_mempolicy(2) type mismatch
  2016-05-03  0:58 get_mempolicy(2) type mismatch Jörn Engel
  2016-05-03  1:04 ` Jörn Engel
@ 2016-06-03  2:19 ` Michael Kerrisk (man-pages)
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Kerrisk (man-pages) @ 2016-06-03  2:19 UTC (permalink / raw)
  To: Daniel Borkmann; +Cc: mtk.manpages, linux-man, linux-fsdevel

On 05/02/2016 07:58 PM, Jörn Engel wrote:
> The manpage seems to have the wrong type for "addr".
> 
> Manpage:
>        int get_mempolicy(int *mode, unsigned long *nodemask,
>                          unsigned long maxnode, unsigned long addr,
>                          unsigned long flags);
> 
> /usr/include/numaif.h:
> extern long get_mempolicy(int *policy, const unsigned long *nmask,
>                         unsigned long maxnode, void *addr, int flags);
> 
> Jörn

Hmmm -- it seems that the numactl package headers differ from the 
kernel headers (where the man page is accurate). But, it seems like 
the man page should reflect what's in the user-space header file, so 
I fixed it to be 

    void *addr

Cheers,

Michael

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: get_mempolicy(2) type mismatch
  2016-05-03  1:04 ` Jörn Engel
@ 2016-06-03  2:34   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Kerrisk (man-pages) @ 2016-06-03  2:34 UTC (permalink / raw)
  To: Jörn Engel
  Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
	linux-man-u79uwXL29TY76Z2rM5mHXA

Hi Jörn,

On 05/02/2016 08:04 PM, Jörn Engel wrote:
> [ Removed linux-fsdevel - shouldn't have been on Cc: ]
> 
> On Mon, May 02, 2016 at 05:58:21PM -0700, Jörn Engel wrote:
>> The manpage seems to have the wrong type for "addr".
>>
>> Manpage:
>>        int get_mempolicy(int *mode, unsigned long *nodemask,
>>                          unsigned long maxnode, unsigned long addr,
>>                          unsigned long flags);
>>
>> /usr/include/numaif.h:
>> extern long get_mempolicy(int *policy, const unsigned long *nmask,
>>                         unsigned long maxnode, void *addr, int flags);
> 
> Found another problem.
> 
> "is always rounded to a multiple of sizeof(unsigned long)"
> 
> I suspect the rounding should be done to a multiple of BITS_PER_LONG, or
> "sizeof(unsigned long) * 8".

It looks to me like you are right, but with reports like this, it's
really helpful if you provide me some context on why you drew the
conclusion. That makes things much easier to check.

For example, you could cite pieces of code such as the following in
mm/mempolicy.c::COMPAT_SYSCALL_DEFINE5(get_mempolicy):

        nr_bits = min_t(unsigned long, maxnode-1, MAX_NUMNODES);
        alloc_size = ALIGN(nr_bits, BITS_PER_LONG) / 8;

> Jörn, wondering how many others actually care about NUMA

Intersection of the set of people who care about both
NUMA and docs is evidently small... Thanks for taking care.

Cheers,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-06-03  2:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-03  0:58 get_mempolicy(2) type mismatch Jörn Engel
2016-05-03  1:04 ` Jörn Engel
2016-06-03  2:34   ` Michael Kerrisk (man-pages)
2016-06-03  2:19 ` Michael Kerrisk (man-pages)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).