[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202601260934.Lhdzyzmg-lkp@intel.com>
Date: Mon, 26 Jan 2026 09:03:59 +0800
From: kernel test robot <lkp@...el.com>
To: Kairui Song <ryncsn@...il.com>, linux-mm@...ck.org
Cc: oe-kbuild-all@...ts.linux.dev,
Andrew Morton <akpm@...ux-foundation.org>,
Linux Memory Management List <linux-mm@...ck.org>,
Kemeng Shi <shikemeng@...weicloud.com>,
Nhat Pham <nphamcs@...il.com>, Baoquan He <bhe@...hat.com>,
Barry Song <baohua@...nel.org>,
Johannes Weiner <hannes@...xchg.org>,
David Hildenbrand <david@...nel.org>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
linux-kernel@...r.kernel.org, Chris Li <chrisl@...nel.org>,
Kairui Song <kasong@...cent.com>
Subject: Re: [PATCH 09/12] mm, swap: use the swap table to track the swap
count
Hi Kairui,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 10de4550639e9df9242e32e9affc90ed75a27c7d]
url: https://github.com/intel-lab-lkp/linux/commits/Kairui-Song/mm-swap-protect-si-swap_file-properly-and-use-as-a-mount-indicator/20260126-020149
base: 10de4550639e9df9242e32e9affc90ed75a27c7d
patch link: https://lore.kernel.org/r/20260126-swap-table-p3-v1-9-a74155fab9b0%40tencent.com
patch subject: [PATCH 09/12] mm, swap: use the swap table to track the swap count
config: parisc-allyesconfig (https://download.01.org/0day-ci/archive/20260126/202601260934.Lhdzyzmg-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260126/202601260934.Lhdzyzmg-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601260934.Lhdzyzmg-lkp@intel.com/
All warnings (new ones prefixed by >>):
mm/swapfile.c: In function 'unuse_pte_range':
>> mm/swapfile.c:2351:31: warning: variable 'offset' set but not used [-Wunused-but-set-variable]
2351 | unsigned long offset;
| ^~~~~~
>> mm/swapfile.c:2346:34: warning: variable 'si' set but not used [-Wunused-but-set-variable]
2346 | struct swap_info_struct *si;
| ^~
vim +/offset +2351 mm/swapfile.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 2340
^1da177e4c3f41 Linus Torvalds 2005-04-16 2341 static int unuse_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
^1da177e4c3f41 Linus Torvalds 2005-04-16 2342 unsigned long addr, unsigned long end,
10a9c496789fe2 Christoph Hellwig 2022-01-21 2343 unsigned int type)
^1da177e4c3f41 Linus Torvalds 2005-04-16 2344 {
d850fa72987378 Hugh Dickins 2023-06-08 2345 pte_t *pte = NULL;
b56a2d8af9147a Vineeth Remanan Pillai 2019-03-05 @2346 struct swap_info_struct *si;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2347
b56a2d8af9147a Vineeth Remanan Pillai 2019-03-05 2348 si = swap_info[type];
^1da177e4c3f41 Linus Torvalds 2005-04-16 2349 do {
f102cd8b173e06 Matthew Wilcox (Oracle 2022-09-02 2350) struct folio *folio;
f102cd8b173e06 Matthew Wilcox (Oracle 2022-09-02 @2351) unsigned long offset;
0177fe675b3916 Kairui Song 2026-01-26 2352 unsigned long swp_tb;
3f79b187ad2f67 Kairui Song 2022-12-20 2353 unsigned char swp_count;
06fb61462bdea3 Lorenzo Stoakes 2025-11-10 2354 softleaf_t entry;
d850fa72987378 Hugh Dickins 2023-06-08 2355 int ret;
c33c794828f212 Ryan Roberts 2023-06-12 2356 pte_t ptent;
d850fa72987378 Hugh Dickins 2023-06-08 2357
d850fa72987378 Hugh Dickins 2023-06-08 2358 if (!pte++) {
d850fa72987378 Hugh Dickins 2023-06-08 2359 pte = pte_offset_map(pmd, addr);
d850fa72987378 Hugh Dickins 2023-06-08 2360 if (!pte)
d850fa72987378 Hugh Dickins 2023-06-08 2361 break;
d850fa72987378 Hugh Dickins 2023-06-08 2362 }
f102cd8b173e06 Matthew Wilcox (Oracle 2022-09-02 2363)
c33c794828f212 Ryan Roberts 2023-06-12 2364 ptent = ptep_get_lockless(pte);
06fb61462bdea3 Lorenzo Stoakes 2025-11-10 2365 entry = softleaf_from_pte(ptent);
f102cd8b173e06 Matthew Wilcox (Oracle 2022-09-02 2366)
06fb61462bdea3 Lorenzo Stoakes 2025-11-10 2367 if (!softleaf_is_swap(entry))
b56a2d8af9147a Vineeth Remanan Pillai 2019-03-05 2368 continue;
b56a2d8af9147a Vineeth Remanan Pillai 2019-03-05 2369 if (swp_type(entry) != type)
b56a2d8af9147a Vineeth Remanan Pillai 2019-03-05 2370 continue;
b56a2d8af9147a Vineeth Remanan Pillai 2019-03-05 2371
b56a2d8af9147a Vineeth Remanan Pillai 2019-03-05 2372 offset = swp_offset(entry);
044d66c1d2b1c5 Hugh Dickins 2008-02-07 2373 pte_unmap(pte);
d850fa72987378 Hugh Dickins 2023-06-08 2374 pte = NULL;
d850fa72987378 Hugh Dickins 2023-06-08 2375
f28124617f3415 Kairui Song 2025-09-17 2376 folio = swap_cache_get_folio(entry);
f102cd8b173e06 Matthew Wilcox (Oracle 2022-09-02 2377) if (!folio) {
8c63ca5bc3e19f Will Deacon 2021-01-14 2378 struct vm_fault vmf = {
8c63ca5bc3e19f Will Deacon 2021-01-14 2379 .vma = vma,
8c63ca5bc3e19f Will Deacon 2021-01-14 2380 .address = addr,
824ddc601adc2c Nadav Amit 2022-03-22 2381 .real_address = addr,
8c63ca5bc3e19f Will Deacon 2021-01-14 2382 .pmd = pmd,
8c63ca5bc3e19f Will Deacon 2021-01-14 2383 };
8c63ca5bc3e19f Will Deacon 2021-01-14 2384
94dc8bffd8b7fe Matthew Wilcox (Oracle 2024-08-07 2385) folio = swapin_readahead(entry, GFP_HIGHUSER_MOVABLE,
ebc5951eea4993 Andrea Righi 2020-06-01 2386 &vmf);
ebc5951eea4993 Andrea Righi 2020-06-01 2387 }
f102cd8b173e06 Matthew Wilcox (Oracle 2022-09-02 2388) if (!folio) {
0177fe675b3916 Kairui Song 2026-01-26 2389 swp_tb = swap_table_get(__swap_entry_to_cluster(entry),
0177fe675b3916 Kairui Song 2026-01-26 2390 swp_cluster_offset(entry));
0177fe675b3916 Kairui Song 2026-01-26 2391 swp_count = swp_tb_get_count(swp_tb);
0177fe675b3916 Kairui Song 2026-01-26 2392 if (swp_count <= 0)
d850fa72987378 Hugh Dickins 2023-06-08 2393 continue;
b56a2d8af9147a Vineeth Remanan Pillai 2019-03-05 2394 return -ENOMEM;
b56a2d8af9147a Vineeth Remanan Pillai 2019-03-05 2395 }
b56a2d8af9147a Vineeth Remanan Pillai 2019-03-05 2396
f102cd8b173e06 Matthew Wilcox (Oracle 2022-09-02 2397) folio_lock(folio);
f102cd8b173e06 Matthew Wilcox (Oracle 2022-09-02 2398) folio_wait_writeback(folio);
f102cd8b173e06 Matthew Wilcox (Oracle 2022-09-02 2399) ret = unuse_pte(vma, pmd, addr, entry, folio);
b56a2d8af9147a Vineeth Remanan Pillai 2019-03-05 2400 if (ret < 0) {
f102cd8b173e06 Matthew Wilcox (Oracle 2022-09-02 2401) folio_unlock(folio);
f102cd8b173e06 Matthew Wilcox (Oracle 2022-09-02 2402) folio_put(folio);
d850fa72987378 Hugh Dickins 2023-06-08 2403 return ret;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2404 }
b56a2d8af9147a Vineeth Remanan Pillai 2019-03-05 2405
f102cd8b173e06 Matthew Wilcox (Oracle 2022-09-02 2406) folio_free_swap(folio);
f102cd8b173e06 Matthew Wilcox (Oracle 2022-09-02 2407) folio_unlock(folio);
f102cd8b173e06 Matthew Wilcox (Oracle 2022-09-02 2408) folio_put(folio);
d850fa72987378 Hugh Dickins 2023-06-08 2409 } while (addr += PAGE_SIZE, addr != end);
b56a2d8af9147a Vineeth Remanan Pillai 2019-03-05 2410
d850fa72987378 Hugh Dickins 2023-06-08 2411 if (pte)
d850fa72987378 Hugh Dickins 2023-06-08 2412 pte_unmap(pte);
d850fa72987378 Hugh Dickins 2023-06-08 2413 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2414 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 2415
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists