All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: cros-kernel-buildreports@googlegroups.com
Cc: oe-kbuild-all@lists.linux.dev
Subject: [android-common:android15-6.6-2026-04 1/1] mm/shmem.c:2180:12: warning: no previous prototype for 'shmem_fault'
Date: Thu, 16 Jul 2026 18:30:37 +0800	[thread overview]
Message-ID: <202607161816.yDP17zCi-lkp@intel.com> (raw)

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

                 reply	other threads:[~2026-07-16 10:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202607161816.yDP17zCi-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=cros-kernel-buildreports@googlegroups.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 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.