Re: [linux-next:master 8008/8345] mm/shrinker.c:100:1-7: preceding lock on line 83 (fwd)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Julia,

On 2023/9/29 22:33, Julia Lawall wrote:
Should shrinker_mutex be released on the error path?

Yes, and this has been fixed by https://lore.kernel.org/lkml/20230928141517.12164-1-zhengqi.arch@xxxxxxxxxxxxx/.

Thanks,
Qi
	


julia

---------- Forwarded message ----------
Date: Fri, 29 Sep 2023 21:31:25 +0800
From: kernel test robot <lkp@xxxxxxxxx>
To: oe-kbuild@xxxxxxxxxxxxxxx
Cc: lkp@xxxxxxxxx, Julia Lawall <julia.lawall@xxxxxxxx>
Subject: [linux-next:master 8008/8345] mm/shrinker.c:100:1-7: preceding lock on
     line 83

BCC: lkp@xxxxxxxxx
CC: oe-kbuild-all@xxxxxxxxxxxxxxx
CC: Linux Memory Management List <linux-mm@xxxxxxxxx>
TO: Qi Zheng <zhengqi.arch@xxxxxxxxxxxxx>
CC: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
CC: Linux Memory Management List <linux-mm@xxxxxxxxx>
CC: Muchun Song <songmuchun@xxxxxxxxxxxxx>

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:   df964ce9ef9fea10cf131bf6bad8658fde7956f6
commit: 3b0ec351e30dfbe71675deb22da8a9fe1894c87f [8008/8345] mm: shrinker: convert shrinker_rwsem to mutex
:::::: branch date: 9 hours ago
:::::: commit date: 3 days ago
config: x86_64-randconfig-103-20230927 (https://download.01.org/0day-ci/archive/20230929/202309292114.VMjkyBBq-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230929/202309292114.VMjkyBBq-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Reported-by: Julia Lawall <julia.lawall@xxxxxxxx>
| Closes: https://lore.kernel.org/r/202309292114.VMjkyBBq-lkp@xxxxxxxxx/

cocci warnings: (new ones prefixed by >>)
mm/shrinker.c:100:1-7: preceding lock on line 83

vim +100 mm/shrinker.c

2babd0d6e9cfca Qi Zheng 2023-09-11   76
2babd0d6e9cfca Qi Zheng 2023-09-11   77  int alloc_shrinker_info(struct mem_cgroup *memcg)
2babd0d6e9cfca Qi Zheng 2023-09-11   78  {
2babd0d6e9cfca Qi Zheng 2023-09-11   79  	struct shrinker_info *info;
b6884b5f15cf5a Qi Zheng 2023-09-11   80  	int nid, ret = 0;
b6884b5f15cf5a Qi Zheng 2023-09-11   81  	int array_size = 0;
2babd0d6e9cfca Qi Zheng 2023-09-11   82
3b0ec351e30dfb Qi Zheng 2023-09-11  @83  	mutex_lock(&shrinker_mutex);
b6884b5f15cf5a Qi Zheng 2023-09-11   84  	array_size = shrinker_unit_size(shrinker_nr_max);
2babd0d6e9cfca Qi Zheng 2023-09-11   85  	for_each_node(nid) {
b6884b5f15cf5a Qi Zheng 2023-09-11   86  		info = kvzalloc_node(sizeof(*info) + array_size, GFP_KERNEL, nid);
b6884b5f15cf5a Qi Zheng 2023-09-11   87  		if (!info)
b6884b5f15cf5a Qi Zheng 2023-09-11   88  			goto err;
2babd0d6e9cfca Qi Zheng 2023-09-11   89  		info->map_nr_max = shrinker_nr_max;
b6884b5f15cf5a Qi Zheng 2023-09-11   90  		if (shrinker_unit_alloc(info, NULL, nid))
b6884b5f15cf5a Qi Zheng 2023-09-11   91  			goto err;
2babd0d6e9cfca Qi Zheng 2023-09-11   92  		rcu_assign_pointer(memcg->nodeinfo[nid]->shrinker_info, info);
2babd0d6e9cfca Qi Zheng 2023-09-11   93  	}
3b0ec351e30dfb Qi Zheng 2023-09-11   94  	mutex_unlock(&shrinker_mutex);
2babd0d6e9cfca Qi Zheng 2023-09-11   95
2babd0d6e9cfca Qi Zheng 2023-09-11   96  	return ret;
b6884b5f15cf5a Qi Zheng 2023-09-11   97
b6884b5f15cf5a Qi Zheng 2023-09-11   98  err:
b6884b5f15cf5a Qi Zheng 2023-09-11   99  	free_shrinker_info(memcg);
b6884b5f15cf5a Qi Zheng 2023-09-11 @100  	return -ENOMEM;
2babd0d6e9cfca Qi Zheng 2023-09-11  101  }
2babd0d6e9cfca Qi Zheng 2023-09-11  102

:::::: The code at line 100 was first introduced by commit
:::::: b6884b5f15cf5acf6886ec0704d799035477ad7e mm: shrinker: add a secondary array for shrinker_info::{map, nr_deferred}

:::::: TO: Qi Zheng <zhengqi.arch@xxxxxxxxxxxxx>
:::::: CC: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux