linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Kairui Song <ryncsn@gmail.com>, linux-mm@kvack.org
Cc: oe-kbuild-all@lists.linux.dev,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>,
	Chris Li <chrisl@kernel.org>,
	"Huang, Ying" <ying.huang@intel.com>,
	Hugh Dickins <hughd@google.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Matthew Wilcox <willy@infradead.org>,
	Michal Hocko <mhocko@suse.com>,
	Yosry Ahmed <yosryahmed@google.com>,
	David Hildenbrand <david@redhat.com>,
	linux-kernel@vger.kernel.org, Kairui Song <kasong@tencent.com>
Subject: Re: [PATCH v2 9/9] mm/swap, shmem: use new swapin helper to skip readahead conditionally
Date: Wed, 3 Jan 2024 21:45:34 +0800	[thread overview]
Message-ID: <202401032120.uWKybc56-lkp@intel.com> (raw)
In-Reply-To: <20240102175338.62012-10-ryncsn@gmail.com>

Hi Kairui,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on next-20240103]
[cannot apply to linus/master v6.7-rc8]
[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/Kairui-Song/mm-swapfile-c-add-back-some-comment/20240103-015650
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20240102175338.62012-10-ryncsn%40gmail.com
patch subject: [PATCH v2 9/9] mm/swap, shmem: use new swapin helper to skip readahead conditionally
config: i386-randconfig-014-20240103 (https://download.01.org/0day-ci/archive/20240103/202401032120.uWKybc56-lkp@intel.com/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240103/202401032120.uWKybc56-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/202401032120.uWKybc56-lkp@intel.com/

All errors (new ones prefixed by >>):

   mm/shmem.c: In function 'shmem_swapin_folio':
>> mm/shmem.c:1864:8: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
     folio = swapin_entry_mpol(swap, gfp, mpol, ilx, &cache_result);
           ^
   cc1: some warnings being treated as errors


vim +1864 mm/shmem.c

  1826	
  1827	/*
  1828	 * Swap in the folio pointed to by *foliop.
  1829	 * Caller has to make sure that *foliop contains a valid swapped folio.
  1830	 * Returns 0 and the folio in foliop if success. On failure, returns the
  1831	 * error code and NULL in *foliop.
  1832	 */
  1833	static int shmem_swapin_folio(struct inode *inode, pgoff_t index,
  1834				     struct folio **foliop, enum sgp_type sgp,
  1835				     gfp_t gfp, struct mm_struct *fault_mm,
  1836				     vm_fault_t *fault_type)
  1837	{
  1838		struct address_space *mapping = inode->i_mapping;
  1839		struct shmem_inode_info *info = SHMEM_I(inode);
  1840		enum swap_cache_result cache_result;
  1841		struct swap_info_struct *si;
  1842		struct folio *folio = NULL;
  1843		struct mempolicy *mpol;
  1844		swp_entry_t swap;
  1845		pgoff_t ilx;
  1846		int error;
  1847	
  1848		VM_BUG_ON(!*foliop || !xa_is_value(*foliop));
  1849		swap = radix_to_swp_entry(*foliop);
  1850		*foliop = NULL;
  1851	
  1852		if (is_poisoned_swp_entry(swap))
  1853			return -EIO;
  1854	
  1855		si = get_swap_device(swap);
  1856		if (!si) {
  1857			if (!shmem_confirm_swap(mapping, index, swap))
  1858				return -EEXIST;
  1859			else
  1860				return -EINVAL;
  1861		}
  1862	
  1863		mpol = shmem_get_pgoff_policy(info, index, 0, &ilx);
> 1864		folio = swapin_entry_mpol(swap, gfp, mpol, ilx, &cache_result);
  1865		mpol_cond_put(mpol);
  1866	
  1867		if (!folio) {
  1868			error = -ENOMEM;
  1869			goto failed;
  1870		}
  1871		if (cache_result != SWAP_CACHE_HIT) {
  1872			if (fault_type) {
  1873				*fault_type |= VM_FAULT_MAJOR;
  1874				count_vm_event(PGMAJFAULT);
  1875				count_memcg_event_mm(fault_mm, PGMAJFAULT);
  1876			}
  1877		}
  1878	
  1879		/* We have to do this with folio locked to prevent races */
  1880		folio_lock(folio);
  1881		if (cache_result != SWAP_CACHE_BYPASS) {
  1882			/* With cache bypass, folio is new allocated, sync, and not in cache */
  1883			if (!folio_test_swapcache(folio) || folio->swap.val != swap.val) {
  1884				error = -EEXIST;
  1885				goto unlock;
  1886			}
  1887			if (!folio_test_uptodate(folio)) {
  1888				error = -EIO;
  1889				goto failed;
  1890			}
  1891			folio_wait_writeback(folio);
  1892		}
  1893		if (!shmem_confirm_swap(mapping, index, swap)) {
  1894			error = -EEXIST;
  1895			goto unlock;
  1896		}
  1897	
  1898		/*
  1899		 * Some architectures may have to restore extra metadata to the
  1900		 * folio after reading from swap.
  1901		 */
  1902		arch_swap_restore(swap, folio);
  1903	
  1904		/* With cache bypass, folio is new allocated and always respect gfp flags */
  1905		if (cache_result != SWAP_CACHE_BYPASS && shmem_should_replace_folio(folio, gfp)) {
  1906			error = shmem_replace_folio(&folio, gfp, info, index);
  1907			if (error)
  1908				goto failed;
  1909		}
  1910	
  1911		/*
  1912		 * The expected value checking below should be enough to ensure
  1913		 * only one up-to-date swapin success. swap_free() is called after
  1914		 * this, so the entry can't be reused. As long as the mapping still
  1915		 * has the old entry value, it's never swapped in or modified.
  1916		 */
  1917		error = shmem_add_to_page_cache(folio, mapping, index,
  1918						swp_to_radix_entry(swap), gfp);
  1919		if (error)
  1920			goto failed;
  1921	
  1922		shmem_recalc_inode(inode, 0, -1);
  1923	
  1924		if (sgp == SGP_WRITE)
  1925			folio_mark_accessed(folio);
  1926	
  1927		if (cache_result != SWAP_CACHE_BYPASS)
  1928			delete_from_swap_cache(folio);
  1929		folio_mark_dirty(folio);
  1930		swap_free(swap);
  1931		put_swap_device(si);
  1932	
  1933		*foliop = folio;
  1934		return 0;
  1935	failed:
  1936		if (!shmem_confirm_swap(mapping, index, swap))
  1937			error = -EEXIST;
  1938		if (error == -EIO)
  1939			shmem_set_folio_swapin_error(inode, index, folio, swap);
  1940	unlock:
  1941		if (folio) {
  1942			folio_unlock(folio);
  1943			folio_put(folio);
  1944		}
  1945		put_swap_device(si);
  1946	
  1947		return error;
  1948	}
  1949	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


  parent reply	other threads:[~2024-01-03 13:46 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-02 17:53 [PATCH v2 0/9] swapin refactor for optimization and unified readahead Kairui Song
2024-01-02 17:53 ` [PATCH v2 1/9] mm/swapfile.c: add back some comment Kairui Song
2024-01-02 17:53 ` [PATCH v2 2/9] mm/swap: move no readahead swapin code to a stand-alone helper Kairui Song
2024-01-04  7:28   ` Huang, Ying
2024-01-05  7:43     ` Kairui Song
2024-01-02 17:53 ` [PATCH v2 3/9] mm/swap: avoid doing extra unlock error checks for direct swapin Kairui Song
2024-01-04  8:10   ` Huang, Ying
2024-01-09  9:38     ` Kairui Song
2024-01-02 17:53 ` [PATCH v2 4/9] mm/swap: always account swapped in page into current memcg Kairui Song
2024-01-05  7:14   ` Huang, Ying
2024-01-05  7:33     ` Kairui Song
2024-01-08  7:44       ` Huang, Ying
2024-01-09  9:42         ` Kairui Song
2024-01-02 17:53 ` [PATCH v2 5/9] mm/swap: introduce swapin_entry for unified readahead policy Kairui Song
2024-01-05  7:28   ` Huang, Ying
2024-01-10  2:42     ` Kairui Song
2024-01-02 17:53 ` [PATCH v2 6/9] mm/swap: handle swapcache lookup in swapin_entry Kairui Song
2024-01-08  8:26   ` Huang, Ying
2024-01-10  2:53     ` Kairui Song
2024-01-15  1:45       ` Huang, Ying
2024-01-15 17:11         ` Kairui Song
2024-01-02 17:53 ` [PATCH v2 7/9] mm/swap: avoid a duplicated swap cache lookup for SWP_SYNCHRONOUS_IO Kairui Song
2024-01-03 12:50   ` kernel test robot
2024-01-02 17:53 ` [PATCH v2 8/9] mm/swap: introduce a helper for swapin without vmfault Kairui Song
2024-01-09  1:08   ` Huang, Ying
2024-01-10  3:32     ` Kairui Song
2024-01-15  1:52       ` Huang, Ying
2024-01-21 18:40         ` Kairui Song
2024-01-22  6:38           ` Huang, Ying
2024-01-22 11:35             ` Kairui Song
2024-01-24  3:31               ` Huang, Ying
2024-01-02 17:53 ` [PATCH v2 9/9] mm/swap, shmem: use new swapin helper to skip readahead conditionally Kairui Song
2024-01-03 11:56   ` kernel test robot
2024-01-03 13:45   ` kernel test robot [this message]
2024-01-09  2:03   ` Huang, Ying
2024-01-10  3:35     ` Kairui Song
2024-01-30  0:39       ` Kairui Song
2024-01-30  2:01         ` Huang, Ying

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=202401032120.uWKybc56-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=chrisl@kernel.org \
    --cc=david@redhat.com \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=kasong@tencent.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=ryncsn@gmail.com \
    --cc=willy@infradead.org \
    --cc=ying.huang@intel.com \
    --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;
as well as URLs for NNTP newsgroup(s).