From: kernel test robot <lkp@intel.com>
To: Nhat Pham <nphamcs@gmail.com>, linux-mm@kvack.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
akpm@linux-foundation.org, hannes@cmpxchg.org, hughd@google.com,
yosry.ahmed@linux.dev, mhocko@kernel.org,
roman.gushchin@linux.dev, shakeel.butt@linux.dev,
muchun.song@linux.dev, len.brown@intel.com,
chengming.zhou@linux.dev, kasong@tencent.com, chrisl@kernel.org,
huang.ying.caritas@gmail.com, ryan.roberts@arm.com,
shikemeng@huaweicloud.com, viro@zeniv.linux.org.uk,
baohua@kernel.org, bhe@redhat.com, osalvador@suse.de,
lorenzo.stoakes@oracle.com, christophe.leroy@csgroup.eu,
pavel@kernel.org, kernel-team@meta.com,
linux-kernel@vger.kernel.org, cgroups@vger.kernel.org,
linux-pm@vger.kernel.org, peterx@redhat.com, riel@surriel.com,
joshua.hahnjy@gmail.com
Subject: Re: [PATCH v3 01/20] mm/swap: decouple swap cache from physical swap infrastructure
Date: Mon, 9 Feb 2026 10:22:28 +0800 [thread overview]
Message-ID: <202602091044.soVrWeDA-lkp@intel.com> (raw)
In-Reply-To: <20260208215839.87595-2-nphamcs@gmail.com>
Hi Nhat,
kernel test robot noticed the following build errors:
[auto build test ERROR on linus/master]
[also build test ERROR on v6.19]
[cannot apply to akpm-mm/mm-everything tj-cgroup/for-next tip/smp/core next-20260205]
[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/Nhat-Pham/swap-rearrange-the-swap-header-file/20260209-065842
base: linus/master
patch link: https://lore.kernel.org/r/20260208215839.87595-2-nphamcs%40gmail.com
patch subject: [PATCH v3 01/20] mm/swap: decouple swap cache from physical swap infrastructure
config: x86_64-allnoconfig (https://download.01.org/0day-ci/archive/20260209/202602091044.soVrWeDA-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260209/202602091044.soVrWeDA-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/202602091044.soVrWeDA-lkp@intel.com/
All errors (new ones prefixed by >>):
>> mm/vmscan.c:715:3: error: call to undeclared function 'swap_cache_lock_irq'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
715 | swap_cache_lock_irq();
| ^
>> mm/vmscan.c:762:3: error: call to undeclared function 'swap_cache_unlock_irq'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
762 | swap_cache_unlock_irq();
| ^
mm/vmscan.c:762:3: note: did you mean 'swap_cluster_unlock_irq'?
mm/swap.h:350:20: note: 'swap_cluster_unlock_irq' declared here
350 | static inline void swap_cluster_unlock_irq(struct swap_cluster_info *ci)
| ^
mm/vmscan.c:801:3: error: call to undeclared function 'swap_cache_unlock_irq'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
801 | swap_cache_unlock_irq();
| ^
3 errors generated.
--
>> mm/shmem.c:2168:2: error: call to undeclared function 'swap_cache_lock_irq'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
2168 | swap_cache_lock_irq();
| ^
>> mm/shmem.c:2173:2: error: call to undeclared function 'swap_cache_unlock_irq'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
2173 | swap_cache_unlock_irq();
| ^
2 errors generated.
vim +/swap_cache_lock_irq +715 mm/vmscan.c
700
701 /*
702 * Same as remove_mapping, but if the folio is removed from the mapping, it
703 * gets returned with a refcount of 0.
704 */
705 static int __remove_mapping(struct address_space *mapping, struct folio *folio,
706 bool reclaimed, struct mem_cgroup *target_memcg)
707 {
708 int refcount;
709 void *shadow = NULL;
710
711 BUG_ON(!folio_test_locked(folio));
712 BUG_ON(mapping != folio_mapping(folio));
713
714 if (folio_test_swapcache(folio)) {
> 715 swap_cache_lock_irq();
716 } else {
717 spin_lock(&mapping->host->i_lock);
718 xa_lock_irq(&mapping->i_pages);
719 }
720
721 /*
722 * The non racy check for a busy folio.
723 *
724 * Must be careful with the order of the tests. When someone has
725 * a ref to the folio, it may be possible that they dirty it then
726 * drop the reference. So if the dirty flag is tested before the
727 * refcount here, then the following race may occur:
728 *
729 * get_user_pages(&page);
730 * [user mapping goes away]
731 * write_to(page);
732 * !folio_test_dirty(folio) [good]
733 * folio_set_dirty(folio);
734 * folio_put(folio);
735 * !refcount(folio) [good, discard it]
736 *
737 * [oops, our write_to data is lost]
738 *
739 * Reversing the order of the tests ensures such a situation cannot
740 * escape unnoticed. The smp_rmb is needed to ensure the folio->flags
741 * load is not satisfied before that of folio->_refcount.
742 *
743 * Note that if the dirty flag is always set via folio_mark_dirty,
744 * and thus under the i_pages lock, then this ordering is not required.
745 */
746 refcount = 1 + folio_nr_pages(folio);
747 if (!folio_ref_freeze(folio, refcount))
748 goto cannot_free;
749 /* note: atomic_cmpxchg in folio_ref_freeze provides the smp_rmb */
750 if (unlikely(folio_test_dirty(folio))) {
751 folio_ref_unfreeze(folio, refcount);
752 goto cannot_free;
753 }
754
755 if (folio_test_swapcache(folio)) {
756 swp_entry_t swap = folio->swap;
757
758 if (reclaimed && !mapping_exiting(mapping))
759 shadow = workingset_eviction(folio, target_memcg);
760 __swap_cache_del_folio(folio, swap, shadow);
761 memcg1_swapout(folio, swap);
> 762 swap_cache_unlock_irq();
763 put_swap_folio(folio, swap);
764 } else {
765 void (*free_folio)(struct folio *);
766
767 free_folio = mapping->a_ops->free_folio;
768 /*
769 * Remember a shadow entry for reclaimed file cache in
770 * order to detect refaults, thus thrashing, later on.
771 *
772 * But don't store shadows in an address space that is
773 * already exiting. This is not just an optimization,
774 * inode reclaim needs to empty out the radix tree or
775 * the nodes are lost. Don't plant shadows behind its
776 * back.
777 *
778 * We also don't store shadows for DAX mappings because the
779 * only page cache folios found in these are zero pages
780 * covering holes, and because we don't want to mix DAX
781 * exceptional entries and shadow exceptional entries in the
782 * same address_space.
783 */
784 if (reclaimed && folio_is_file_lru(folio) &&
785 !mapping_exiting(mapping) && !dax_mapping(mapping))
786 shadow = workingset_eviction(folio, target_memcg);
787 __filemap_remove_folio(folio, shadow);
788 xa_unlock_irq(&mapping->i_pages);
789 if (mapping_shrinkable(mapping))
790 inode_lru_list_add(mapping->host);
791 spin_unlock(&mapping->host->i_lock);
792
793 if (free_folio)
794 free_folio(folio);
795 }
796
797 return 1;
798
799 cannot_free:
800 if (folio_test_swapcache(folio)) {
801 swap_cache_unlock_irq();
802 } else {
803 xa_unlock_irq(&mapping->i_pages);
804 spin_unlock(&mapping->host->i_lock);
805 }
806 return 0;
807 }
808
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2026-02-09 2:22 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-08 21:58 [PATCH v3 00/20] Virtual Swap Space Nhat Pham
2026-02-08 21:58 ` [PATCH v3 01/20] mm/swap: decouple swap cache from physical swap infrastructure Nhat Pham
2026-02-08 22:26 ` [PATCH v3 00/20] Virtual Swap Space Nhat Pham
2026-02-10 17:59 ` Kairui Song
2026-02-10 18:52 ` Johannes Weiner
2026-02-10 19:11 ` Nhat Pham
2026-02-10 19:23 ` Nhat Pham
2026-02-12 5:07 ` Chris Li
2026-02-17 23:36 ` Nhat Pham
2026-02-10 21:58 ` Chris Li
2026-02-20 21:05 ` [PATCH] vswap: fix poor batching behavior of vswap free path Nhat Pham
2026-02-08 22:31 ` [PATCH v3 00/20] Virtual Swap Space Nhat Pham
2026-02-09 12:20 ` Chris Li
2026-02-10 2:36 ` Johannes Weiner
2026-02-10 21:24 ` Chris Li
2026-02-10 23:01 ` Johannes Weiner
2026-02-10 18:00 ` Nhat Pham
2026-02-10 23:17 ` Chris Li
2026-02-08 22:39 ` Nhat Pham
2026-02-09 2:22 ` kernel test robot [this message]
2026-02-08 21:58 ` [PATCH v3 02/20] swap: rearrange the swap header file Nhat Pham
2026-02-08 21:58 ` [PATCH v3 03/20] mm: swap: add an abstract API for locking out swapoff Nhat Pham
2026-02-08 21:58 ` [PATCH v3 04/20] zswap: add new helpers for zswap entry operations Nhat Pham
2026-02-08 21:58 ` [PATCH v3 05/20] mm/swap: add a new function to check if a swap entry is in swap cached Nhat Pham
2026-02-08 21:58 ` [PATCH v3 06/20] mm: swap: add a separate type for physical swap slots Nhat Pham
2026-02-08 21:58 ` [PATCH v3 07/20] mm: create scaffolds for the new virtual swap implementation Nhat Pham
2026-02-08 21:58 ` [PATCH v3 08/20] zswap: prepare zswap for swap virtualization Nhat Pham
2026-02-08 21:58 ` [PATCH v3 09/20] mm: swap: allocate a virtual swap slot for each swapped out page Nhat Pham
2026-02-09 17:12 ` kernel test robot
2026-02-11 13:42 ` kernel test robot
2026-02-08 21:58 ` [PATCH v3 10/20] swap: move swap cache to virtual swap descriptor Nhat Pham
2026-02-08 21:58 ` [PATCH v3 11/20] zswap: move zswap entry management to the " Nhat Pham
2026-02-08 21:58 ` [PATCH v3 12/20] swap: implement the swap_cgroup API using virtual swap Nhat Pham
2026-02-08 21:58 ` [PATCH v3 13/20] swap: manage swap entry lifecycle at the virtual swap layer Nhat Pham
2026-02-08 21:58 ` [PATCH v3 14/20] mm: swap: decouple virtual swap slot from backing store Nhat Pham
2026-02-08 21:58 ` [PATCH v3 15/20] zswap: do not start zswap shrinker if there is no physical swap slots Nhat Pham
2026-02-08 21:58 ` [PATCH v3 16/20] swap: do not unnecesarily pin readahead swap entries Nhat Pham
2026-02-08 21:58 ` [PATCH v3 17/20] swapfile: remove zeromap bitmap Nhat Pham
2026-02-08 21:58 ` [PATCH v3 18/20] memcg: swap: only charge physical swap slots Nhat Pham
2026-02-09 2:01 ` kernel test robot
2026-02-09 2:12 ` kernel test robot
2026-02-08 21:58 ` [PATCH v3 19/20] swap: simplify swapoff using virtual swap Nhat Pham
2026-02-08 21:58 ` [PATCH v3 20/20] swapfile: replace the swap map with bitmaps Nhat Pham
2026-02-08 22:51 ` [PATCH v3 00/20] Virtual Swap Space Nhat Pham
2026-02-12 12:23 ` David Hildenbrand (Arm)
2026-02-12 17:29 ` Nhat Pham
2026-02-12 17:39 ` Nhat Pham
2026-02-12 20:11 ` David Hildenbrand (Arm)
2026-02-12 17:41 ` David Hildenbrand (Arm)
2026-02-12 17:45 ` Nhat Pham
2026-02-10 15:45 ` [syzbot ci] " syzbot ci
2026-02-25 0:09 ` [PATCH v3 00/20] " Askar Safin
2026-02-25 1:04 ` Askar Safin
-- strict thread matches above, loose matches on Subject: below --
2026-02-09 15:37 [PATCH v3 14/20] mm: swap: decouple virtual swap slot from backing store kernel test robot
2026-02-10 6:31 ` Dan Carpenter
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=202602091044.soVrWeDA-lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=bhe@redhat.com \
--cc=cgroups@vger.kernel.org \
--cc=chengming.zhou@linux.dev \
--cc=chrisl@kernel.org \
--cc=christophe.leroy@csgroup.eu \
--cc=hannes@cmpxchg.org \
--cc=huang.ying.caritas@gmail.com \
--cc=hughd@google.com \
--cc=joshua.hahnjy@gmail.com \
--cc=kasong@tencent.com \
--cc=kernel-team@meta.com \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-pm@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@kernel.org \
--cc=muchun.song@linux.dev \
--cc=nphamcs@gmail.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=osalvador@suse.de \
--cc=pavel@kernel.org \
--cc=peterx@redhat.com \
--cc=riel@surriel.com \
--cc=roman.gushchin@linux.dev \
--cc=ryan.roberts@arm.com \
--cc=shakeel.butt@linux.dev \
--cc=shikemeng@huaweicloud.com \
--cc=viro@zeniv.linux.org.uk \
--cc=yosry.ahmed@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.