From: kernel test robot <lkp@intel.com>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
Christoph Hellwig <hch@infradead.org>,
"Darrick J . Wong" <djwong@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
"Matthew Wilcox (Oracle)" <willy@infradead.org>,
linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
Andreas Gruenbacher <agruenba@redhat.com>,
Gao Xiang <xiang@kernel.org>
Subject: Re: [PATCH 1/2] filemap: Add folio_copy_tail()
Date: Fri, 3 Mar 2023 20:05:22 +0800 [thread overview]
Message-ID: <202303031911.we6DjYXd-lkp@intel.com> (raw)
In-Reply-To: <20230303064315.701090-2-willy@infradead.org>
Hi Matthew,
I love your patch! Perhaps something to improve:
[auto build test WARNING on akpm-mm/mm-everything]
[also build test WARNING on linus/master next-20230303]
[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/Matthew-Wilcox-Oracle/filemap-Add-folio_copy_tail/20230303-144359
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link: https://lore.kernel.org/r/20230303064315.701090-2-willy%40infradead.org
patch subject: [PATCH 1/2] filemap: Add folio_copy_tail()
config: arm-randconfig-r006-20230302 (https://download.01.org/0day-ci/archive/20230303/202303031911.we6DjYXd-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 67409911353323ca5edf2049ef0df54132fa1ca7)
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 arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/intel-lab-lkp/linux/commit/a4ee841f30215e4f7c5dda2ab82007f590a6a62b
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Matthew-Wilcox-Oracle/filemap-Add-folio_copy_tail/20230303-144359
git checkout a4ee841f30215e4f7c5dda2ab82007f590a6a62b
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303031911.we6DjYXd-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> mm/filemap.c:4160:17: warning: comparison of distinct pointer types ('typeof (poff + len) *' (aka 'unsigned int *') and 'typeof (((1UL) << 12)) *' (aka 'unsigned long *')) [-Wcompare-distinct-pointer-types]
size_t plen = min(poff + len, PAGE_SIZE) - poff;
^~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:67:19: note: expanded from macro 'min'
#define min(x, y) __careful_cmp(x, y, <)
^~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:36:24: note: expanded from macro '__careful_cmp'
__builtin_choose_expr(__safe_cmp(x, y), \
^~~~~~~~~~~~~~~~
include/linux/minmax.h:26:4: note: expanded from macro '__safe_cmp'
(__typecheck(x, y) && __no_side_effects(x, y))
^~~~~~~~~~~~~~~~~
include/linux/minmax.h:20:28: note: expanded from macro '__typecheck'
(!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
>> mm/filemap.c:4172:11: warning: comparison of distinct pointer types ('typeof (len) *' (aka 'unsigned int *') and 'typeof (((1UL) << 12)) *' (aka 'unsigned long *')) [-Wcompare-distinct-pointer-types]
plen = min(len, PAGE_SIZE);
^~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:67:19: note: expanded from macro 'min'
#define min(x, y) __careful_cmp(x, y, <)
^~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:36:24: note: expanded from macro '__careful_cmp'
__builtin_choose_expr(__safe_cmp(x, y), \
^~~~~~~~~~~~~~~~
include/linux/minmax.h:26:4: note: expanded from macro '__safe_cmp'
(__typecheck(x, y) && __no_side_effects(x, y))
^~~~~~~~~~~~~~~~~
include/linux/minmax.h:20:28: note: expanded from macro '__typecheck'
(!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
2 warnings generated.
vim +4160 mm/filemap.c
4125
4126 /**
4127 * folio_copy_tail - Copy an in-memory file tail into a page cache folio.
4128 * @folio: The folio to copy into.
4129 * @pos: The file position of the first byte of data in the tail.
4130 * @src: The address of the tail data.
4131 * @max: The size of the buffer used for the tail data.
4132 *
4133 * Supports file tails starting at @pos that are a maximum of @max
4134 * bytes in size. Zeroes the remainder of the folio.
4135 */
4136 void folio_copy_tail(struct folio *folio, loff_t pos, void *src, size_t max)
4137 {
4138 loff_t isize = i_size_read(folio->mapping->host);
4139 size_t offset, len = isize - pos;
4140 char *dst;
4141
4142 if (folio_pos(folio) > isize) {
4143 len = 0;
4144 } else if (folio_pos(folio) > pos) {
4145 len -= folio_pos(folio) - pos;
4146 src += folio_pos(folio) - pos;
4147 max -= folio_pos(folio) - pos;
4148 pos = folio_pos(folio);
4149 }
4150 /*
4151 * i_size is larger than the number of bytes stored in the tail?
4152 * Assume the remainder is zero-padded.
4153 */
4154 if (WARN_ON_ONCE(len > max))
4155 len = max;
4156 offset = offset_in_folio(folio, pos);
4157 dst = kmap_local_folio(folio, offset);
4158 if (folio_test_highmem(folio) && folio_test_large(folio)) {
4159 size_t poff = offset_in_page(offset);
> 4160 size_t plen = min(poff + len, PAGE_SIZE) - poff;
4161
4162 for (;;) {
4163 memcpy(dst, src, plen);
4164 memset(dst + plen, 0, PAGE_SIZE - poff - plen);
4165 offset += PAGE_SIZE - poff;
4166 if (offset == folio_size(folio))
4167 break;
4168 kunmap_local(dst);
4169 dst = kmap_local_folio(folio, offset);
4170 len -= plen;
4171 poff = 0;
> 4172 plen = min(len, PAGE_SIZE);
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
next prev parent reply other threads:[~2023-03-03 12:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-03 6:43 [PATCH 0/2] folio_copy_tail Matthew Wilcox (Oracle)
2023-03-03 6:43 ` [PATCH 1/2] filemap: Add folio_copy_tail() Matthew Wilcox (Oracle)
2023-03-03 12:05 ` kernel test robot [this message]
2023-03-03 6:43 ` [PATCH 2/2] iomap: Use folio_copy_tail() Matthew Wilcox (Oracle)
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=202303031911.we6DjYXd-lkp@intel.com \
--to=lkp@intel.com \
--cc=agruenba@redhat.com \
--cc=djwong@kernel.org \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=willy@infradead.org \
--cc=xiang@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
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;
as well as URLs for NNTP newsgroup(s).