All of lore.kernel.org
 help / color / mirror / Atom feed
* mm/zswap.c:1057:19: error: incompatible pointer types passing 'struct folio *' to parameter of type 'struct swap_io_ctx *'
@ 2026-05-16 10:05 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-05-16 10:05 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: llvm, oe-kbuild-all, 0day robot

tree:   https://github.com/intel-lab-lkp/linux/commits/Christoph-Hellwig/mm-merge-writeout-into-pageout/20260516-003650
head:   dfa0de1c1f86f5c4e96d214b3549d4c5d3be0068
commit: b44db93170f358db8179510ea15bb73b2194941c mm/swap: intoduce struct swap_io_ctx
date:   17 hours ago
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20260516/202605161230.hcgFZncA-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
rustc: rustc 1.88.0 (6b00bc388 2025-06-23)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260516/202605161230.hcgFZncA-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/202605161230.hcgFZncA-lkp@intel.com/

All errors (new ones prefixed by >>):

>> mm/zswap.c:1057:19: error: incompatible pointer types passing 'struct folio *' to parameter of type 'struct swap_io_ctx *' [-Werror,-Wincompatible-pointer-types]
    1057 |         __swap_writepage(folio, NULL);
         |                          ^~~~~
   mm/swap.h:226:43: note: passing argument to parameter 'ctx' here
     226 | void __swap_writepage(struct swap_io_ctx *ctx, struct folio *folio);
         |                                           ^
   1 error generated.


vim +1057 mm/zswap.c

f91e81d31c1ef75 Johannes Weiner   2024-01-29   971  
9986d35d4ceb539 Johannes Weiner   2024-01-29   972  /*********************************
9986d35d4ceb539 Johannes Weiner   2024-01-29   973  * writeback code
9986d35d4ceb539 Johannes Weiner   2024-01-29   974  **********************************/
9986d35d4ceb539 Johannes Weiner   2024-01-29   975  /*
9986d35d4ceb539 Johannes Weiner   2024-01-29   976   * Attempts to free an entry by adding a folio to the swap cache,
9986d35d4ceb539 Johannes Weiner   2024-01-29   977   * decompressing the entry data into the folio, and issuing a
9986d35d4ceb539 Johannes Weiner   2024-01-29   978   * bio write to write the folio back to the swap device.
9986d35d4ceb539 Johannes Weiner   2024-01-29   979   *
9986d35d4ceb539 Johannes Weiner   2024-01-29   980   * This can be thought of as a "resumed writeback" of the folio
9986d35d4ceb539 Johannes Weiner   2024-01-29   981   * to the swap device.  We are basically resuming the same swap
9986d35d4ceb539 Johannes Weiner   2024-01-29   982   * writeback path that was intercepted with the zswap_store()
9986d35d4ceb539 Johannes Weiner   2024-01-29   983   * in the first place.  After the folio has been decompressed into
9986d35d4ceb539 Johannes Weiner   2024-01-29   984   * the swap cache, the compressed version stored by zswap can be
9986d35d4ceb539 Johannes Weiner   2024-01-29   985   * freed.
9986d35d4ceb539 Johannes Weiner   2024-01-29   986   */
9986d35d4ceb539 Johannes Weiner   2024-01-29   987  static int zswap_writeback_entry(struct zswap_entry *entry,
9986d35d4ceb539 Johannes Weiner   2024-01-29   988  				 swp_entry_t swpentry)
9986d35d4ceb539 Johannes Weiner   2024-01-29   989  {
796c2c23e14e754 Chris Li          2024-03-26   990  	struct xarray *tree;
796c2c23e14e754 Chris Li          2024-03-26   991  	pgoff_t offset = swp_offset(swpentry);
9986d35d4ceb539 Johannes Weiner   2024-01-29   992  	struct folio *folio;
9986d35d4ceb539 Johannes Weiner   2024-01-29   993  	struct mempolicy *mpol;
9986d35d4ceb539 Johannes Weiner   2024-01-29   994  	bool folio_was_allocated;
78524b05f1a3e16 Kairui Song       2025-03-14   995  	struct swap_info_struct *si;
ff22f9299d7b2c7 Nhat Pham         2025-03-06   996  	int ret = 0;
9986d35d4ceb539 Johannes Weiner   2024-01-29   997  
9986d35d4ceb539 Johannes Weiner   2024-01-29   998  	/* try to allocate swap cache folio */
78524b05f1a3e16 Kairui Song       2025-03-14   999  	si = get_swap_device(swpentry);
78524b05f1a3e16 Kairui Song       2025-03-14  1000  	if (!si)
78524b05f1a3e16 Kairui Song       2025-03-14  1001  		return -EEXIST;
78524b05f1a3e16 Kairui Song       2025-03-14  1002  
9986d35d4ceb539 Johannes Weiner   2024-01-29  1003  	mpol = get_task_policy(current);
d7cf0d54f21087d Kairui Song       2025-12-20  1004  	folio = swap_cache_alloc_folio(swpentry, GFP_KERNEL, mpol,
de85024b34839e9 Kairui Song       2025-12-20  1005  				       NO_INTERLEAVE_INDEX, &folio_was_allocated);
78524b05f1a3e16 Kairui Song       2025-03-14  1006  	put_swap_device(si);
9986d35d4ceb539 Johannes Weiner   2024-01-29  1007  	if (!folio)
9986d35d4ceb539 Johannes Weiner   2024-01-29  1008  		return -ENOMEM;
9986d35d4ceb539 Johannes Weiner   2024-01-29  1009  
9986d35d4ceb539 Johannes Weiner   2024-01-29  1010  	/*
9986d35d4ceb539 Johannes Weiner   2024-01-29  1011  	 * Found an existing folio, we raced with swapin or concurrent
9986d35d4ceb539 Johannes Weiner   2024-01-29  1012  	 * shrinker. We generally writeback cold folios from zswap, and
9986d35d4ceb539 Johannes Weiner   2024-01-29  1013  	 * swapin means the folio just became hot, so skip this folio.
9986d35d4ceb539 Johannes Weiner   2024-01-29  1014  	 * For unlikely concurrent shrinker case, it will be unlinked
9986d35d4ceb539 Johannes Weiner   2024-01-29  1015  	 * and freed when invalidated by the concurrent shrinker anyway.
9986d35d4ceb539 Johannes Weiner   2024-01-29  1016  	 */
9986d35d4ceb539 Johannes Weiner   2024-01-29  1017  	if (!folio_was_allocated) {
ff22f9299d7b2c7 Nhat Pham         2025-03-06  1018  		ret = -EEXIST;
ff22f9299d7b2c7 Nhat Pham         2025-03-06  1019  		goto out;
9986d35d4ceb539 Johannes Weiner   2024-01-29  1020  	}
9986d35d4ceb539 Johannes Weiner   2024-01-29  1021  
9986d35d4ceb539 Johannes Weiner   2024-01-29  1022  	/*
9986d35d4ceb539 Johannes Weiner   2024-01-29  1023  	 * folio is locked, and the swapcache is now secured against
f9c0f1c32cb568e Chengming Zhou    2024-02-04  1024  	 * concurrent swapping to and from the slot, and concurrent
f9c0f1c32cb568e Chengming Zhou    2024-02-04  1025  	 * swapoff so we can safely dereference the zswap tree here.
f9c0f1c32cb568e Chengming Zhou    2024-02-04  1026  	 * Verify that the swap entry hasn't been invalidated and recycled
f9c0f1c32cb568e Chengming Zhou    2024-02-04  1027  	 * behind our backs, to avoid overwriting a new swap folio with
f9c0f1c32cb568e Chengming Zhou    2024-02-04  1028  	 * old compressed data. Only when this is successful can the entry
f9c0f1c32cb568e Chengming Zhou    2024-02-04  1029  	 * be dereferenced.
9986d35d4ceb539 Johannes Weiner   2024-01-29  1030  	 */
9986d35d4ceb539 Johannes Weiner   2024-01-29  1031  	tree = swap_zswap_tree(swpentry);
ff22f9299d7b2c7 Nhat Pham         2025-03-06  1032  	if (entry != xa_load(tree, offset)) {
ff22f9299d7b2c7 Nhat Pham         2025-03-06  1033  		ret = -ENOMEM;
ff22f9299d7b2c7 Nhat Pham         2025-03-06  1034  		goto out;
9986d35d4ceb539 Johannes Weiner   2024-01-29  1035  	}
9986d35d4ceb539 Johannes Weiner   2024-01-29  1036  
ff22f9299d7b2c7 Nhat Pham         2025-03-06  1037  	if (!zswap_decompress(entry, folio)) {
ff22f9299d7b2c7 Nhat Pham         2025-03-06  1038  		ret = -EIO;
ff22f9299d7b2c7 Nhat Pham         2025-03-06  1039  		goto out;
ff22f9299d7b2c7 Nhat Pham         2025-03-06  1040  	}
ff22f9299d7b2c7 Nhat Pham         2025-03-06  1041  
ff22f9299d7b2c7 Nhat Pham         2025-03-06  1042  	xa_erase(tree, offset);
9986d35d4ceb539 Johannes Weiner   2024-01-29  1043  
9986d35d4ceb539 Johannes Weiner   2024-01-29  1044  	count_vm_event(ZSWPWB);
9986d35d4ceb539 Johannes Weiner   2024-01-29  1045  	if (entry->objcg)
e7ac4daeed91a25 Barry Song        2024-11-07  1046  		count_objcg_events(entry->objcg, ZSWPWB, 1);
9986d35d4ceb539 Johannes Weiner   2024-01-29  1047  
a230c20e63efef3 Chengming Zhou    2024-02-04  1048  	zswap_entry_free(entry);
9986d35d4ceb539 Johannes Weiner   2024-01-29  1049  
9986d35d4ceb539 Johannes Weiner   2024-01-29  1050  	/* folio is up to date */
9986d35d4ceb539 Johannes Weiner   2024-01-29  1051  	folio_mark_uptodate(folio);
9986d35d4ceb539 Johannes Weiner   2024-01-29  1052  
9986d35d4ceb539 Johannes Weiner   2024-01-29  1053  	/* move it to the tail of the inactive list after end_writeback */
9986d35d4ceb539 Johannes Weiner   2024-01-29  1054  	folio_set_reclaim(folio);
9986d35d4ceb539 Johannes Weiner   2024-01-29  1055  
9986d35d4ceb539 Johannes Weiner   2024-01-29  1056  	/* start writeback */
2ba8ffcefe81241 Christoph Hellwig 2025-06-10 @1057  	__swap_writepage(folio, NULL);
9986d35d4ceb539 Johannes Weiner   2024-01-29  1058  
ff22f9299d7b2c7 Nhat Pham         2025-03-06  1059  out:
ff22f9299d7b2c7 Nhat Pham         2025-03-06  1060  	if (ret && ret != -EEXIST) {
fd8d4f862f8c278 Kairui Song       2025-09-17  1061  		swap_cache_del_folio(folio);
ff22f9299d7b2c7 Nhat Pham         2025-03-06  1062  		folio_unlock(folio);
ff22f9299d7b2c7 Nhat Pham         2025-03-06  1063  	}
ff22f9299d7b2c7 Nhat Pham         2025-03-06  1064  	folio_put(folio);
ff22f9299d7b2c7 Nhat Pham         2025-03-06  1065  	return ret;
9986d35d4ceb539 Johannes Weiner   2024-01-29  1066  }
9986d35d4ceb539 Johannes Weiner   2024-01-29  1067  

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-16 10:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-16 10:05 mm/zswap.c:1057:19: error: incompatible pointer types passing 'struct folio *' to parameter of type 'struct swap_io_ctx *' kernel test robot

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.