From: kernel test robot <lkp@intel.com>
To: Daniel Gomez <da.gomez@samsung.com>,
"hughd@google.com" <hughd@google.com>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"willy@infradead.org" <willy@infradead.org>,
"jack@suse.cz" <jack@suse.cz>,
"mcgrof@kernel.org" <mcgrof@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>,
"djwong@kernel.org" <djwong@kernel.org>,
Pankaj Raghav <p.raghav@samsung.com>,
"dagmcr@gmail.com" <dagmcr@gmail.com>,
"yosryahmed@google.com" <yosryahmed@google.com>,
"baolin.wang@linux.alibaba.com" <baolin.wang@linux.alibaba.com>,
"ritesh.list@gmail.com" <ritesh.list@gmail.com>,
"lsf-pc@lists.linux-foundation.org"
<lsf-pc@lists.linux-foundation.org>,
"david@redhat.com" <david@redhat.com>,
"chandan.babu@oracle.com" <chandan.babu@oracle.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"brauner@kernel.org" <brauner@kernel.org>,
Daniel Gomez <da.gomez@samsung.com>
Subject: Re: [PATCH 07/12] shmem: check if a block is uptodate before splice into pipe
Date: Thu, 16 May 2024 21:19:40 +0800 [thread overview]
Message-ID: <202405162045.kaXgB2n3-lkp@intel.com> (raw)
In-Reply-To: <20240515055719.32577-8-da.gomez@samsung.com>
Hi Daniel,
kernel test robot noticed the following build errors:
[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on xfs-linux/for-next brauner-vfs/vfs.all linus/master v6.9 next-20240516]
[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/Daniel-Gomez/splice-don-t-check-for-uptodate-if-partially-uptodate-is-impl/20240515-135925
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link: https://lore.kernel.org/r/20240515055719.32577-8-da.gomez%40samsung.com
patch subject: [PATCH 07/12] shmem: check if a block is uptodate before splice into pipe
config: arm-s5pv210_defconfig (https://download.01.org/0day-ci/archive/20240516/202405162045.kaXgB2n3-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240516/202405162045.kaXgB2n3-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/202405162045.kaXgB2n3-lkp@intel.com/
All errors (new ones prefixed by >>):
arm-linux-gnueabi-ld: mm/shmem.o: in function `shmem_file_splice_read':
>> mm/shmem.c:3240:(.text+0x5224): undefined reference to `__aeabi_ldivmod'
vim +3240 mm/shmem.c
3174
3175 static ssize_t shmem_file_splice_read(struct file *in, loff_t *ppos,
3176 struct pipe_inode_info *pipe,
3177 size_t len, unsigned int flags)
3178 {
3179 struct inode *inode = file_inode(in);
3180 struct address_space *mapping = inode->i_mapping;
3181 struct folio *folio = NULL;
3182 size_t total_spliced = 0, used, npages, n, part;
3183 loff_t isize;
3184 int error = 0;
3185
3186 /* Work out how much data we can actually add into the pipe */
3187 used = pipe_occupancy(pipe->head, pipe->tail);
3188 npages = max_t(ssize_t, pipe->max_usage - used, 0);
3189 len = min_t(size_t, len, npages * PAGE_SIZE);
3190
3191 do {
3192 if (*ppos >= i_size_read(inode))
3193 break;
3194
3195 error = shmem_get_folio(inode, *ppos / PAGE_SIZE, &folio,
3196 SGP_READ);
3197 if (error) {
3198 if (error == -EINVAL)
3199 error = 0;
3200 break;
3201 }
3202 if (folio) {
3203 folio_unlock(folio);
3204
3205 if (folio_test_hwpoison(folio) ||
3206 (folio_test_large(folio) &&
3207 folio_test_has_hwpoisoned(folio))) {
3208 error = -EIO;
3209 break;
3210 }
3211 }
3212
3213 /*
3214 * i_size must be checked after we know the pages are Uptodate.
3215 *
3216 * Checking i_size after the check allows us to calculate
3217 * the correct value for "nr", which means the zero-filled
3218 * part of the page is not copied back to userspace (unless
3219 * another truncate extends the file - this is desired though).
3220 */
3221 isize = i_size_read(inode);
3222 if (unlikely(*ppos >= isize))
3223 break;
3224 part = min_t(loff_t, isize - *ppos, len);
3225 if (folio && folio_test_large(folio) &&
3226 folio_test_private(folio)) {
3227 unsigned long from = offset_in_folio(folio, *ppos);
3228 unsigned int bfirst = from >> inode->i_blkbits;
3229 unsigned int blast, blast_upd;
3230
3231 len = min(folio_size(folio) - from, len);
3232 blast = (from + len - 1) >> inode->i_blkbits;
3233
3234 blast_upd = sfs_get_last_block_uptodate(folio, bfirst,
3235 blast);
3236 if (blast_upd <= blast) {
3237 unsigned int bsize = 1 << inode->i_blkbits;
3238 unsigned int blks = blast_upd - bfirst + 1;
3239 unsigned int bbytes = blks << inode->i_blkbits;
> 3240 unsigned int boff = (*ppos % bsize);
3241
3242 part = min_t(loff_t, bbytes - boff, len);
3243 }
3244 }
3245
3246 if (folio && shmem_is_block_uptodate(
3247 folio, offset_in_folio(folio, *ppos) >>
3248 inode->i_blkbits)) {
3249 /*
3250 * If users can be writing to this page using arbitrary
3251 * virtual addresses, take care about potential aliasing
3252 * before reading the page on the kernel side.
3253 */
3254 if (mapping_writably_mapped(mapping))
3255 flush_dcache_folio(folio);
3256 folio_mark_accessed(folio);
3257 /*
3258 * Ok, we have the page, and it's up-to-date, so we can
3259 * now splice it into the pipe.
3260 */
3261 n = splice_folio_into_pipe(pipe, folio, *ppos, part);
3262 folio_put(folio);
3263 folio = NULL;
3264 } else {
3265 n = splice_zeropage_into_pipe(pipe, *ppos, part);
3266 }
3267
3268 if (!n)
3269 break;
3270 len -= n;
3271 total_spliced += n;
3272 *ppos += n;
3273 in->f_ra.prev_pos = *ppos;
3274 if (pipe_full(pipe->head, pipe->tail, pipe->max_usage))
3275 break;
3276
3277 cond_resched();
3278 } while (len);
3279
3280 if (folio)
3281 folio_put(folio);
3282
3283 file_accessed(in);
3284 return total_spliced ? total_spliced : error;
3285 }
3286
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2024-05-16 13:20 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20240515055723eucas1p11bf14732f7fac943e688369ff7765f79@eucas1p1.samsung.com>
2024-05-15 5:57 ` [PATCH 00/12] [LSF/MM/BPF RFC] shmem/tmpfs: add large folios support Daniel Gomez
[not found] ` <CGME20240515055724eucas1p1c502dbded4dc6ff929c7aff570de80c2@eucas1p1.samsung.com>
2024-05-15 5:57 ` [PATCH 01/12] splice: don't check for uptodate if partially uptodate is impl Daniel Gomez
[not found] ` <CGME20240515055726eucas1p2a795fc743373571bfc3349f9e1ef3f9e@eucas1p2.samsung.com>
2024-05-15 5:57 ` [PATCH 02/12] shmem: add per-block uptodate tracking for large folios Daniel Gomez
[not found] ` <CGME20240515055727eucas1p2413c65b8b227ac0c6007b4600574abd8@eucas1p2.samsung.com>
2024-05-15 5:57 ` [PATCH 03/12] shmem: move folio zero operation to write_begin() Daniel Gomez
[not found] ` <CGME20240515055728eucas1p181e0ed81b2663eb0eee6d6134c1c1956@eucas1p1.samsung.com>
2024-05-15 5:57 ` [PATCH 04/12] shmem: exit shmem_get_folio_gfp() if block is uptodate Daniel Gomez
[not found] ` <CGME20240515055729eucas1p14e953424ad39bbb923c64163b1bbd4b3@eucas1p1.samsung.com>
2024-05-15 5:57 ` [PATCH 05/12] shmem: clear_highpage() if block is not uptodate Daniel Gomez
[not found] ` <CGME20240515055731eucas1p12cbbba88e24a011ef5871f90ff25ae73@eucas1p1.samsung.com>
2024-05-15 5:57 ` [PATCH 06/12] shmem: set folio uptodate when reclaim Daniel Gomez
[not found] ` <CGME20240515055732eucas1p2302bbca4d60e2e811a5c59e34f83628d@eucas1p2.samsung.com>
2024-05-15 5:57 ` [PATCH 07/12] shmem: check if a block is uptodate before splice into pipe Daniel Gomez
2024-05-16 13:19 ` kernel test robot [this message]
[not found] ` <CGME20240515055733eucas1p2804d2fb5f5bf7d6adb460054f6e9f4d8@eucas1p2.samsung.com>
2024-05-15 5:57 ` [PATCH 08/12] shmem: clear uptodate blocks after PUNCH_HOLE Daniel Gomez
[not found] ` <CGME20240515055735eucas1p2a967b4eebc8e059588cd62139f006b0d@eucas1p2.samsung.com>
2024-05-15 5:57 ` [PATCH 09/12] shmem: enable per-block uptodate Daniel Gomez
[not found] ` <CGME20240515055736eucas1p1bfa9549398e766532d143ba9314bee18@eucas1p1.samsung.com>
2024-05-15 5:57 ` [PATCH 10/12] shmem: add order arg to shmem_alloc_folio() Daniel Gomez
[not found] ` <CGME20240515055738eucas1p15335a32c790b731aa5857193bbddf92d@eucas1p1.samsung.com>
2024-05-15 5:57 ` [PATCH 11/12] shmem: add file length arg in shmem_get_folio() path Daniel Gomez
2024-05-15 17:47 ` kernel test robot
2024-05-17 16:17 ` Darrick J. Wong
2024-05-21 11:38 ` Daniel Gomez
2024-05-21 16:36 ` Darrick J. Wong
[not found] ` <CGME20240515055740eucas1p1bf112e73a7009a0f9b2bbf09c989a51b@eucas1p1.samsung.com>
2024-05-15 5:57 ` [PATCH 12/12] shmem: add large folio support to the write and fallocate paths Daniel Gomez
2024-05-15 18:59 ` kernel test robot
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=202405162045.kaXgB2n3-lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=brauner@kernel.org \
--cc=chandan.babu@oracle.com \
--cc=da.gomez@samsung.com \
--cc=dagmcr@gmail.com \
--cc=david@redhat.com \
--cc=djwong@kernel.org \
--cc=hughd@google.com \
--cc=jack@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-xfs@vger.kernel.org \
--cc=lsf-pc@lists.linux-foundation.org \
--cc=mcgrof@kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=p.raghav@samsung.com \
--cc=ritesh.list@gmail.com \
--cc=willy@infradead.org \
--cc=yosryahmed@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox