lkml.org 
[lkml]   [2022]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v6 14/16] mm: memcontrol: fix cannot alloc the maximum memcg ID
    Date
    The idr_alloc() does not include @max ID. So in the current implementation,
    the maximum memcg ID is 65534 instead of 65535. It seems a bug. So fix this.

    Signed-off-by: Muchun Song <songmuchun@bytedance.com>
    ---
    mm/memcontrol.c | 3 +--
    1 file changed, 1 insertion(+), 2 deletions(-)

    diff --git a/mm/memcontrol.c b/mm/memcontrol.c
    index 809dfa4b2abc..cbe6f9bb37bb 100644
    --- a/mm/memcontrol.c
    +++ b/mm/memcontrol.c
    @@ -5029,8 +5029,7 @@ static struct mem_cgroup *mem_cgroup_alloc(void)
    return ERR_PTR(error);

    memcg->id.id = idr_alloc(&mem_cgroup_idr, NULL,
    - 1, MEM_CGROUP_ID_MAX,
    - GFP_KERNEL);
    + 1, MEM_CGROUP_ID_MAX + 1, GFP_KERNEL);
    if (memcg->id.id < 0) {
    error = memcg->id.id;
    goto fail;
    --
    2.11.0
    \
     
     \ /
      Last update: 2022-02-28 13:25    [W:4.131 / U:0.476 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site