CC: [email protected]
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: Harshad Shirwadkar <[email protected]>

Hi Harshad,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on ext4/dev]
[also build test WARNING on next-20200820]
[cannot apply to tip/perf/core tytso-fscrypt/master v5.9-rc1]
[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/Harshad-Shirwadkar/ext4-add-free-space-extent-based-allocator/20200821-095647
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
:::::: branch date: 2 hours ago
:::::: commit date: 2 hours ago
config: x86_64-randconfig-s021-20200820 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-191-g10164920-dirty
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

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


sparse warnings: (new ones prefixed by >>)

   fs/ext4/mballoc.c:884:23: sparse: sparse: symbol 
'ext4_mb_frsp_search_by_off' was not declared. Should it be static?
   fs/ext4/mballoc.c:909:5: sparse: sparse: symbol 
'ext4_mb_frsp_node_can_merge' was not declared. Should it be static?
   fs/ext4/mballoc.c:926:5: sparse: sparse: symbol 'ext4_mb_frsp_add_region' 
was not declared. Should it be static?
   fs/ext4/mballoc.c:977:5: sparse: sparse: symbol 'ext4_mb_frsp_free_blocks' 
was not declared. Should it be static?
   fs/ext4/mballoc.c:997:5: sparse: sparse: symbol 'ext4_mb_frsp_bb_to_tree' 
was not declared. Should it be static?
   fs/ext4/mballoc.c:1029:5: sparse: sparse: symbol 'ext4_mb_frsp_load' was not 
declared. Should it be static?
   fs/ext4/mballoc.c:1420:5: sparse: sparse: symbol 
'ext4_mb_init_freespace_trees' was not declared. Should it be static?
   fs/ext4/mballoc.c:1707:9: sparse: sparse: context imbalance in 
'ext4_mb_init_cache' - different lock contexts for basic block
>> fs/ext4/mballoc.c:2259:13: sparse: sparse: context imbalance in 
>> 'mb_free_blocks' - different lock contexts for basic block
   fs/ext4/mballoc.c:2711:5: sparse: sparse: context imbalance in 
'ext4_mb_try_best_found' - different lock contexts for basic block
   fs/ext4/mballoc.c:2739:5: sparse: sparse: context imbalance in 
'ext4_mb_find_by_goal' - different lock contexts for basic block
   fs/ext4/mballoc.c:3026:12: sparse: sparse: context imbalance in 
'ext4_mb_good_group_nolock' - wrong count at exit
   fs/ext4/mballoc.c:3237:49: sparse: sparse: context imbalance in 
'ext4_mb_regular_allocator' - different lock contexts for basic block
   fs/ext4/mballoc.c:3847:17: sparse: sparse: context imbalance in 
'ext4_mb_release' - different lock contexts for basic block
   fs/ext4/mballoc.c: note: in included file (through include/linux/wait.h, 
include/linux/wait_bit.h, include/linux/fs.h, fs/ext4/ext4_jbd2.h):
   include/linux/spinlock.h:393:9: sparse: sparse: context imbalance in 
'ext4_free_data_in_buddy' - wrong count at exit
   fs/ext4/mballoc.c:4188:15: sparse: sparse: context imbalance in 
'ext4_mb_mark_diskspace_used' - different lock contexts for basic block
   fs/ext4/mballoc.c:4439:13: sparse: sparse: context imbalance in 
'ext4_discard_allocated_blocks' - different lock contexts for basic block
   fs/ext4/mballoc.c:5082:24: sparse: sparse: context imbalance in 
'ext4_mb_discard_group_preallocations' - different lock contexts for basic block
   fs/ext4/mballoc.c:5237:9: sparse: sparse: context imbalance in 
'ext4_discard_preallocations' - different lock contexts for basic block
   fs/ext4/mballoc.c:5543:9: sparse: sparse: context imbalance in 
'ext4_mb_discard_lg_preallocations' - different lock contexts for basic block
   fs/ext4/mballoc.c:6088:9: sparse: sparse: context imbalance in 
'ext4_free_blocks' - different lock contexts for basic block
   fs/ext4/mballoc.c:6388:15: sparse: sparse: context imbalance in 
'ext4_group_add_blocks' - different lock contexts for basic block
   fs/ext4/mballoc.c:6429:24: sparse: sparse: context imbalance in 
'ext4_trim_extent' - wrong count at exit
>> include/linux/spinlock.h:393:9: sparse: sparse: context imbalance in 
>> 'ext4_trim_all_free' - unexpected unlock
   fs/ext4/mballoc.c:6681:28: sparse: sparse: context imbalance in 
'ext4_mballoc_query_range' - different lock contexts for basic block

# 
https://github.com/0day-ci/linux/commit/db488bc7c0ef14f7ea22209b8faaddaffcfabbd5
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review 
Harshad-Shirwadkar/ext4-add-free-space-extent-based-allocator/20200821-095647
git checkout db488bc7c0ef14f7ea22209b8faaddaffcfabbd5
vim +/mb_free_blocks +2259 fs/ext4/mballoc.c

eabe0444df90b0c Andrey Sidorov   2013-04-09  2258  
7e5a8cdd843b7af Shen Feng        2008-07-13 @2259  static void 
mb_free_blocks(struct inode *inode, struct ext4_buddy *e4b,
c9de560ded61faa Alex Tomas       2008-01-29  2260                          int 
first, int count)
c9de560ded61faa Alex Tomas       2008-01-29  2261  {
eabe0444df90b0c Andrey Sidorov   2013-04-09  2262       int left_is_free = 0;
eabe0444df90b0c Andrey Sidorov   2013-04-09  2263       int right_is_free = 0;
eabe0444df90b0c Andrey Sidorov   2013-04-09  2264       int block;
eabe0444df90b0c Andrey Sidorov   2013-04-09  2265       int last = first + 
count - 1;
c9de560ded61faa Alex Tomas       2008-01-29  2266       struct super_block *sb 
= e4b->bd_sb;
c9de560ded61faa Alex Tomas       2008-01-29  2267  
c99d1e6e83b0674 Theodore Ts'o    2014-08-23  2268       if (WARN_ON(count == 0))
c99d1e6e83b0674 Theodore Ts'o    2014-08-23  2269               return;
eabe0444df90b0c Andrey Sidorov   2013-04-09  2270       BUG_ON(last >= 
(sb->s_blocksize << 3));
bc8e67409ccdcff Vincent Minet    2009-05-15  2271       
assert_spin_locked(ext4_group_lock_ptr(sb, e4b->bd_group));
163a203ddb36c36 Darrick J. Wong  2013-08-28  2272       /* Don't bother if the 
block group is corrupt. */
163a203ddb36c36 Darrick J. Wong  2013-08-28  2273       if 
(unlikely(EXT4_MB_GRP_BBITMAP_CORRUPT(e4b->bd_info)))
163a203ddb36c36 Darrick J. Wong  2013-08-28  2274               return;
163a203ddb36c36 Darrick J. Wong  2013-08-28  2275  
c9de560ded61faa Alex Tomas       2008-01-29  2276       mb_check_buddy(e4b);
c9de560ded61faa Alex Tomas       2008-01-29  2277       
mb_free_blocks_double(inode, e4b, first, count);
c9de560ded61faa Alex Tomas       2008-01-29  2278  
07b5b8e1ac4004b Ritesh Harjani   2020-05-20  2279       
this_cpu_inc(discard_pa_seq);
c9de560ded61faa Alex Tomas       2008-01-29  2280       e4b->bd_info->bb_free 
+= count;
c9de560ded61faa Alex Tomas       2008-01-29  2281       if (first < 
e4b->bd_info->bb_first_free)
c9de560ded61faa Alex Tomas       2008-01-29  2282               
e4b->bd_info->bb_first_free = first;
c9de560ded61faa Alex Tomas       2008-01-29  2283  
db488bc7c0ef14f Yuexin Li        2020-08-20  2284       if 
(ext4_mb_frsp_on(sb)) {
db488bc7c0ef14f Yuexin Li        2020-08-20  2285               ext4_grpblk_t 
first_blk = EXT4_C2B(EXT4_SB(sb), first) +
db488bc7c0ef14f Yuexin Li        2020-08-20  2286                       
ext4_group_first_block_no(sb, e4b->bd_group);
db488bc7c0ef14f Yuexin Li        2020-08-20  2287  
db488bc7c0ef14f Yuexin Li        2020-08-20  2288               
ext4_unlock_group(sb, e4b->bd_group);
db488bc7c0ef14f Yuexin Li        2020-08-20  2289               
ext4_mb_frsp_free_blocks(sb, e4b->bd_group, first_blk, count);
db488bc7c0ef14f Yuexin Li        2020-08-20  2290               
ext4_lock_group(sb, e4b->bd_group);
db488bc7c0ef14f Yuexin Li        2020-08-20  2291               return;
db488bc7c0ef14f Yuexin Li        2020-08-20  2292       }
db488bc7c0ef14f Yuexin Li        2020-08-20  2293  
eabe0444df90b0c Andrey Sidorov   2013-04-09  2294       /* access memory 
sequentially: check left neighbour,
eabe0444df90b0c Andrey Sidorov   2013-04-09  2295        * clear range and then 
check right neighbour
eabe0444df90b0c Andrey Sidorov   2013-04-09  2296        */
c9de560ded61faa Alex Tomas       2008-01-29  2297       if (first != 0)
eabe0444df90b0c Andrey Sidorov   2013-04-09  2298               left_is_free = 
!mb_test_bit(first - 1, e4b->bd_bitmap);
eabe0444df90b0c Andrey Sidorov   2013-04-09  2299       block = 
mb_test_and_clear_bits(e4b->bd_bitmap, first, count);
eabe0444df90b0c Andrey Sidorov   2013-04-09  2300       if (last + 1 < 
EXT4_SB(sb)->s_mb_maxs[0])
eabe0444df90b0c Andrey Sidorov   2013-04-09  2301               right_is_free = 
!mb_test_bit(last + 1, e4b->bd_bitmap);
c9de560ded61faa Alex Tomas       2008-01-29  2302  
eabe0444df90b0c Andrey Sidorov   2013-04-09  2303       if (unlikely(block != 
-1)) {
e43bb4e612b402a Namjae Jeon      2014-06-26  2304               struct 
ext4_sb_info *sbi = EXT4_SB(sb);
c9de560ded61faa Alex Tomas       2008-01-29  2305               ext4_fsblk_t 
blocknr;
5661bd6861b7490 Akinobu Mita     2010-03-03  2306  
5661bd6861b7490 Akinobu Mita     2010-03-03  2307               blocknr = 
ext4_group_first_block_no(sb, e4b->bd_group);
49598e04b5a1c36 Jun Piao         2018-01-11  2308               blocknr += 
EXT4_C2B(sbi, block);
5d1b1b3f492f869 Aneesh Kumar K.V 2009-01-05  2309               
ext4_grp_locked_error(sb, e4b->bd_group,
e29136f80e775b0 Theodore Ts'o    2010-06-29  2310                               
      inode ? inode->i_ino : 0,
e29136f80e775b0 Theodore Ts'o    2010-06-29  2311                               
      blocknr,
e29136f80e775b0 Theodore Ts'o    2010-06-29  2312                               
      "freeing already freed block "
163a203ddb36c36 Darrick J. Wong  2013-08-28  2313                               
      "(bit %u); block bitmap corrupt.",
163a203ddb36c36 Darrick J. Wong  2013-08-28  2314                               
      block);
db79e6d1fb1f715 Wang Shilong     2018-05-12  2315               
ext4_mark_group_bitmap_corrupted(sb, e4b->bd_group,
db79e6d1fb1f715 Wang Shilong     2018-05-12  2316                               
EXT4_GROUP_INFO_BBITMAP_CORRUPT);
eabe0444df90b0c Andrey Sidorov   2013-04-09  2317               
mb_regenerate_buddy(e4b);
eabe0444df90b0c Andrey Sidorov   2013-04-09  2318               goto done;
c9de560ded61faa Alex Tomas       2008-01-29  2319       }
c9de560ded61faa Alex Tomas       2008-01-29  2320  
eabe0444df90b0c Andrey Sidorov   2013-04-09  2321       /* let's maintain 
fragments counter */
eabe0444df90b0c Andrey Sidorov   2013-04-09  2322       if (left_is_free && 
right_is_free)
eabe0444df90b0c Andrey Sidorov   2013-04-09  2323               
e4b->bd_info->bb_fragments--;
eabe0444df90b0c Andrey Sidorov   2013-04-09  2324       else if (!left_is_free 
&& !right_is_free)
eabe0444df90b0c Andrey Sidorov   2013-04-09  2325               
e4b->bd_info->bb_fragments++;
c9de560ded61faa Alex Tomas       2008-01-29  2326  
eabe0444df90b0c Andrey Sidorov   2013-04-09  2327       /* buddy[0] == 
bd_bitmap is a special case, so handle
eabe0444df90b0c Andrey Sidorov   2013-04-09  2328        * it right away and 
let mb_buddy_mark_free stay free of
eabe0444df90b0c Andrey Sidorov   2013-04-09  2329        * zero order checks.
eabe0444df90b0c Andrey Sidorov   2013-04-09  2330        * Check if neighbours 
are to be coaleasced,
eabe0444df90b0c Andrey Sidorov   2013-04-09  2331        * adjust bitmap 
bb_counters and borders appropriately.
eabe0444df90b0c Andrey Sidorov   2013-04-09  2332        */
eabe0444df90b0c Andrey Sidorov   2013-04-09  2333       if (first & 1) {
eabe0444df90b0c Andrey Sidorov   2013-04-09  2334               first += 
!left_is_free;
eabe0444df90b0c Andrey Sidorov   2013-04-09  2335               
e4b->bd_info->bb_counters[0] += left_is_free ? -1 : 1;
eabe0444df90b0c Andrey Sidorov   2013-04-09  2336       }
eabe0444df90b0c Andrey Sidorov   2013-04-09  2337       if (!(last & 1)) {
eabe0444df90b0c Andrey Sidorov   2013-04-09  2338               last -= 
!right_is_free;
eabe0444df90b0c Andrey Sidorov   2013-04-09  2339               
e4b->bd_info->bb_counters[0] += right_is_free ? -1 : 1;
c9de560ded61faa Alex Tomas       2008-01-29  2340       }
c9de560ded61faa Alex Tomas       2008-01-29  2341  
eabe0444df90b0c Andrey Sidorov   2013-04-09  2342       if (first <= last)
eabe0444df90b0c Andrey Sidorov   2013-04-09  2343               
mb_buddy_mark_free(e4b, first >> 1, last >> 1);
c9de560ded61faa Alex Tomas       2008-01-29  2344  
eabe0444df90b0c Andrey Sidorov   2013-04-09  2345  done:
8a57d9d61a6e361 Curt Wohlgemuth  2010-05-16  2346       
mb_set_largest_free_order(sb, e4b->bd_info);
c9de560ded61faa Alex Tomas       2008-01-29  2347       mb_check_buddy(e4b);
c9de560ded61faa Alex Tomas       2008-01-29  2348  }
c9de560ded61faa Alex Tomas       2008-01-29  2349  

---
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