CC: [email protected]
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: Wang Jianchao <[email protected]>
TO: [email protected]
TO: [email protected]
CC: [email protected]
CC: [email protected]

Hi Wang,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on ext4/dev]
[also build test WARNING on linux/master linus/master v5.14-rc3 next-20210723]
[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]

url:    
https://github.com/0day-ci/linux/commits/Wang-Jianchao/ext4-get-discard-out-of-jbd2-commit-context/20210724-154426
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: mips-randconfig-s031-20210726 (attached as .config)
compiler: mips-linux-gcc (GCC) 10.3.0
reproduce:
        wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # 
https://github.com/0day-ci/linux/commit/55a3430685e83709742c1fe2e0d4b347781bcc80
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review 
Wang-Jianchao/ext4-get-discard-out-of-jbd2-commit-context/20210724-154426
        git checkout 55a3430685e83709742c1fe2e0d4b347781bcc80
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross C=1 
CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=mips 
SHELL=/bin/bash fs/ext4/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


sparse warnings: (new ones prefixed by >>)
   command-line: note: in included file:
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
   builtin:0:0: sparse: this was the original definition
   builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
   builtin:0:0: sparse: this was the original definition
   fs/ext4/mballoc.c:989:9: sparse: sparse: context imbalance in 
'ext4_mb_choose_next_group_cr1' - wrong count at exit
   fs/ext4/mballoc.c:1259:9: sparse: sparse: context imbalance in 
'ext4_mb_init_cache' - different lock contexts for basic block
   fs/ext4/mballoc.c:2163:5: sparse: sparse: context imbalance in 
'ext4_mb_try_best_found' - different lock contexts for basic block
   fs/ext4/mballoc.c:2191:5: sparse: sparse: context imbalance in 
'ext4_mb_find_by_goal' - different lock contexts for basic block
   fs/ext4/mballoc.c:2478:12: sparse: sparse: context imbalance in 
'ext4_mb_good_group_nolock' - wrong count at exit
   fs/ext4/mballoc.c:2693:87: sparse: sparse: context imbalance in 
'ext4_mb_regular_allocator' - different lock contexts for basic block
   fs/ext4/mballoc.c:2967:13: sparse: sparse: context imbalance in 
'ext4_mb_seq_structs_summary_start' - wrong count at exit
   fs/ext4/mballoc.c:3039:13: sparse: sparse: context imbalance in 
'ext4_mb_seq_structs_summary_stop' - unexpected unlock
   fs/ext4/mballoc.c:3478:17: sparse: sparse: context imbalance in 
'ext4_mb_release' - different lock contexts for basic block
   fs/ext4/mballoc.c:3598:26: sparse: sparse: context imbalance in 
'ext4_free_data_in_buddy' - wrong count at exit
   fs/ext4/mballoc.c:3814:15: sparse: sparse: context imbalance in 
'ext4_mb_mark_diskspace_used' - different lock contexts for basic block
   fs/ext4/mballoc.c:3822:6: sparse: sparse: context imbalance in 
'ext4_mb_mark_bb' - different lock contexts for basic block
   fs/ext4/mballoc.c:4144:13: sparse: sparse: context imbalance in 
'ext4_discard_allocated_blocks' - different lock contexts for basic block
   fs/ext4/mballoc.c:4446:13: sparse: sparse: context imbalance in 
'ext4_mb_put_pa' - different lock contexts for basic block
   fs/ext4/mballoc.c:4783:9: sparse: sparse: context imbalance in 
'ext4_mb_discard_group_preallocations' - different lock contexts for basic block
   fs/ext4/mballoc.c:4936:9: sparse: sparse: context imbalance in 
'ext4_discard_preallocations' - different lock contexts for basic block
   fs/ext4/mballoc.c:5003:9: sparse: sparse: context imbalance in 
'ext4_mb_show_ac' - different lock contexts for basic block
   fs/ext4/mballoc.c:5231:9: sparse: sparse: context imbalance in 
'ext4_mb_discard_lg_preallocations' - different lock contexts for basic block
   fs/ext4/mballoc.c:5003:9: sparse: sparse: context imbalance in 
'ext4_mb_new_blocks' - different lock contexts for basic block
   fs/ext4/mballoc.c:5876:9: sparse: sparse: context imbalance in 
'ext4_free_blocks' - different lock contexts for basic block
   fs/ext4/mballoc.c:6176:15: sparse: sparse: context imbalance in 
'ext4_group_add_blocks' - different lock contexts for basic block
   fs/ext4/mballoc.c:6216:24: sparse: sparse: context imbalance in 
'ext4_trim_extent' - wrong count at exit
>> fs/ext4/mballoc.c:6266:9: sparse: sparse: context imbalance in 
>> 'ext4_try_to_trim_range' - different lock contexts for basic block
   fs/ext4/mballoc.c:6288:1: sparse: sparse: context imbalance in 
'ext4_trim_all_free' - different lock contexts for basic block
   fs/ext4/mballoc.c:6417:1: sparse: sparse: context imbalance in 
