lkml.org 
[lkml]   [2022]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [PATCH 1/4] mm/memcg: use NUMA_NO_NODE to indicate allocation from unspecified node
    On Tue 11-01-22 01:02:59, Wei Yang wrote:
    > Instead of use "-1", let's use NUMA_NO_NODE for consistency.
    >
    > Signed-off-by: Wei Yang <richard.weiyang@gmail.com>

    I am not really sure this is worth it. After the merge window I plan to
    post http://lkml.kernel.org/r/20211214100732.26335-1-mhocko@kernel.org.
    With that in place we can drop the check and a node rewrite so the net
    result will be a less and more straightforward code. If you agree I can
    add this with your s-o-b into my series:

    diff --git a/mm/memcontrol.c b/mm/memcontrol.c
    index 781605e92015..ed19a21ee14e 100644
    --- a/mm/memcontrol.c
    +++ b/mm/memcontrol.c
    @@ -5044,18 +5044,8 @@ struct mem_cgroup *mem_cgroup_from_id(unsigned short id)
    static int alloc_mem_cgroup_per_node_info(struct mem_cgroup *memcg, int node)
    {
    struct mem_cgroup_per_node *pn;
    - int tmp = node;
    - /*
    - * This routine is called against possible nodes.
    - * But it's BUG to call kmalloc() against offline node.
    - *
    - * TODO: this routine can waste much memory for nodes which will
    - * never be onlined. It's better to use memory hotplug callback
    - * function.
    - */
    - if (!node_state(node, N_NORMAL_MEMORY))
    - tmp = -1;
    - pn = kzalloc_node(sizeof(*pn), GFP_KERNEL, tmp);
    +
    + pn = kzalloc_node(sizeof(*pn), GFP_KERNEL, node);
    if (!pn)
    return 1;

    --
    Michal Hocko
    SUSE Labs
    \
     
     \ /
      Last update: 2022-01-11 09:41    [W:4.139 / U:0.132 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site