From: kernel test robot <lkp@intel.com>
To: Ming Lei <ming.lei@redhat.com>, Jens Axboe <axboe@kernel.dk>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
Ed Tsai <ed.tsai@mediatek.com>, Ming Lei <ming.lei@redhat.com>
Subject: Re: [PATCH V2 2/2] block: try to make aligned bio in case of big chunk IO
Date: Fri, 10 Nov 2023 03:30:38 +0800 [thread overview]
Message-ID: <202311100354.HYfqOQ7o-lkp@intel.com> (raw)
In-Reply-To: <20231109082827.2276696-3-ming.lei@redhat.com>
Hi Ming,
kernel test robot noticed the following build warnings:
[auto build test WARNING on axboe-block/for-next]
[also build test WARNING on linus/master v6.6 next-20231109]
[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#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Ming-Lei/block-don-t-call-into-iov_iter_revert-if-nothing-is-left/20231109-190100
base: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next
patch link: https://lore.kernel.org/r/20231109082827.2276696-3-ming.lei%40redhat.com
patch subject: [PATCH V2 2/2] block: try to make aligned bio in case of big chunk IO
config: arm-davinci_all_defconfig (https://download.01.org/0day-ci/archive/20231110/202311100354.HYfqOQ7o-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231110/202311100354.HYfqOQ7o-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311100354.HYfqOQ7o-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> block/bio.c:1228:21: warning: variable 'size' is uninitialized when used here [-Wuninitialized]
1228 | return UINT_MAX - size;
| ^~~~
block/bio.c:1221:19: note: initialize the variable 'size' to silence this warning
1221 | unsigned int size, predicted_space, max_bytes;
| ^
| = 0
1 warning generated.
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for PINCTRL_SINGLE
Depends on [n]: PINCTRL [=n] && OF [=y] && HAS_IOMEM [=y]
Selected by [y]:
- ARCH_DAVINCI [=y] && ARCH_MULTI_V5 [=y] && CPU_LITTLE_ENDIAN [=y]
vim +/size +1228 block/bio.c
1212
1213 /*
1214 * Figure out max_size hint of iov_iter_extract_pages() for minimizing
1215 * bio & iov iter revert so that bio can be aligned with max io size.
1216 */
1217 static unsigned int bio_get_buffer_size_hint(const struct bio *bio,
1218 unsigned int left)
1219 {
1220 unsigned int nr_bvecs = bio->bi_max_vecs - bio->bi_vcnt;
1221 unsigned int size, predicted_space, max_bytes;
1222 unsigned int space = nr_bvecs << PAGE_SHIFT;
1223 unsigned int align_deviation;
1224
1225 /* If we have enough space really, just try to get all pages */
1226 if (!bio->bi_bdev || nr_bvecs >= (bio->bi_max_vecs / 4) ||
1227 !bio->bi_vcnt || left <= space)
> 1228 return UINT_MAX - size;
1229
1230 max_bytes = bdev_max_io_bytes(bio->bi_bdev);
1231 size = bio->bi_iter.bi_size;
1232
1233 /*
1234 * One bvec can hold physically continuous page frames with
1235 * multipage bvec and bytes in these pages can be pretty big, so
1236 * predict the available space by averaging bytes on all bvecs
1237 */
1238 predicted_space = size * nr_bvecs / bio->bi_vcnt;
1239 /*
1240 * If predicted space is bigger than max io bytes and at least two
1241 * vectors left, ask for all pages
1242 */
1243 if (predicted_space > max_bytes && nr_bvecs > 2)
1244 return UINT_MAX - size;
1245
1246 /*
1247 * This bio is close to be full, and stop to add pages if it is
1248 * basically aligned, otherwise just get & add pages if the bio
1249 * can be kept as aligned, so that we can minimize bio & iov iter
1250 * revert
1251 */
1252 align_deviation = max_t(unsigned int, 16U * 1024, max_bytes / 16);
1253 if ((size & (max_bytes - 1)) > align_deviation) {
1254 unsigned aligned_bytes = max_bytes - (size & (max_bytes - 1));
1255
1256 /* try to keep bio aligned if we have enough data and space */
1257 if (aligned_bytes <= left && aligned_bytes <= predicted_space)
1258 return aligned_bytes;
1259 }
1260
1261 return 0;
1262 }
1263
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
prev parent reply other threads:[~2023-11-09 19:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-09 8:28 [PATCH V2 0/2] block: try to make aligned bio in case of big chunk IO Ming Lei
2023-11-09 8:28 ` [PATCH V2 1/2] block: don't call into iov_iter_revert if nothing is left Ming Lei
2023-11-09 14:35 ` Christoph Hellwig
2023-11-09 8:28 ` [PATCH V2 2/2] block: try to make aligned bio in case of big chunk IO Ming Lei
2023-11-09 14:39 ` Christoph Hellwig
2023-11-09 19:30 ` kernel test robot [this message]
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=202311100354.HYfqOQ7o-lkp@intel.com \
--to=lkp@intel.com \
--cc=axboe@kernel.dk \
--cc=ed.tsai@mediatek.com \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=ming.lei@redhat.com \
--cc=oe-kbuild-all@lists.linux.dev \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox