Re: memory leaks in numa_run_on_node

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

 



On Wed, Jun 26, 2013 at 08:53:36PM -0400, Andrew J. Schorr wrote:
> I tried calling set_mempolicy directly for this trivial case, but I get
> EINVAL when I try:
> 
>    {
>       unsigned long mask = 1;
>       set_mempolicy(MPOL_BIND, &mask, 1);
>    }
> 
> Increasing the 3rd arg from 1 to 2 seems to solve the problem, but I cannot
> understand why from "man 2 set_mempolicy".

In linux-3.6/mm/mempolicy.c:get_nodes(), maxnode is decremented immediately.  I
cannot see from the man page why that is done, but it seems to explain the
problem I found.  I guess this explains why libnuma.c:setpol adds 1 to the
bitmask size.  But I still cannot see where this odd behavior is documented in
the man page.  If anybody can enlighten me, I'd appreciate it.

Perhaps this is why it is not recommended to use this API directly. :-)

Regards,
Andy
--
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