Re: [PATCH V1] mm/list_lru: make the case where mlru is NULL as unlikely

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

 



On Thu, Feb 27, 2025 at 04:22:23PM +0800, Jingxiang Zeng wrote:
> From: Zeng Jingxiang <linuszeng@xxxxxxxxxxx>
> 
> In the following memcg_list_lru_alloc() function, mlru here is almost
> always NULL, so in most cases this should save a function call, mark
> mlru as unlikely to optimize the code, and reusing the mlru for the
> next attempt when the tree insertion fails.
>         do {
>                 xas_lock_irqsave(&xas, flags);
>                 if (!xas_load(&xas) && !css_is_dying(&pos->css)) {
>                         xas_store(&xas, mlru);
>                         if (!xas_error(&xas))
>                                 mlru = NULL;
>                 }
>                 xas_unlock_irqrestore(&xas, flags);
>         } while (xas_nomem(&xas, GFP_KERNEL));
> >       if (mlru)
>                 kfree(mlru);
> 
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: https://lore.kernel.org/oe-kbuild-all/202412290924.UTP7GH2Z-lkp@xxxxxxxxx/
> Signed-off-by: Zeng Jingxiang <linuszeng@xxxxxxxxxxx>
> Suggested-by: Johannes Weiner <hannes@xxxxxxxxxxx>

Acked-by: Shakeel Butt <shakeel.butt@xxxxxxxxx>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux