Re: [PATCH 1/4] ext4: add prefetching for block allocation bitmaps

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

 



Hi Theodore,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on tip/perf/core]
[also build test WARNING on v5.8-rc5 next-20200717]
[cannot apply to ext4/dev]
[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/Theodore-Ts-o/ex4-block-bitmap-prefetching/20200718-000006
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git c085fb8774671e83f6199a8e838fbc0e57094029
config: arm64-randconfig-r036-20200718 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project ed6b578040a85977026c93bf4188f996148f3218)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> fs/ext4/balloc.c:501:19: warning: operator '?:' has lower precedence than '|'; '|' will be evaluated first [-Wbitwise-conditional-parentheses]
                     ignore_locked ? REQ_RAHEAD : 0, bh);
                     ~~~~~~~~~~~~~ ^
   fs/ext4/balloc.c:501:19: note: place parentheses around the '|' expression to silence this warning
                     ignore_locked ? REQ_RAHEAD : 0, bh);
                     ~~~~~~~~~~~~~ ^
   fs/ext4/balloc.c:501:19: note: place parentheses around the '?:' expression to evaluate it first
                     ignore_locked ? REQ_RAHEAD : 0, bh);
                                   ^
                     (                             )
   1 warning generated.

vim +501 fs/ext4/balloc.c

   404	
   405	/**
   406	 * ext4_read_block_bitmap_nowait()
   407	 * @sb:			super block
   408	 * @block_group:	given block group
   409	 *
   410	 * Read the bitmap for a given block_group,and validate the
   411	 * bits for block/inode/inode tables are set in the bitmaps
   412	 *
   413	 * Return buffer_head on success or an ERR_PTR in case of failure.
   414	 */
   415	struct buffer_head *
   416	ext4_read_block_bitmap_nowait(struct super_block *sb, ext4_group_t block_group,
   417				      bool ignore_locked)
   418	{
   419		struct ext4_group_desc *desc;
   420		struct ext4_sb_info *sbi = EXT4_SB(sb);
   421		struct buffer_head *bh;
   422		ext4_fsblk_t bitmap_blk;
   423		int err;
   424	
   425		desc = ext4_get_group_desc(sb, block_group, NULL);
   426		if (!desc)
   427			return ERR_PTR(-EFSCORRUPTED);
   428		bitmap_blk = ext4_block_bitmap(sb, desc);
   429		if ((bitmap_blk <= le32_to_cpu(sbi->s_es->s_first_data_block)) ||
   430		    (bitmap_blk >= ext4_blocks_count(sbi->s_es))) {
   431			ext4_error(sb, "Invalid block bitmap block %llu in "
   432				   "block_group %u", bitmap_blk, block_group);
   433			ext4_mark_group_bitmap_corrupted(sb, block_group,
   434						EXT4_GROUP_INFO_BBITMAP_CORRUPT);
   435			return ERR_PTR(-EFSCORRUPTED);
   436		}
   437		bh = sb_getblk(sb, bitmap_blk);
   438		if (unlikely(!bh)) {
   439			ext4_warning(sb, "Cannot get buffer for block bitmap - "
   440				     "block_group = %u, block_bitmap = %llu",
   441				     block_group, bitmap_blk);
   442			return ERR_PTR(-ENOMEM);
   443		}
   444	
   445		if (ignore_locked && buffer_locked(bh)) {
   446			/* buffer under IO already, return if called for prefetching */
   447			put_bh(bh);
   448			return NULL;
   449		}
   450	
   451		if (bitmap_uptodate(bh))
   452			goto verify;
   453	
   454		lock_buffer(bh);
   455		if (bitmap_uptodate(bh)) {
   456			unlock_buffer(bh);
   457			goto verify;
   458		}
   459		ext4_lock_group(sb, block_group);
   460		if (ext4_has_group_desc_csum(sb) &&
   461		    (desc->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT))) {
   462			if (block_group == 0) {
   463				ext4_unlock_group(sb, block_group);
   464				unlock_buffer(bh);
   465				ext4_error(sb, "Block bitmap for bg 0 marked "
   466					   "uninitialized");
   467				err = -EFSCORRUPTED;
   468				goto out;
   469			}
   470			err = ext4_init_block_bitmap(sb, bh, block_group, desc);
   471			set_bitmap_uptodate(bh);
   472			set_buffer_uptodate(bh);
   473			set_buffer_verified(bh);
   474			ext4_unlock_group(sb, block_group);
   475			unlock_buffer(bh);
   476			if (err) {
   477				ext4_error(sb, "Failed to init block bitmap for group "
   478					   "%u: %d", block_group, err);
   479				goto out;
   480			}
   481			goto verify;
   482		}
   483		ext4_unlock_group(sb, block_group);
   484		if (buffer_uptodate(bh)) {
   485			/*
   486			 * if not uninit if bh is uptodate,
   487			 * bitmap is also uptodate
   488			 */
   489			set_bitmap_uptodate(bh);
   490			unlock_buffer(bh);
   491			goto verify;
   492		}
   493		/*
   494		 * submit the buffer_head for reading
   495		 */
   496		set_buffer_new(bh);
   497		trace_ext4_read_block_bitmap_load(sb, block_group);
   498		bh->b_end_io = ext4_end_bitmap_read;
   499		get_bh(bh);
   500		submit_bh(REQ_OP_READ, REQ_META | REQ_PRIO |
 > 501			  ignore_locked ? REQ_RAHEAD : 0, bh);
   502		return bh;
   503	verify:
   504		err = ext4_validate_block_bitmap(sb, desc, block_group, bh);
   505		if (err)
   506			goto out;
   507		return bh;
   508	out:
   509		put_bh(bh);
   510		return ERR_PTR(err);
   511	}
   512	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux