Re: [PATCH] mm: rename and document alloc_pages_exact_node
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Vlastimil Babka <vbabka@xxxxxxx>
- Subject: Re: [PATCH] mm: rename and document alloc_pages_exact_node
- From: David Rientjes <rientjes@xxxxxxxxxx>
- Date: Tue, 21 Jul 2015 14:31:09 -0700 (PDT)
- Cc: linux-mm@xxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, linux-ia64@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, cbe-oss-dev@xxxxxxxxxxxxxxxx, kvm@xxxxxxxxxxxxxxx, Mel Gorman <mgorman@xxxxxxx>, Greg Thelen <gthelen@xxxxxxxxxx>, "Aneesh Kumar K.V" <aneesh.kumar@xxxxxxxxxxxxxxxxxx>, Christoph Lameter <cl@xxxxxxxxx>, Pekka Enberg <penberg@xxxxxxxxxx>, Joonsoo Kim <iamjoonsoo.kim@xxxxxxx>, Naoya Horiguchi <n-horiguchi@xxxxxxxxxxxxx>, Tony Luck <tony.luck@xxxxxxxxx>, Fenghua Yu <fenghua.yu@xxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>, Paul Mackerras <paulus@xxxxxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Gleb Natapov <gleb@xxxxxxxxxx>, Paolo Bonzini <pbonzini@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, Cliff Whickman <cpw@xxxxxxx>, Robin Holt <robinmholt@xxxxxxxxx>
- In-reply-to: <1437486951-19898-1-git-send-email-vbabka@suse.cz>
- List-id: <linux-ia64.vger.kernel.org>
- References: <1437486951-19898-1-git-send-email-vbabka@suse.cz>
- User-agent: Alpine 2.10 (DEB 1266 2009-07-14)
On Tue, 21 Jul 2015, Vlastimil Babka wrote:
> The function alloc_pages_exact_node() was introduced in 6484eb3e2a81 ("page
> allocator: do not check NUMA node ID when the caller knows the node is valid")
> as an optimized variant of alloc_pages_node(), that doesn't allow the node id
> to be -1. Unfortunately the name of the function can easily suggest that the
> allocation is restricted to the given node. In truth, the node is only
> preferred, unless __GFP_THISNODE is among the gfp flags.
>
> The misleading name has lead to mistakes in the past, see 5265047ac301 ("mm,
> thp: really limit transparent hugepage allocation to local node") and
> b360edb43f8e ("mm, mempolicy: migrate_to_node should only migrate to node").
>
> To prevent further mistakes, this patch renames the function to
> alloc_pages_prefer_node() and documents it together with alloc_pages_node().
>
alloc_pages_exact_node(), as you said, connotates that the allocation will
take place on that node or will fail. So why not go beyond this patch and
actually make alloc_pages_exact_node() set __GFP_THISNODE and then call
into a new alloc_pages_prefer_node(), which would be the current
alloc_pages_exact_node() implementation, and then fix up the callers?
--
To unsubscribe from this list: send the line "unsubscribe linux-ia64" 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]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]