tree: https://github.com/ammarfaizi2/linux-block akpm/mm/mm-unstable head: 1e6b789996e7b8b0d382a144a6dccde7b824b510 commit: 91a46452f641672b82f8a01c9f114f85cdfe0d76 [402/439] shmem: eliminate struct page from shmem_swapin_folio() config: s390-buildonly-randconfig-r001-20220901 compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project c55b41d5199d2394dd6cdb8f52180d8b81d809d4) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install s390 cross compiling tool for clang build # apt-get install binutils-s390x-linux-gnu # https://github.com/ammarfaizi2/linux-block/commit/91a46452f641672b82f8a01c9f114f85cdfe0d76 git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block git fetch --no-tags ammarfaizi2-block akpm/mm/mm-unstable git checkout 91a46452f641672b82f8a01c9f114f85cdfe0d76 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot All errors (new ones prefixed by >>): >> mm/shmem.c:1738:10: error: call to undeclared function 'swap_cache_get_folio'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] folio = swap_cache_get_folio(swap, NULL, 0); ^ >> mm/shmem.c:1738:8: error: incompatible integer to pointer conversion assigning to 'struct folio *' from 'int' [-Wint-conversion] folio = swap_cache_get_folio(swap, NULL, 0); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated. vim +/swap_cache_get_folio +1738 mm/shmem.c 1711 1712 /* 1713 * Swap in the folio pointed to by *foliop. 1714 * Caller has to make sure that *foliop contains a valid swapped folio. 1715 * Returns 0 and the folio in foliop if success. On failure, returns the 1716 * error code and NULL in *foliop. 1717 */ 1718 static int shmem_swapin_folio(struct inode *inode, pgoff_t index, 1719 struct folio **foliop, enum sgp_type sgp, 1720 gfp_t gfp, struct vm_area_struct *vma, 1721 vm_fault_t *fault_type) 1722 { 1723 struct address_space *mapping = inode->i_mapping; 1724 struct shmem_inode_info *info = SHMEM_I(inode); 1725 struct mm_struct *charge_mm = vma ? vma->vm_mm : NULL; 1726 struct folio *folio = NULL; 1727 swp_entry_t swap; 1728 int error; 1729 1730 VM_BUG_ON(!*foliop || !xa_is_value(*foliop)); 1731 swap = radix_to_swp_entry(*foliop); 1732 *foliop = NULL; 1733 1734 if (is_swapin_error_entry(swap)) 1735 return -EIO; 1736 1737 /* Look it up and read it in.. */ > 1738 folio = swap_cache_get_folio(swap, NULL, 0); 1739 if (!folio) { 1740 /* Or update major stats only when swapin succeeds?? */ 1741 if (fault_type) { 1742 *fault_type |= VM_FAULT_MAJOR; 1743 count_vm_event(PGMAJFAULT); 1744 count_memcg_event_mm(charge_mm, PGMAJFAULT); 1745 } 1746 /* Here we actually start the io */ 1747 folio = shmem_swapin(swap, gfp, info, index); 1748 if (!folio) { 1749 error = -ENOMEM; 1750 goto failed; 1751 } 1752 } 1753 1754 /* We have to do this with folio locked to prevent races */ 1755 folio_lock(folio); 1756 if (!folio_test_swapcache(folio) || 1757 folio_swap_entry(folio).val != swap.val || 1758 !shmem_confirm_swap(mapping, index, swap)) { 1759 error = -EEXIST; 1760 goto unlock; 1761 } 1762 if (!folio_test_uptodate(folio)) { 1763 error = -EIO; 1764 goto failed; 1765 } 1766 folio_wait_writeback(folio); 1767 1768 /* 1769 * Some architectures may have to restore extra metadata to the 1770 * folio after reading from swap. 1771 */ 1772 arch_swap_restore(swap, folio); 1773 1774 if (shmem_should_replace_folio(folio, gfp)) { 1775 error = shmem_replace_folio(&folio, gfp, info, index); 1776 if (error) 1777 goto failed; 1778 } 1779 1780 error = shmem_add_to_page_cache(folio, mapping, index, 1781 swp_to_radix_entry(swap), gfp, 1782 charge_mm); 1783 if (error) 1784 goto failed; 1785 1786 spin_lock_irq(&info->lock); 1787 info->swapped--; 1788 shmem_recalc_inode(inode); 1789 spin_unlock_irq(&info->lock); 1790 1791 if (sgp == SGP_WRITE) 1792 folio_mark_accessed(folio); 1793 1794 delete_from_swap_cache(folio); 1795 folio_mark_dirty(folio); 1796 swap_free(swap); 1797 1798 *foliop = folio; 1799 return 0; 1800 failed: 1801 if (!shmem_confirm_swap(mapping, index, swap)) 1802 error = -EEXIST; 1803 if (error == -EIO) 1804 shmem_set_folio_swapin_error(inode, index, folio, swap); 1805 unlock: 1806 if (folio) { 1807 folio_unlock(folio); 1808 folio_put(folio); 1809 } 1810 1811 return error; 1812 } 1813 -- 0-DAY CI Kernel Test Service https://01.org/lkp