From: Muchun Song <muchun.song@linux.dev>
To: wangxuewen <18810879172@163.com>
Cc: akpm@linux-foundation.org, david@fromorbit.com,
qi.zheng@linux.dev, roman.gushchin@linux.dev, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, wangxuewen <wangxuewen@kylinos.cn>
Subject: Re: [PATCH v2] mm/shrinker: simplify shrinker_memcg_alloc() using guard()
Date: Wed, 13 May 2026 15:55:08 +0800 [thread overview]
Message-ID: <A8DEDC6F-B895-4BAF-9883-5A2318C5CD0B@linux.dev> (raw)
In-Reply-To: <20260513075214.2655710-1-18810879172@163.com>
> On May 13, 2026, at 15:52, wangxuewen <18810879172@163.com> wrote:
>
> Use guard(mutex) to automatically handle shrinker_mutex locking and
> unlocking in shrinker_memcg_alloc(). This removes the explicit
> mutex_unlock() call, the goto-based error path, and the redundant
> ret variable, resulting in cleaner and more concise code.
>
> v2:
> - Drop unused 'ret' variable to avoid compiler warning (Muchun Song).
Changelog should not be placed here.
>
> Signed-off-by: wangxuewen <wangxuewen@kylinos.cn>
> ---
The right place.
> mm/shrinker.c | 13 +++++--------
> 1 file changed, 5 insertions(+), 8 deletions(-)
The change looks good to me.
Acked-by: Muchun Song <muchun.song@linux.dev>
Thanks.
prev parent reply other threads:[~2026-05-13 7:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-13 7:52 [PATCH v2] mm/shrinker: simplify shrinker_memcg_alloc() using guard() wangxuewen
2026-05-13 7:55 ` Muchun Song [this message]
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=A8DEDC6F-B895-4BAF-9883-5A2318C5CD0B@linux.dev \
--to=muchun.song@linux.dev \
--cc=18810879172@163.com \
--cc=akpm@linux-foundation.org \
--cc=david@fromorbit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=qi.zheng@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=wangxuewen@kylinos.cn \
/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