linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes@cmpxchg.org>
To: Jingxiang Zeng <linuszeng@tencent.com>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org, mhocko@kernel.org,
	roman.gushchin@linux.dev, shakeel.butt@linux.dev,
	muchun.song@linux.dev, chengming.zhou@linux.dev,
	kasong@tencent.com, lkp@intel.com
Subject: Re: [PATCH V1] mm/list_lru: make the case where mlru is NULL as unlikely
Date: Thu, 27 Feb 2025 09:42:32 -0500	[thread overview]
Message-ID: <20250227144232.GE110982@cmpxchg.org> (raw)
In-Reply-To: <20250227082223.1173847-1-jingxiangzeng.cas@gmail.com>

On Thu, Feb 27, 2025 at 04:22:23PM +0800, Jingxiang Zeng wrote:
> From: Zeng Jingxiang <linuszeng@tencent.com>
> 
> 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@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202412290924.UTP7GH2Z-lkp@intel.com/
> Signed-off-by: Zeng Jingxiang <linuszeng@tencent.com>
> Suggested-by: Johannes Weiner <hannes@cmpxchg.org>

Acked-by: Johannes Weiner <hannes@cmpxchg.org>


  parent reply	other threads:[~2025-02-27 14:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-27  8:22 Jingxiang Zeng
2025-02-27 12:19 ` Muchun Song
2025-02-27 14:42 ` Johannes Weiner [this message]
2025-02-27 18:54 ` Shakeel Butt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250227144232.GE110982@cmpxchg.org \
    --to=hannes@cmpxchg.org \
    --cc=akpm@linux-foundation.org \
    --cc=chengming.zhou@linux.dev \
    --cc=kasong@tencent.com \
    --cc=linuszeng@tencent.com \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=mhocko@kernel.org \
    --cc=muchun.song@linux.dev \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeel.butt@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox