All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com
Subject: Re: [PATCH v3 4/4] btrfs: avoid allocating unnecessary page pointers
Date: Wed, 26 Aug 2020 20:31:46 +0800	[thread overview]
Message-ID: <202008262011.m5KmUL0T%lkp@intel.com> (raw)
In-Reply-To: <20200825054808.16241-5-wqu@suse.com>

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

Hi Qu,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on kdave/for-next]
[also build test WARNING on next-20200826]
[cannot apply to btrfs/next v5.9-rc2]
[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/Qu-Wenruo/btrfs-basic-refactor-of-btrfs_buffered_write/20200825-135114
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
config: riscv-randconfig-r033-20200826 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 7cfcecece0e0430937cf529ce74d3a071a4dedc6)
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 riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv 

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

All warnings (new ones prefixed by >>):

>> fs/btrfs/file.c:1571:13: warning: comparison of distinct pointer types ('typeof (nr_pages) *' (aka 'int *') and 'typeof (65536 / ((1UL) << (12))) *' (aka 'unsigned long *')) [-Wcompare-distinct-pointer-types]
           nr_pages = min(nr_pages, SZ_64K / PAGE_SIZE);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:883:19: note: expanded from macro 'min'
   #define min(x, y)       __careful_cmp(x, y, <)
                           ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:874:24: note: expanded from macro '__careful_cmp'
           __builtin_choose_expr(__safe_cmp(x, y), \
                                 ^~~~~~~~~~~~~~~~
   include/linux/kernel.h:864:4: note: expanded from macro '__safe_cmp'
                   (__typecheck(x, y) && __no_side_effects(x, y))
                    ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:850:29: note: expanded from macro '__typecheck'
                   (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
                              ~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~
   1 warning generated.

# https://github.com/0day-ci/linux/commit/a73ab37ebab960522a0b353a6f20c8094ab911c5
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Qu-Wenruo/btrfs-basic-refactor-of-btrfs_buffered_write/20200825-135114
git checkout a73ab37ebab960522a0b353a6f20c8094ab911c5
vim +1571 fs/btrfs/file.c

  1548	
  1549	/* Helper to get how many pages we should alloc for the batch */
  1550	static int calc_nr_pages(loff_t pos, struct iov_iter *iov)
  1551	{
  1552		int nr_pages;
  1553	
  1554		/*
  1555		 * Try to cover the full iov range, as btrfs metadata/data reserve
  1556		 * and release can be pretty slow, thus the more pages we process in
  1557		 * one batch the better.
  1558		 */
  1559		nr_pages = (round_up(pos + iov_iter_count(iov), PAGE_SIZE) -
  1560			    round_down(pos, PAGE_SIZE)) / PAGE_SIZE;
  1561	
  1562		nr_pages = min(nr_pages, current->nr_dirtied_pause -
  1563					 current->nr_dirtied);
  1564	
  1565		/*
  1566		 * Limit the batch to 64K, too large batch may lead to higher memory
  1567		 * pressure and increase the possibility of short-copy.
  1568		 * With more and more short-copy, the benefit of batch copy would be
  1569		 * hugely reduced, as we will fall back to page-by-page copy.
  1570		 */
> 1571		nr_pages = min(nr_pages, SZ_64K / PAGE_SIZE);
  1572		return nr_pages;
  1573	}
  1574	

---
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: 28899 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v3 4/4] btrfs: avoid allocating unnecessary page pointers
Date: Wed, 26 Aug 2020 20:31:46 +0800	[thread overview]
Message-ID: <202008262011.m5KmUL0T%lkp@intel.com> (raw)
In-Reply-To: <20200825054808.16241-5-wqu@suse.com>

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

Hi Qu,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on kdave/for-next]
[also build test WARNING on next-20200826]
[cannot apply to btrfs/next v5.9-rc2]
[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/Qu-Wenruo/btrfs-basic-refactor-of-btrfs_buffered_write/20200825-135114
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
config: riscv-randconfig-r033-20200826 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 7cfcecece0e0430937cf529ce74d3a071a4dedc6)
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 riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv 

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

All warnings (new ones prefixed by >>):

>> fs/btrfs/file.c:1571:13: warning: comparison of distinct pointer types ('typeof (nr_pages) *' (aka 'int *') and 'typeof (65536 / ((1UL) << (12))) *' (aka 'unsigned long *')) [-Wcompare-distinct-pointer-types]
           nr_pages = min(nr_pages, SZ_64K / PAGE_SIZE);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:883:19: note: expanded from macro 'min'
   #define min(x, y)       __careful_cmp(x, y, <)
                           ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:874:24: note: expanded from macro '__careful_cmp'
           __builtin_choose_expr(__safe_cmp(x, y), \
                                 ^~~~~~~~~~~~~~~~
   include/linux/kernel.h:864:4: note: expanded from macro '__safe_cmp'
                   (__typecheck(x, y) && __no_side_effects(x, y))
                    ^~~~~~~~~~~~~~~~~
   include/linux/kernel.h:850:29: note: expanded from macro '__typecheck'
                   (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
                              ~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~
   1 warning generated.

# https://github.com/0day-ci/linux/commit/a73ab37ebab960522a0b353a6f20c8094ab911c5
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Qu-Wenruo/btrfs-basic-refactor-of-btrfs_buffered_write/20200825-135114
git checkout a73ab37ebab960522a0b353a6f20c8094ab911c5
vim +1571 fs/btrfs/file.c

  1548	
  1549	/* Helper to get how many pages we should alloc for the batch */
  1550	static int calc_nr_pages(loff_t pos, struct iov_iter *iov)
  1551	{
  1552		int nr_pages;
  1553	
  1554		/*
  1555		 * Try to cover the full iov range, as btrfs metadata/data reserve
  1556		 * and release can be pretty slow, thus the more pages we process in
  1557		 * one batch the better.
  1558		 */
  1559		nr_pages = (round_up(pos + iov_iter_count(iov), PAGE_SIZE) -
  1560			    round_down(pos, PAGE_SIZE)) / PAGE_SIZE;
  1561	
  1562		nr_pages = min(nr_pages, current->nr_dirtied_pause -
  1563					 current->nr_dirtied);
  1564	
  1565		/*
  1566		 * Limit the batch to 64K, too large batch may lead to higher memory
  1567		 * pressure and increase the possibility of short-copy.
  1568		 * With more and more short-copy, the benefit of batch copy would be
  1569		 * hugely reduced, as we will fall back to page-by-page copy.
  1570		 */
> 1571		nr_pages = min(nr_pages, SZ_64K / PAGE_SIZE);
  1572		return nr_pages;
  1573	}
  1574	

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

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

  parent reply	other threads:[~2020-08-26 12:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-25  5:48 [PATCH v3 0/4] btrfs: basic refactor of btrfs_buffered_write() Qu Wenruo
2020-08-25  5:48 ` [PATCH v3 1/4] btrfs: refactor @nrptrs calculation " Qu Wenruo
2020-08-25  5:48 ` [PATCH v3 2/4] btrfs: refactor btrfs_buffered_write() into process_one_batch() Qu Wenruo
2020-08-25  5:48 ` [PATCH v3 3/4] btrfs: remove the again: tag in process_one_batch() Qu Wenruo
2020-08-25  5:48 ` [PATCH v3 4/4] btrfs: avoid allocating unnecessary page pointers Qu Wenruo
2020-08-25  7:46   ` kernel test robot
2020-08-25  7:46     ` kernel test robot
2020-08-25  7:57   ` kernel test robot
2020-08-25  7:57     ` kernel test robot
2020-08-26 12:31   ` kernel test robot [this message]
2020-08-26 12:31     ` kernel test robot
2020-08-27  8:56   ` [LTP] [btrfs] a73ab37eba: last_state.is_incomplete_run kernel test robot
2020-08-27  8:56     ` kernel test robot
2020-08-27  8:56     ` kernel test robot
2020-08-25 11:44 ` [PATCH v3 0/4] btrfs: basic refactor of btrfs_buffered_write() Christoph Hellwig
2020-08-25 13:32   ` Goldwyn Rodrigues

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=202008262011.m5KmUL0T%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.