From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [linux-next:master 4414/4552] mm/shrinker.c:100 alloc_shrinker_info() warn: inconsistent returns '&shrinker_mutex'.
Date: Sun, 17 Sep 2023 09:35:06 +0800 [thread overview]
Message-ID: <202309170953.GA2Arnp4-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Qi Zheng <zhengqi.arch@bytedance.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
Hi Qi,
FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: dfa449a58323de195773cf928d99db4130702bf7
commit: 9f8a23c37edc5a7c1e69abe2729e813cff242990 [4414/4552] mm: shrinker: convert shrinker_rwsem to mutex
:::::: branch date: 2 days ago
:::::: commit date: 5 days ago
config: i386-randconfig-141-20230916 (https://download.01.org/0day-ci/archive/20230917/202309170953.GA2Arnp4-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230917/202309170953.GA2Arnp4-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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202309170953.GA2Arnp4-lkp@intel.com/
smatch warnings:
mm/shrinker.c:100 alloc_shrinker_info() warn: inconsistent returns '&shrinker_mutex'.
vim +100 mm/shrinker.c
208d1e238b7746 Qi Zheng 2023-09-11 76
208d1e238b7746 Qi Zheng 2023-09-11 77 int alloc_shrinker_info(struct mem_cgroup *memcg)
208d1e238b7746 Qi Zheng 2023-09-11 78 {
208d1e238b7746 Qi Zheng 2023-09-11 79 struct shrinker_info *info;
4142a29db95101 Qi Zheng 2023-09-11 80 int nid, ret = 0;
4142a29db95101 Qi Zheng 2023-09-11 81 int array_size = 0;
208d1e238b7746 Qi Zheng 2023-09-11 82
9f8a23c37edc5a Qi Zheng 2023-09-11 83 mutex_lock(&shrinker_mutex);
4142a29db95101 Qi Zheng 2023-09-11 84 array_size = shrinker_unit_size(shrinker_nr_max);
208d1e238b7746 Qi Zheng 2023-09-11 85 for_each_node(nid) {
4142a29db95101 Qi Zheng 2023-09-11 86 info = kvzalloc_node(sizeof(*info) + array_size, GFP_KERNEL, nid);
4142a29db95101 Qi Zheng 2023-09-11 87 if (!info)
4142a29db95101 Qi Zheng 2023-09-11 88 goto err;
208d1e238b7746 Qi Zheng 2023-09-11 89 info->map_nr_max = shrinker_nr_max;
4142a29db95101 Qi Zheng 2023-09-11 90 if (shrinker_unit_alloc(info, NULL, nid))
4142a29db95101 Qi Zheng 2023-09-11 91 goto err;
208d1e238b7746 Qi Zheng 2023-09-11 92 rcu_assign_pointer(memcg->nodeinfo[nid]->shrinker_info, info);
208d1e238b7746 Qi Zheng 2023-09-11 93 }
9f8a23c37edc5a Qi Zheng 2023-09-11 94 mutex_unlock(&shrinker_mutex);
208d1e238b7746 Qi Zheng 2023-09-11 95
208d1e238b7746 Qi Zheng 2023-09-11 96 return ret;
4142a29db95101 Qi Zheng 2023-09-11 97
4142a29db95101 Qi Zheng 2023-09-11 98 err:
4142a29db95101 Qi Zheng 2023-09-11 99 free_shrinker_info(memcg);
4142a29db95101 Qi Zheng 2023-09-11 @100 return -ENOMEM;
208d1e238b7746 Qi Zheng 2023-09-11 101 }
208d1e238b7746 Qi Zheng 2023-09-11 102
:::::: The code at line 100 was first introduced by commit
:::::: 4142a29db95101d66681cc7cdf856f8c8e4f2878 mm: shrinker: add a secondary array for shrinker_info::{map, nr_deferred}
:::::: TO: Qi Zheng <zhengqi.arch@bytedance.com>
:::::: CC: Andrew Morton <akpm@linux-foundation.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2023-09-17 1:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202309170953.GA2Arnp4-lkp@intel.com \
--to=lkp@intel.com \
--cc=error27@gmail.com \
--cc=oe-kbuild@lists.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.