From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 972FBC636D3 for ; Mon, 6 Feb 2023 18:56:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8FF216B0072; Mon, 6 Feb 2023 13:56:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8AE766B0073; Mon, 6 Feb 2023 13:56:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 74F996B0074; Mon, 6 Feb 2023 13:56:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 65A106B0072 for ; Mon, 6 Feb 2023 13:56:19 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 303FD80A5B for ; Mon, 6 Feb 2023 18:56:19 +0000 (UTC) X-FDA: 80437772478.17.1411AA4 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by imf28.hostedemail.com (Postfix) with ESMTP id BD927C0013 for ; Mon, 6 Feb 2023 18:56:16 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b="YCnZD/+1"; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf28.hostedemail.com: domain of lkp@intel.com designates 192.55.52.120 as permitted sender) smtp.mailfrom=lkp@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1675709777; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Tk1WYPVzxsTGlelLBm4g0zqfJo3hPRA9mexU6mKQAks=; b=YgK4kZGl+dS1czQnKiBC1Zml66zgcEO38VU6pKue5aYGe2Mk4JUHV+17zp3Kw3U7lLzdDO NbI/LEPIe6pTKHhuzpNeHdSDJ6AFhr+4QgXhPv6QHNfZDQ3znegwGNLWcV/2Wsa4EouC+D RWlbFzE/9XqaxxFzv21ZrXf2DK/PIds= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b="YCnZD/+1"; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf28.hostedemail.com: domain of lkp@intel.com designates 192.55.52.120 as permitted sender) smtp.mailfrom=lkp@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1675709777; a=rsa-sha256; cv=none; b=wmHVIITU8c9Z4kw6pm1+Q1ahpYEuxn1oYg7+D8vN8CFjj5fc1PbrQAE4KUSwcXfCD9N74L zD3kt5iai0o3t8w2akmAZsCcrhvPlXUT4KYNYNqqY0UPWk08qpL6I3Ai9XNM/Tk5h8iJX+ UtyuEwHf9b84uM9M6Hh8zetRZAGFvmY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675709776; x=1707245776; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=TB/AUxY+vxvQxWZa7Z5xcZ8qNGVzi5zVocDFkI1MniQ=; b=YCnZD/+1L/R5cnjgX4yBS8LWsFLEwNxmvXYiCGCT2w0uga75uyNBj4rh hC67jiy8K2DhPco6PQopROy3Okij0SwnZbeObrsfAwzp2t47GtVWa5Ry6 d9zLXyfA7shjSfOXkmbvg2trFW5YYjzGct9sR/UoNzhz+jLC47v6c5qgJ paRX2VXLBYyX+zzckxwGPcjHkcgXol2EnrwcZyD7US4VESidx7imn4GfD EMhh0fhfn/3Kb7PrbX9nPh6EqhQjaj6d3cD42kinnjoHERl/wE2VoZ8zx ePB78x/VxbxeSI3NTm6P2H29PBdW2mqPB4t4i5w41zss5uD/JzOvf3j/p g==; X-IronPort-AV: E=McAfee;i="6500,9779,10613"; a="327920800" X-IronPort-AV: E=Sophos;i="5.97,276,1669104000"; d="scan'208";a="327920800" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2023 10:56:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10613"; a="666572608" X-IronPort-AV: E=Sophos;i="5.97,276,1669104000"; d="scan'208";a="666572608" Received: from lkp-server01.sh.intel.com (HELO 4455601a8d94) ([10.239.97.150]) by orsmga002.jf.intel.com with ESMTP; 06 Feb 2023 10:56:10 -0800 Received: from kbuild by 4455601a8d94 with local (Exim 4.96) (envelope-from ) id 1pP6ew-0002jc-0C; Mon, 06 Feb 2023 18:56:10 +0000 Date: Tue, 7 Feb 2023 02:56:00 +0800 From: kernel test robot To: "Matthew Wilcox (Oracle)" , akpm@linux-foundation.org, hughd@google.com, markhemm@googlemail.com, rientjes@google.com, surenb@google.com, shakeelb@google.com, mhocko@suse.com, vbabka@suse.cz, quic_pkondeti@quicinc.com Cc: oe-kbuild-all@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Charan Teja Kalla Subject: Re: [PATCH 2/2] shmem: Add shmem_read_folio() and shmem_read_folio_gfp() Message-ID: <202302070249.AUvSISRY-lkp@intel.com> References: <20230206162520.4029022-2-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230206162520.4029022-2-willy@infradead.org> X-Rspamd-Queue-Id: BD927C0013 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: 4zcqawym5g5fej8hwkfrrukapj9uhjwb X-HE-Tag: 1675709776-233097 X-HE-Meta: U2FsdGVkX1+vQfgQDe/R0EdRZ1jS49gr+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IQE47i6rV0F+vAy2xUkllUqdUtsMZMppfQJSFzWKx76I64GnQLcAhaJqNocJVucblZPrYSyQIA6TcVnIyQroJpL5IkXodTw7T9A8R8UcIJ4N9HeMpfPx9uevgVQIn4KLMWTrGoIZU6NEMYWVMbubCqnCcEa2YWFM1/XTlFSz2tP/oGwBvpfIGY1oztyy6MNr+okJwTHjeLDCcG34S9bBmlEh8m/QV0LY07wTknhPhG29Sh7yySYONlJp5EVQjFIPdyeDDHexVPP1DamAJGapQR0rNHJ8XgSZfPrSRALOOPd5QGq+S+VcsSNAmQVMc+eBL1aYoQB3L2zyV+PmvwE9EmCMz+eXuigsiBRQPsKSZT5+TY5V5HhtocX3WcTYt73zoKyjww== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 v6.2-rc7 next-20230206] [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/shmem-Add-shmem_read_folio-and-shmem_read_folio_gfp/20230207-002746 base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/20230206162520.4029022-2-willy%40infradead.org patch subject: [PATCH 2/2] shmem: Add shmem_read_folio() and shmem_read_folio_gfp() config: i386-tinyconfig (https://download.01.org/0day-ci/archive/20230207/202302070249.AUvSISRY-lkp@intel.com/config) compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 reproduce (this is a W=1 build): # https://github.com/intel-lab-lkp/linux/commit/ceb56c1ceea709ec0b10ed07e327bb4ae566bba5 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Matthew-Wilcox-Oracle/shmem-Add-shmem_read_folio-and-shmem_read_folio_gfp/20230207-002746 git checkout ceb56c1ceea709ec0b10ed07e327bb4ae566bba5 # save the config file mkdir build_dir && cp config build_dir/.config make W=1 O=build_dir ARCH=i386 olddefconfig make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All warnings (new ones prefixed by >>): mm/shmem.c:4164:13: warning: no previous prototype for 'shmem_init' [-Wmissing-prototypes] 4164 | void __init shmem_init(void) | ^~~~~~~~~~ mm/shmem.c:4172:5: warning: no previous prototype for 'shmem_unuse' [-Wmissing-prototypes] 4172 | int shmem_unuse(unsigned int type) | ^~~~~~~~~~~ mm/shmem.c:4177:5: warning: no previous prototype for 'shmem_lock' [-Wmissing-prototypes] 4177 | int shmem_lock(struct file *file, int lock, struct ucounts *ucounts) | ^~~~~~~~~~ mm/shmem.c:4182:6: warning: no previous prototype for 'shmem_unlock_mapping' [-Wmissing-prototypes] 4182 | void shmem_unlock_mapping(struct address_space *mapping) | ^~~~~~~~~~~~~~~~~~~~ mm/shmem.c:4187:15: warning: no previous prototype for 'shmem_get_unmapped_area' [-Wmissing-prototypes] 4187 | unsigned long shmem_get_unmapped_area(struct file *file, | ^~~~~~~~~~~~~~~~~~~~~~~ mm/shmem.c:4195:6: warning: no previous prototype for 'shmem_truncate_range' [-Wmissing-prototypes] 4195 | void shmem_truncate_range(struct inode *inode, loff_t lstart, loff_t lend) | ^~~~~~~~~~~~~~~~~~~~ mm/shmem.c:4255:14: warning: no previous prototype for 'shmem_kernel_file_setup' [-Wmissing-prototypes] 4255 | struct file *shmem_kernel_file_setup(const char *name, loff_t size, unsigned long flags) | ^~~~~~~~~~~~~~~~~~~~~~~ mm/shmem.c:4266:14: warning: no previous prototype for 'shmem_file_setup' [-Wmissing-prototypes] 4266 | struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags) | ^~~~~~~~~~~~~~~~ mm/shmem.c:4279:14: warning: no previous prototype for 'shmem_file_setup_with_mnt' [-Wmissing-prototypes] 4279 | struct file *shmem_file_setup_with_mnt(struct vfsmount *mnt, const char *name, | ^~~~~~~~~~~~~~~~~~~~~~~~~ mm/shmem.c:4290:5: warning: no previous prototype for 'shmem_zero_setup' [-Wmissing-prototypes] 4290 | int shmem_zero_setup(struct vm_area_struct *vma) | ^~~~~~~~~~~~~~~~ >> mm/shmem.c:4328:15: warning: no previous prototype for 'shmem_read_folio_gfp' [-Wmissing-prototypes] 4328 | struct folio *shmem_read_folio_gfp(struct address_space *mapping, | ^~~~~~~~~~~~~~~~~~~~ mm/shmem.c:4353:14: warning: no previous prototype for 'shmem_read_mapping_page_gfp' [-Wmissing-prototypes] 4353 | struct page *shmem_read_mapping_page_gfp(struct address_space *mapping, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ vim +/shmem_read_folio_gfp +4328 mm/shmem.c 4259 4260 /** 4261 * shmem_file_setup - get an unlinked file living in tmpfs 4262 * @name: name for dentry (to be seen in /proc//maps 4263 * @size: size to be set for the file 4264 * @flags: VM_NORESERVE suppresses pre-accounting of the entire object size 4265 */ > 4266 struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags) 4267 { 4268 return __shmem_file_setup(shm_mnt, name, size, flags, 0); 4269 } 4270 EXPORT_SYMBOL_GPL(shmem_file_setup); 4271 4272 /** 4273 * shmem_file_setup_with_mnt - get an unlinked file living in tmpfs 4274 * @mnt: the tmpfs mount where the file will be created 4275 * @name: name for dentry (to be seen in /proc//maps 4276 * @size: size to be set for the file 4277 * @flags: VM_NORESERVE suppresses pre-accounting of the entire object size 4278 */ 4279 struct file *shmem_file_setup_with_mnt(struct vfsmount *mnt, const char *name, 4280 loff_t size, unsigned long flags) 4281 { 4282 return __shmem_file_setup(mnt, name, size, flags, 0); 4283 } 4284 EXPORT_SYMBOL_GPL(shmem_file_setup_with_mnt); 4285 4286 /** 4287 * shmem_zero_setup - setup a shared anonymous mapping 4288 * @vma: the vma to be mmapped is prepared by do_mmap 4289 */ 4290 int shmem_zero_setup(struct vm_area_struct *vma) 4291 { 4292 struct file *file; 4293 loff_t size = vma->vm_end - vma->vm_start; 4294 4295 /* 4296 * Cloning a new file under mmap_lock leads to a lock ordering conflict 4297 * between XFS directory reading and selinux: since this file is only 4298 * accessible to the user through its mapping, use S_PRIVATE flag to 4299 * bypass file security, in the same way as shmem_kernel_file_setup(). 4300 */ 4301 file = shmem_kernel_file_setup("dev/zero", size, vma->vm_flags); 4302 if (IS_ERR(file)) 4303 return PTR_ERR(file); 4304 4305 if (vma->vm_file) 4306 fput(vma->vm_file); 4307 vma->vm_file = file; 4308 vma->vm_ops = &shmem_anon_vm_ops; 4309 4310 return 0; 4311 } 4312 4313 /** 4314 * shmem_read_folio_gfp - read into page cache, using specified page allocation flags. 4315 * @mapping: the folio's address_space 4316 * @index: the folio index 4317 * @gfp: the page allocator flags to use if allocating 4318 * 4319 * This behaves as a tmpfs "read_cache_page_gfp(mapping, index, gfp)", 4320 * with any new page allocations done using the specified allocation flags. 4321 * But read_cache_page_gfp() uses the ->read_folio() method: which does not 4322 * suit tmpfs, since it may have pages in swapcache, and needs to find those 4323 * for itself; although drivers/gpu/drm i915 and ttm rely upon this support. 4324 * 4325 * i915_gem_object_get_pages_gtt() mixes __GFP_NORETRY | __GFP_NOWARN in 4326 * with the mapping_gfp_mask(), to avoid OOMing the machine unnecessarily. 4327 */ > 4328 struct folio *shmem_read_folio_gfp(struct address_space *mapping, 4329 pgoff_t index, gfp_t gfp) 4330 { 4331 #ifdef CONFIG_SHMEM 4332 struct inode *inode = mapping->host; 4333 struct folio *folio; 4334 int error; 4335 4336 BUG_ON(!shmem_mapping(mapping)); 4337 error = shmem_get_folio_gfp(inode, index, &folio, SGP_CACHE, 4338 gfp, NULL, NULL, NULL); 4339 if (error) 4340 return ERR_PTR(error); 4341 4342 folio_unlock(folio); 4343 return folio; 4344 #else 4345 /* 4346 * The tiny !SHMEM case uses ramfs without swap 4347 */ 4348 return mapping_read_folio_gfp(mapping, index, gfp); 4349 #endif 4350 } 4351 EXPORT_SYMBOL_GPL(shmem_read_folio_gfp); 4352 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests