All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 4414/4552] mm/shrinker.c:100 alloc_shrinker_info() warn: inconsistent returns '&shrinker_mutex'.
@ 2023-09-17  1:35 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-09-17  1:35 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-17  1:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-17  1:35 [linux-next:master 4414/4552] mm/shrinker.c:100 alloc_shrinker_info() warn: inconsistent returns '&shrinker_mutex' kernel test robot

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.