'ext4_mballoc_query_range' - different lock contexts for basic block

vim +/ext4_try_to_trim_range +6266 fs/ext4/mballoc.c

7360d1731e5dc7 Lukas Czerner 2010-10-27  6220  
55a3430685e837 Wang Jianchao 2021-07-24  6221  static int 
ext4_try_to_trim_range(struct super_block *sb,
55a3430685e837 Wang Jianchao 2021-07-24  6222           struct ext4_buddy *e4b, 
ext4_grpblk_t start,
55a3430685e837 Wang Jianchao 2021-07-24  6223           ext4_grpblk_t max, 
ext4_grpblk_t minblocks)
55a3430685e837 Wang Jianchao 2021-07-24  6224  {
55a3430685e837 Wang Jianchao 2021-07-24  6225   ext4_grpblk_t next, count, 
free_count;
55a3430685e837 Wang Jianchao 2021-07-24  6226   void *bitmap;
55a3430685e837 Wang Jianchao 2021-07-24  6227   int ret = 0;
55a3430685e837 Wang Jianchao 2021-07-24  6228  
55a3430685e837 Wang Jianchao 2021-07-24  6229   bitmap = e4b->bd_bitmap;
55a3430685e837 Wang Jianchao 2021-07-24  6230   start = 
(e4b->bd_info->bb_first_free > start) ?
55a3430685e837 Wang Jianchao 2021-07-24  6231           
e4b->bd_info->bb_first_free : start;
55a3430685e837 Wang Jianchao 2021-07-24  6232   count = 0;
55a3430685e837 Wang Jianchao 2021-07-24  6233   free_count = 0;
55a3430685e837 Wang Jianchao 2021-07-24  6234  
55a3430685e837 Wang Jianchao 2021-07-24  6235   while (start <= max) {
55a3430685e837 Wang Jianchao 2021-07-24  6236           start = 
mb_find_next_zero_bit(bitmap, max + 1, start);
55a3430685e837 Wang Jianchao 2021-07-24  6237           if (start > max)
55a3430685e837 Wang Jianchao 2021-07-24  6238                   break;
55a3430685e837 Wang Jianchao 2021-07-24  6239           next = 
mb_find_next_bit(bitmap, max + 1, start);
55a3430685e837 Wang Jianchao 2021-07-24  6240  
55a3430685e837 Wang Jianchao 2021-07-24  6241           if ((next - start) >= 
minblocks) {
55a3430685e837 Wang Jianchao 2021-07-24  6242                   ret = 
ext4_trim_extent(sb, start, next - start, e4b);
55a3430685e837 Wang Jianchao 2021-07-24  6243                   if (ret && ret 
!= -EOPNOTSUPP)
55a3430685e837 Wang Jianchao 2021-07-24  6244                           break;
55a3430685e837 Wang Jianchao 2021-07-24  6245                   ret = 0;
55a3430685e837 Wang Jianchao 2021-07-24  6246                   count += next - 
start;
55a3430685e837 Wang Jianchao 2021-07-24  6247           }
55a3430685e837 Wang Jianchao 2021-07-24  6248           free_count += next - 
start;
55a3430685e837 Wang Jianchao 2021-07-24  6249           start = next + 1;
55a3430685e837 Wang Jianchao 2021-07-24  6250  
55a3430685e837 Wang Jianchao 2021-07-24  6251           if 
(fatal_signal_pending(current)) {
55a3430685e837 Wang Jianchao 2021-07-24  6252                   count = 
-ERESTARTSYS;
55a3430685e837 Wang Jianchao 2021-07-24  6253                   break;
55a3430685e837 Wang Jianchao 2021-07-24  6254           }
55a3430685e837 Wang Jianchao 2021-07-24  6255  
55a3430685e837 Wang Jianchao 2021-07-24  6256           if (need_resched()) {
55a3430685e837 Wang Jianchao 2021-07-24  6257                   
ext4_unlock_group(sb, e4b->bd_group);
55a3430685e837 Wang Jianchao 2021-07-24  6258                   cond_resched();
55a3430685e837 Wang Jianchao 2021-07-24  6259                   
ext4_lock_group(sb, e4b->bd_group);
55a3430685e837 Wang Jianchao 2021-07-24  6260           }
55a3430685e837 Wang Jianchao 2021-07-24  6261  
55a3430685e837 Wang Jianchao 2021-07-24  6262           if 
((e4b->bd_info->bb_free - free_count) < minblocks)
55a3430685e837 Wang Jianchao 2021-07-24  6263                   break;
55a3430685e837 Wang Jianchao 2021-07-24  6264   }
55a3430685e837 Wang Jianchao 2021-07-24  6265  
55a3430685e837 Wang Jianchao 2021-07-24 @6266   return count;
55a3430685e837 Wang Jianchao 2021-07-24  6267  }
55a3430685e837 Wang Jianchao 2021-07-24  6268  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to