Linux-ext4 Archive on lore.kernel.org
 help / color / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Alex Zhuravlev <azhuravlev@whamcloud.com>,
	"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>
Cc: kbuild-all@lists.01.org
Subject: Re: [PATCH 1/2] ext4:  mballoc - prefetching for bitmaps
Date: Sun, 24 May 2020 03:27:40 +0800
Message-ID: <202005240327.sj8CEtoy%lkp@intel.com> (raw)
In-Reply-To: <262A2973-9B2D-4DBE-8752-67E91D52C632@whamcloud.com>


[-- Attachment #1: Type: text/plain, Size: 3911 bytes --]

Hi Alex,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on ext4/dev]
[also build test WARNING on v5.7-rc6 next-20200522]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Alex-Zhuravlev/ext4-mballoc-prefetching-for-bitmaps/20200515-181552
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
config: x86_64-lkp (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build):
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

In file included from include/linux/export.h:43:0,
from include/linux/linkage.h:7,
from include/linux/fs.h:5,
from fs/ext4/ext4_jbd2.h:15,
from fs/ext4/mballoc.c:12:
fs/ext4/mballoc.c: In function 'ext4_mb_prefetch':
>> fs/ext4/mballoc.c:2137:12: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
BUG_ON(nr < 0);
^
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
fs/ext4/mballoc.c:2137:2: note: in expansion of macro 'BUG_ON'
BUG_ON(nr < 0);
^~~~~~

vim +2137 fs/ext4/mballoc.c

  2106	
  2107	/*
  2108	 * each allocation context (i.e. a thread doing allocation) has own
  2109	 * sliding prefetch window of @s_mb_prefetch size which starts at the
  2110	 * very first goal and moves ahead of scaning.
  2111	 * a side effect is that subsequent allocations will likely find
  2112	 * the bitmaps in cache or at least in-flight.
  2113	 */
  2114	static void
  2115	ext4_mb_prefetch(struct ext4_allocation_context *ac,
  2116			    ext4_group_t start)
  2117	{
  2118		struct super_block *sb = ac->ac_sb;
  2119		ext4_group_t ngroups = ext4_get_groups_count(sb);
  2120		struct ext4_sb_info *sbi = EXT4_SB(sb);
  2121		struct ext4_group_info *grp;
  2122		ext4_group_t nr, group = start;
  2123		struct buffer_head *bh;
  2124	
  2125		/* limit prefetching at cr=0, otherwise mballoc can
  2126		 * spend a lot of time loading imperfect groups */
  2127		if (ac->ac_criteria < 2 && ac->ac_prefetch_ios >= sbi->s_mb_prefetch_limit)
  2128			return;
  2129	
  2130		/* batch prefetching to get few READs in flight */
  2131		nr = ac->ac_prefetch - group;
  2132		if (ac->ac_prefetch < group)
  2133			/* wrapped to the first groups */
  2134			nr += ngroups;
  2135		if (nr > 0)
  2136			return;
> 2137		BUG_ON(nr < 0);
  2138	
  2139		nr = sbi->s_mb_prefetch;
  2140		if (ext4_has_feature_flex_bg(sb)) {
  2141			/* align to flex_bg to get more bitmas with a single IO */
  2142			nr = (group / sbi->s_mb_prefetch) * sbi->s_mb_prefetch;
  2143			nr = nr + sbi->s_mb_prefetch - group;
  2144		}
  2145		while (nr-- > 0) {
  2146			grp = ext4_get_group_info(sb, group);
  2147	
  2148			/* prevent expensive getblk() on groups w/ IO in progress */
  2149			if (EXT4_MB_GRP_TEST_AND_SET_READ(grp))
  2150				goto next;
  2151	
  2152			/* ignore empty groups - those will be skipped
  2153			 * during the scanning as well */
  2154			if (grp->bb_free > 0 && EXT4_MB_GRP_NEED_INIT(grp)) {
  2155				bh = ext4_read_block_bitmap_nowait(sb, group, true);
  2156				if (bh && !IS_ERR(bh)) {
  2157					if (!buffer_uptodate(bh))
  2158						ac->ac_prefetch_ios++;
  2159					brelse(bh);
  2160				}
  2161			}
  2162	next:
  2163			if (++group >= ngroups)
  2164				group = 0;
  2165		}
  2166		ac->ac_prefetch = group;
  2167	}
  2168	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28357 bytes --]

  parent reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-15 10:07 Alex Zhuravlev
2020-05-20  4:45 ` kbuild test robot
2020-05-23 19:27 ` kbuild test robot [this message]
2020-05-28 14:47 ` Theodore Y. Ts'o
2020-05-30  4:57   ` Alex Zhuravlev
2020-05-29 16:19 ` Благодаренко Артём
2020-05-30  5:01   ` Alex Zhuravlev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202005240327.sj8CEtoy%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=azhuravlev@whamcloud.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-ext4 Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-ext4/0 linux-ext4/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-ext4 linux-ext4/ https://lore.kernel.org/linux-ext4 \
		linux-ext4@vger.kernel.org
	public-inbox-index linux-ext4

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-ext4


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git