From: kernel test robot <lkp@intel.com>
To: wangxuewen <18810879172@163.com>,
akpm@linux-foundation.org, david@fromorbit.com,
qi.zheng@linux.dev, roman.gushchin@linux.dev,
muchun.song@linux.dev
Cc: oe-kbuild-all@lists.linux.dev, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, wangxuewen <18810879172@163.com>
Subject: Re: [PATCH v1] mm/shrinker: simplify shrinker_memcg_alloc() using guard()
Date: Fri, 15 May 2026 11:15:40 +0800 [thread overview]
Message-ID: <202605151100.lH0pRo2I-lkp@intel.com> (raw)
In-Reply-To: <20260512085546.368911-1-18810879172@163.com>
Hi wangxuewen,
kernel test robot noticed the following build warnings:
[auto build test WARNING on v7.1-rc3]
[also build test WARNING on linus/master next-20260508]
[cannot apply to akpm-mm/mm-everything]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/wangxuewen/mm-shrinker-simplify-shrinker_memcg_alloc-using-guard/20260515-014803
base: v7.1-rc3
patch link: https://lore.kernel.org/r/20260512085546.368911-1-18810879172%40163.com
patch subject: [PATCH v1] mm/shrinker: simplify shrinker_memcg_alloc() using guard()
config: sh-allyesconfig (https://download.01.org/0day-ci/archive/20260515/202605151100.lH0pRo2I-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260515/202605151100.lH0pRo2I-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605151100.lH0pRo2I-lkp@intel.com/
All warnings (new ones prefixed by >>):
mm/shrinker.c: In function 'shrinker_memcg_alloc':
>> mm/shrinker.c:218:17: warning: unused variable 'ret' [-Wunused-variable]
218 | int id, ret = -ENOMEM;
| ^~~
vim +/ret +218 mm/shrinker.c
96f7b2b9bbb1d68 Qi Zheng 2023-09-11 215
48a7a0996a0089f Qi Zheng 2023-09-11 216 static int shrinker_memcg_alloc(struct shrinker *shrinker)
96f7b2b9bbb1d68 Qi Zheng 2023-09-11 217 {
96f7b2b9bbb1d68 Qi Zheng 2023-09-11 @218 int id, ret = -ENOMEM;
96f7b2b9bbb1d68 Qi Zheng 2023-09-11 219
96f7b2b9bbb1d68 Qi Zheng 2023-09-11 220 if (mem_cgroup_disabled())
96f7b2b9bbb1d68 Qi Zheng 2023-09-11 221 return -ENOSYS;
03375203e1da8f4 Michal Koutný 2026-02-25 222 if (mem_cgroup_kmem_disabled() && !(shrinker->flags & SHRINKER_NONSLAB))
03375203e1da8f4 Michal Koutný 2026-02-25 223 return -ENOSYS;
96f7b2b9bbb1d68 Qi Zheng 2023-09-11 224
5ce02a6f6282d95 wangxuewen 2026-05-12 225 guard(mutex)(&shrinker_mutex);
96f7b2b9bbb1d68 Qi Zheng 2023-09-11 226 id = idr_alloc(&shrinker_idr, shrinker, 0, 0, GFP_KERNEL);
96f7b2b9bbb1d68 Qi Zheng 2023-09-11 227 if (id < 0)
5ce02a6f6282d95 wangxuewen 2026-05-12 228 return id;
96f7b2b9bbb1d68 Qi Zheng 2023-09-11 229
96f7b2b9bbb1d68 Qi Zheng 2023-09-11 230 if (id >= shrinker_nr_max) {
96f7b2b9bbb1d68 Qi Zheng 2023-09-11 231 if (expand_shrinker_info(id)) {
96f7b2b9bbb1d68 Qi Zheng 2023-09-11 232 idr_remove(&shrinker_idr, id);
5ce02a6f6282d95 wangxuewen 2026-05-12 233 return -ENOMEM;
96f7b2b9bbb1d68 Qi Zheng 2023-09-11 234 }
96f7b2b9bbb1d68 Qi Zheng 2023-09-11 235 }
96f7b2b9bbb1d68 Qi Zheng 2023-09-11 236 shrinker->id = id;
5ce02a6f6282d95 wangxuewen 2026-05-12 237 return 0;
96f7b2b9bbb1d68 Qi Zheng 2023-09-11 238 }
96f7b2b9bbb1d68 Qi Zheng 2023-09-11 239
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
prev parent reply other threads:[~2026-05-15 3:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 8:55 [PATCH v1] mm/shrinker: simplify shrinker_memcg_alloc() using guard() wangxuewen
2026-05-12 9:10 ` Muchun Song
2026-05-13 7:55 ` wangxuewen
2026-05-12 9:12 ` Qi Zheng
2026-05-15 3:15 ` kernel test robot [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=202605151100.lH0pRo2I-lkp@intel.com \
--to=lkp@intel.com \
--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=muchun.song@linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=qi.zheng@linux.dev \
--cc=roman.gushchin@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