* [android-common:android15-6.6-2026-04 1/1] mm/shmem.c:2180:12: warning: no previous prototype for 'shmem_fault'
@ 2026-07-16 10:30 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-07-16 10:30 UTC (permalink / raw)
To: cros-kernel-buildreports; +Cc: oe-kbuild-all
Hi Kalesh,
FYI, the error/warning still remains.
tree: https://android.googlesource.com/kernel/common android15-6.6-2026-04
head: 33b6171ad078b267e1bfa3617dbe417681d7d02f
commit: db302359ea1b5252a28abcb23a382be91c961ac0 [1/1] ANDROID: 16K: Handle pgoff > file_size for shmem and file backed VMAs
config: arm64-allnoconfig (https://download.01.org/0day-ci/archive/20260716/202607161816.yDP17zCi-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260716/202607161816.yDP17zCi-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/202607161816.yDP17zCi-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> mm/shmem.c:2180:12: warning: no previous prototype for 'shmem_fault' [-Wmissing-prototypes]
2180 | vm_fault_t shmem_fault(struct vm_fault *vmf)
| ^~~~~~~~~~~
vim +/shmem_fault +2180 mm/shmem.c
2179
> 2180 vm_fault_t shmem_fault(struct vm_fault *vmf)
2181 {
2182 struct vm_area_struct *vma = vmf->vma;
2183 struct inode *inode = file_inode(vma->vm_file);
2184 gfp_t gfp = mapping_gfp_mask(inode->i_mapping);
2185 struct folio *folio = NULL;
2186 int err;
2187 vm_fault_t ret = VM_FAULT_LOCKED;
2188
2189 /*
2190 * Trinity finds that probing a hole which tmpfs is punching can
2191 * prevent the hole-punch from ever completing: which in turn
2192 * locks writers out with its hold on i_rwsem. So refrain from
2193 * faulting pages into the hole while it's being punched. Although
2194 * shmem_undo_range() does remove the additions, it may be unable to
2195 * keep up, as each new page needs its own unmap_mapping_range() call,
2196 * and the i_mmap tree grows ever slower to scan if new vmas are added.
2197 *
2198 * It does not matter if we sometimes reach this check just before the
2199 * hole-punch begins, so that one fault then races with the punch:
2200 * we just need to make racing faults a rare case.
2201 *
2202 * The implementation below would be much simpler if we just used a
2203 * standard mutex or completion: but we cannot take i_rwsem in fault,
2204 * and bloating every shmem inode for this unlikely case would be sad.
2205 */
2206 if (unlikely(inode->i_private)) {
2207 struct shmem_falloc *shmem_falloc;
2208
2209 spin_lock(&inode->i_lock);
2210 shmem_falloc = inode->i_private;
2211 if (shmem_falloc &&
2212 shmem_falloc->waitq &&
2213 vmf->pgoff >= shmem_falloc->start &&
2214 vmf->pgoff < shmem_falloc->next) {
2215 struct file *fpin;
2216 wait_queue_head_t *shmem_falloc_waitq;
2217 DEFINE_WAIT_FUNC(shmem_fault_wait, synchronous_wake_function);
2218
2219 ret = VM_FAULT_NOPAGE;
2220 fpin = maybe_unlock_mmap_for_io(vmf, NULL);
2221 if (fpin)
2222 ret = VM_FAULT_RETRY;
2223
2224 shmem_falloc_waitq = shmem_falloc->waitq;
2225 prepare_to_wait(shmem_falloc_waitq, &shmem_fault_wait,
2226 TASK_UNINTERRUPTIBLE);
2227 spin_unlock(&inode->i_lock);
2228 schedule();
2229
2230 /*
2231 * shmem_falloc_waitq points into the shmem_fallocate()
2232 * stack of the hole-punching task: shmem_falloc_waitq
2233 * is usually invalid by the time we reach here, but
2234 * finish_wait() does not dereference it in that case;
2235 * though i_lock needed lest racing with wake_up_all().
2236 */
2237 spin_lock(&inode->i_lock);
2238 finish_wait(shmem_falloc_waitq, &shmem_fault_wait);
2239 spin_unlock(&inode->i_lock);
2240
2241 if (fpin)
2242 fput(fpin);
2243 return ret;
2244 }
2245 spin_unlock(&inode->i_lock);
2246 }
2247
2248 err = shmem_get_folio_gfp(inode, vmf->pgoff, &folio, SGP_CACHE,
2249 gfp, vma, vmf, &ret);
2250 if (err)
2251 return vmf_error(err);
2252 if (folio)
2253 vmf->page = folio_file_page(folio, vmf->pgoff);
2254 return ret;
2255 }
2256
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-07-16 10:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-16 10:30 [android-common:android15-6.6-2026-04 1/1] mm/shmem.c:2180:12: warning: no previous prototype for 'shmem_fault' kernel test robot
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.