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: 4 hours ago
:::::: commit date: 4 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:808:6: sparse: sparse: symbol 'ext4_mb_frsp_meta_reinsert' 
was not declared. Should it be static?
   fs/ext4/mballoc.c:920:23: sparse: sparse: symbol 
'ext4_mb_frsp_search_by_off' was not declared. Should it be static?
   fs/ext4/mballoc.c:945:5: sparse: sparse: symbol 
'ext4_mb_frsp_node_can_merge' was not declared. Should it be static?
   fs/ext4/mballoc.c:962:5: sparse: sparse: symbol 'ext4_mb_frsp_add_region' 
was not declared. Should it be static?
   fs/ext4/mballoc.c:1014:5: sparse: sparse: symbol 'ext4_mb_frsp_free_blocks' 
was not declared. Should it be static?
   fs/ext4/mballoc.c:1034:5: sparse: sparse: symbol 'ext4_mb_frsp_bb_to_tree' 
was not declared. Should it be static?
   fs/ext4/mballoc.c:1066:5: sparse: sparse: symbol 'ext4_mb_frsp_load' was not 
declared. Should it be static?
   fs/ext4/mballoc.c:1587:5: sparse: sparse: symbol 
'ext4_mb_init_freespace_trees' was not declared. Should it be static?
>> fs/ext4/mballoc.c:1366:5: sparse: sparse: context imbalance in 
>> 'ext4_mb_frsp_optimize' - different lock contexts for basic block
   fs/ext4/mballoc.c:1885:9: sparse: sparse: context imbalance in 
'ext4_mb_init_cache' - different lock contexts for basic block
   fs/ext4/mballoc.c:2437:13: sparse: sparse: context imbalance in 
'mb_free_blocks' - different lock contexts for basic block
   fs/ext4/mballoc.c:2889:5: sparse: sparse: context imbalance in 
'ext4_mb_try_best_found' - different lock contexts for basic block
   fs/ext4/mballoc.c:2917:5: sparse: sparse: context imbalance in 
'ext4_mb_find_by_goal' - different lock contexts for basic block
   fs/ext4/mballoc.c:3204:12: sparse: sparse: context imbalance in 
'ext4_mb_good_group_nolock' - wrong count at exit
   fs/ext4/mballoc.c:3425:49: sparse: sparse: context imbalance in 
'ext4_mb_regular_allocator' - different lock contexts for basic block
   fs/ext4/mballoc.c:4035: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:4376:15: sparse: sparse: context imbalance in 
'ext4_mb_mark_diskspace_used' - different lock contexts for basic block
   fs/ext4/mballoc.c:4627:13: sparse: sparse: context imbalance in 
'ext4_discard_allocated_blocks' - different lock contexts for basic block
   fs/ext4/mballoc.c:5270:24: sparse: sparse: context imbalance in 
'ext4_mb_discard_group_preallocations' - different lock contexts for basic block
   fs/ext4/mballoc.c:5425:9: sparse: sparse: context imbalance in 
'ext4_discard_preallocations' - different lock contexts for basic block
   fs/ext4/mballoc.c:5731:9: sparse: sparse: context imbalance in 
'ext4_mb_discard_lg_preallocations' - different lock contexts for basic block
   fs/ext4/mballoc.c:6276:9: sparse: sparse: context imbalance in 
'ext4_free_blocks' - different lock contexts for basic block
   fs/ext4/mballoc.c:6576:15: sparse: sparse: context imbalance in 
'ext4_group_add_blocks' - different lock contexts for basic block
   fs/ext4/mballoc.c:6617: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:6869:28: sparse: sparse: context imbalance in 
'ext4_mballoc_query_range' - different lock contexts for basic block

# 
https://github.com/0day-ci/linux/commit/832851db4656a8d433083fc076a53db955d43020
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 832851db4656a8d433083fc076a53db955d43020
vim +/ext4_mb_frsp_optimize +1366 fs/ext4/mballoc.c

832851db4656a8d Harshad Shirwadkar 2020-08-20  1359  
832851db4656a8d Harshad Shirwadkar 2020-08-20  1360  /*
832851db4656a8d Harshad Shirwadkar 2020-08-20  1361   * Optimize allocation 
request. This function _tries_ to lookup the meta-tree
832851db4656a8d Harshad Shirwadkar 2020-08-20  1362   * and if it can optimize 
the search in any way, it does so. As a result
832851db4656a8d Harshad Shirwadkar 2020-08-20  1363   * this function returns 
1, if the optimization was performed. In this case,
832851db4656a8d Harshad Shirwadkar 2020-08-20  1364   * the caller should 
restart the search from tree mentioned in *tree_idx.
832851db4656a8d Harshad Shirwadkar 2020-08-20  1365   */
832851db4656a8d Harshad Shirwadkar 2020-08-20 @1366  int 
ext4_mb_frsp_optimize(struct ext4_allocation_context *ac, int *tree_idx)
832851db4656a8d Harshad Shirwadkar 2020-08-20  1367  {
832851db4656a8d Harshad Shirwadkar 2020-08-20  1368     struct ext4_sb_info 
*sbi = EXT4_SB(ac->ac_sb);
832851db4656a8d Harshad Shirwadkar 2020-08-20  1369     struct ext4_frsp_tree 
*cur = NULL;
832851db4656a8d Harshad Shirwadkar 2020-08-20  1370     struct rb_node *node = 
NULL;
832851db4656a8d Harshad Shirwadkar 2020-08-20  1371     int found = 0, best = 
0, cache_more_trees = 0, better_len = 0, ret = 0;
832851db4656a8d Harshad Shirwadkar 2020-08-20  1372  
832851db4656a8d Harshad Shirwadkar 2020-08-20  1373     if (ac->ac_flags & 
EXT4_MB_HINT_FIRST ||
832851db4656a8d Harshad Shirwadkar 2020-08-20  1374             ac->ac_flags & 
EXT4_MB_FRSP_NO_OPTIMIZE ||
832851db4656a8d Harshad Shirwadkar 2020-08-20  1375             ac->ac_status 
!= AC_STATUS_CONTINUE)
832851db4656a8d Harshad Shirwadkar 2020-08-20  1376             return 0;
832851db4656a8d Harshad Shirwadkar 2020-08-20  1377  
832851db4656a8d Harshad Shirwadkar 2020-08-20  1378     
ac->ac_num_optimizations++;
832851db4656a8d Harshad Shirwadkar 2020-08-20  1379     if 
(!read_trylock(&sbi->s_mb_frsp_lock))
832851db4656a8d Harshad Shirwadkar 2020-08-20  1380             return 0;
832851db4656a8d Harshad Shirwadkar 2020-08-20  1381  
832851db4656a8d Harshad Shirwadkar 2020-08-20  1382     node = 
sbi->s_mb_frsp_meta_tree.rb_root.rb_node;
832851db4656a8d Harshad Shirwadkar 2020-08-20  1383     while (node) {
832851db4656a8d Harshad Shirwadkar 2020-08-20  1384             cur = 
rb_entry(node, struct ext4_frsp_tree, frsp_len_node);
832851db4656a8d Harshad Shirwadkar 2020-08-20  1385             if 
(ext4_mb_frsp_is_better(ac, cur->frsp_max_free_len, &best)) {
832851db4656a8d Harshad Shirwadkar 2020-08-20  1386                     /*
832851db4656a8d Harshad Shirwadkar 2020-08-20  1387                      * This 
tree definitely has a better node than the best
832851db4656a8d Harshad Shirwadkar 2020-08-20  1388                      * 
found so far.
832851db4656a8d Harshad Shirwadkar 2020-08-20  1389                      */
832851db4656a8d Harshad Shirwadkar 2020-08-20  1390                     found = 
1;
832851db4656a8d Harshad Shirwadkar 2020-08-20  1391                     ret = 1;
832851db4656a8d Harshad Shirwadkar 2020-08-20  1392                     
*tree_idx = cur->frsp_index;
832851db4656a8d Harshad Shirwadkar 2020-08-20  1393                     
better_len = cur->frsp_max_free_len;
832851db4656a8d Harshad Shirwadkar 2020-08-20  1394                     if 
(best)
832851db4656a8d Harshad Shirwadkar 2020-08-20  1395                             
break;
832851db4656a8d Harshad Shirwadkar 2020-08-20  1396             }
832851db4656a8d Harshad Shirwadkar 2020-08-20  1397             if 
(cur->frsp_max_free_len > ac->ac_g_ex.fe_len)
832851db4656a8d Harshad Shirwadkar 2020-08-20  1398                     node = 
node->rb_right;
832851db4656a8d Harshad Shirwadkar 2020-08-20  1399             else
832851db4656a8d Harshad Shirwadkar 2020-08-20  1400                     node = 
node->rb_left;
832851db4656a8d Harshad Shirwadkar 2020-08-20  1401     }
832851db4656a8d Harshad Shirwadkar 2020-08-20  1402  
832851db4656a8d Harshad Shirwadkar 2020-08-20  1403     if (ac->ac_found == 0 
&& !found) {
832851db4656a8d Harshad Shirwadkar 2020-08-20  1404             /*
832851db4656a8d Harshad Shirwadkar 2020-08-20  1405              * If we 
haven't found a good match above, and we hadn't found
832851db4656a8d Harshad Shirwadkar 2020-08-20  1406              * any match 
before us, that means we need to loosen our
832851db4656a8d Harshad Shirwadkar 2020-08-20  1407              * criteria. 
Note that, if we had found something earlier,
832851db4656a8d Harshad Shirwadkar 2020-08-20  1408              * not finding 
a better node doesn't imply that there is no
832851db4656a8d Harshad Shirwadkar 2020-08-20  1409              * better node 
available.
832851db4656a8d Harshad Shirwadkar 2020-08-20  1410              * TODO - in 
this case determine probabilistically which tree
832851db4656a8d Harshad Shirwadkar 2020-08-20  1411              * may have a 
better node and direct our allocator there.
832851db4656a8d Harshad Shirwadkar 2020-08-20  1412              */
832851db4656a8d Harshad Shirwadkar 2020-08-20  1413             if 
(ext4_mb_frsp_should_cache(ac)) {
832851db4656a8d Harshad Shirwadkar 2020-08-20  1414                     
cache_more_trees = 1;
832851db4656a8d Harshad Shirwadkar 2020-08-20  1415             } else if 
(ac->ac_criteria < 2) {
832851db4656a8d Harshad Shirwadkar 2020-08-20  1416                     
ac->ac_criteria++;
832851db4656a8d Harshad Shirwadkar 2020-08-20  1417                     
ac->ac_groups_scanned = 0;
832851db4656a8d Harshad Shirwadkar 2020-08-20  1418                     
*tree_idx = 0;
832851db4656a8d Harshad Shirwadkar 2020-08-20  1419                     ret = 1;
832851db4656a8d Harshad Shirwadkar 2020-08-20  1420             } else {
832851db4656a8d Harshad Shirwadkar 2020-08-20  1421                     
ac->ac_flags |= EXT4_MB_HINT_FIRST;
832851db4656a8d Harshad Shirwadkar 2020-08-20  1422             }
832851db4656a8d Harshad Shirwadkar 2020-08-20  1423     } else if (!best && 
!list_empty(&sbi->s_mb_uncached_trees)) {
832851db4656a8d Harshad Shirwadkar 2020-08-20  1424             
cache_more_trees = ext4_mb_frsp_should_cache(ac);
832851db4656a8d Harshad Shirwadkar 2020-08-20  1425     }
832851db4656a8d Harshad Shirwadkar 2020-08-20  1426  
832851db4656a8d Harshad Shirwadkar 2020-08-20  1427     if (cache_more_trees) {
832851db4656a8d Harshad Shirwadkar 2020-08-20  1428             cur = 
list_first_entry(&sbi->s_mb_uncached_trees,
832851db4656a8d Harshad Shirwadkar 2020-08-20  1429                             
struct ext4_frsp_tree, frsp_list_node);
832851db4656a8d Harshad Shirwadkar 2020-08-20  1430             
list_del_init(&cur->frsp_list_node);
832851db4656a8d Harshad Shirwadkar 2020-08-20  1431             *tree_idx = 
cur->frsp_index;
832851db4656a8d Harshad Shirwadkar 2020-08-20  1432             ret = 1;
832851db4656a8d Harshad Shirwadkar 2020-08-20  1433     }
832851db4656a8d Harshad Shirwadkar 2020-08-20  1434     
read_unlock(&sbi->s_mb_frsp_lock);
832851db4656a8d Harshad Shirwadkar 2020-08-20  1435  
832851db4656a8d Harshad Shirwadkar 2020-08-20  1436     /*
832851db4656a8d Harshad Shirwadkar 2020-08-20  1437      * If we couldn't 
optimize now, it's unlikely that we'll be able to
832851db4656a8d Harshad Shirwadkar 2020-08-20  1438      * optimize this 
request anymore
832851db4656a8d Harshad Shirwadkar 2020-08-20  1439      */
832851db4656a8d Harshad Shirwadkar 2020-08-20  1440     if (!ret)
832851db4656a8d Harshad Shirwadkar 2020-08-20  1441             ac->ac_flags |= 
EXT4_MB_FRSP_NO_OPTIMIZE;
832851db4656a8d Harshad Shirwadkar 2020-08-20  1442     mb_debug(ac->ac_sb,
832851db4656a8d Harshad Shirwadkar 2020-08-20  1443             "Optimizer 
suggestion: found = %d, tree = %d, len = %d, cr = %d\n",
832851db4656a8d Harshad Shirwadkar 2020-08-20  1444             found, 
*tree_idx, better_len, ac->ac_criteria);
832851db4656a8d Harshad Shirwadkar 2020-08-20  1445     return ret;
832851db4656a8d Harshad Shirwadkar 2020-08-20  1446  }
832851db4656a8d Harshad Shirwadkar 2020-08-20  1447  

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