From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1391F36EA9A for ; Mon, 11 May 2026 11:20:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778498425; cv=none; b=nquLtym1pIAM0662AiC1BU4qXaRioJ9PvrkoIqBe+C03M74mSCy5KBud/brJ9q3ntAil67L24o140NSxdrL/QU+Tm8PDlxATIDCPIWf0hdPRulmWemuU7INvsyCN4lnVvAfohZGf+O3oORuIRvMJxU7VY5g+sObBNwobs2/7uZY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778498425; c=relaxed/simple; bh=nzJJgs9Qyq6VBU5jX5rYgpMmfbKBPPxZ0jqc0RomaGU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tvxXfJkMiHcMc0BVaxsYi0Q4ryjzBEubY8fruy+IiFdk4XlVq1EPgexDwQSI8JYAy6X9LS76rL/6Q63gmZUtxt50C7kzxkrvAXJwu3bMTwtqlklLnR1FDQq1s0a1M+lVzoyrKUUtTPnDdI/blBn/2Kg/nt+EFk4uDkxy/KI9sMA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=Q6tx2CBO; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="Q6tx2CBO" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-ID:Content-Description; bh=tcuEfmKzpANWPxZKVVmyF91NQ+lO12DPxpVfBF6zcDI=; b=Q6tx2CBOyF19Sw3lyvD2aX4CWJ e3JE12ONheF4CnuwKM8P53FA5teqEK5vWFf1FS2/PaI388PcAsoyev3kQxsWnSabDljA81y4pyW6K rzo23OmFgRtVRWqUg+xcARoebJMD6vEGaH5sqJk2Q1S8DStbeQOErBDy9LSoDqIxTwoMbb05aEJJK gLEnUpYhJLoJhQHlOlDCWnlNDylYW47c8rx8+fW2AfOZad4N/pE7M+Ena/IO+SpqYQuhnUqu/sDnM yNdvsagec1ydHUKS8W0jVbPDoolpL6fvLiGWszUCKsHhCAKyrR0XIttYbIyd9rUemhd3jkjLdGnx9 hOqxrP+Q==; Received: from authenticated user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wMOg0-001YwC-0h; Mon, 11 May 2026 11:19:56 +0000 Date: Mon, 11 May 2026 04:19:50 -0700 From: Breno Leitao To: Kairui Song Cc: linux-mm@kvack.org, Andrew Morton , Kemeng Shi , Nhat Pham , Baoquan He , Barry Song , Johannes Weiner , David Hildenbrand , Lorenzo Stoakes , Youngjun Park , linux-kernel@vger.kernel.org, Chris Li , kernel-team@meta.com Subject: Re: [PATCH v3 09/12] mm, swap: use the swap table to track the swap count Message-ID: References: <20260218-swap-table-p3-v3-0-f4e34be021a7@tencent.com> <20260218-swap-table-p3-v3-9-f4e34be021a7@tencent.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20260218-swap-table-p3-v3-9-f4e34be021a7@tencent.com> X-Debian-User: leitao Hello Kairui, On Wed, Feb 18, 2026 at 04:06:34AM +0800, Kairui Song wrote: > @@ -479,6 +469,7 @@ static void swap_cluster_assert_empty(struct swap_clu= ster_info *ci, > } while (++ci_off < ci_end); > =20 > WARN_ON_ONCE(bad_slots !=3D (swapoff ? ci->count : 0)); > + WARN_ON_ONCE(nr =3D=3D SWAPFILE_CLUSTER && ci->extend_table); On my automatic tests with 7.1 kernel I am seeing the following warning. The test was running on commit 74fe02ce122a6103f20 ("Merge tag 'wq-for-7.1-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/= wq"). This happened only once so far. WARNING: mm/swapfile.c:471 at swap_cluster_assert_empty+0x1b6/0x1d0, CPU= #2: swapoff/1265108 =1B[36m[warn]=1B[0m Modules linked in: sunrpc(E) squashfs(E) sch_fq(E) act_gact(E) tcp_diag(= E) inet_diag(E) cls_bpf(E) intel_uncore_frequency(E) intel_uncore_frequency= _common(E) skx_edac(E) skx_edac_common(E) nfit(E) x86_pkg_temp_thermal(E) i= ntel_powerclamp(E) coretemp(E) kvm_intel(E) kvm(E) evdev(E) iTCO_wdt(E) ipm= i_si(E) irqbypass(E) ipmi_devintf(E) xhci_pci(E) acpi_cpufreq(E) wmi(E) ipm= i_msghandler(E) button(E) i2c_i801(E) xhci_hcd(E) i2c_smbus(E) sch_fq_codel= (E) ip_tables(E) ip6_tables(E) vhost_net(E) tun(E) vhost(E) vhost_iotlb(E) = tap(E) tls(E) mpls_gso(E) bpf_preload(E) mpls_iptunnel(E) mpls_router(E) fo= u(E) drm(E) loop(E) backlight(E) drm_panel_orientation_quirks(E) autofs4(E)= raid0(E) efivarfs(E) dm_crypt(E) CPU: 2 UID: 0 PID: 1265108 Comm: swapoff Tainted: G S E 7= =2E1.0-0_fbk701_debugnightly_rc0_upstream_76_g74fe02ce122a #1 PREEMPTLAZY= =20 Tainted: [S]=3DCPU_OUT_OF_SPEC, [E]=3DUNSIGNED_MODULE Hardware name: Quanta Twin Lakes MP/Twin Lakes Passive MP, BIOS F09M3A09= 07/03/2023 RIP: 0010:swap_cluster_assert_empty+0x1b6/0x1d0 Code: e8 03 48 b9 00 00 00 00 00 fc ff df 0f b6 04 08 84 c0 75 1a 41 0f = b7 07 39 c3 74 99 0f 0b 81 7c 24 08 00 02 00 00 74 97 eb be <0f> 0b eb ba 4= 4 89 f9 80 e1 07 fe c1 38 c1 7c da 4c 89 ff e8 12 46 RSP: 0018:ffff8882a2257a48 EFLAGS: 00010286 RAX: 1ffff1106956192d RBX: 0000000000000000 RCX: dffffc0000000000 RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff8884dbeeaff8 RBP: ffff8884dbeeaff8 R08: ffff8884dbeeafff R09: 1ffff1109b7dd5ff R10: dffffc0000000000 R11: ffffed109b7dd600 R12: ffff88834ab0c960 R13: 0000000000000200 R14: ffff88834ab0c968 R15: 0000000000000200 FS: 00007fab994cf800(0000) GS:ffff88909c8c0000(0000) knlGS:000000000000= 0000 CR2: 00007f789da9b110 CR3: 00000004bdc63001 CR4: 00000000007726f0 PKRU: 55555554 Call Trace: __free_cluster+0x2f/0x180 swap_cache_del_folio+0x120/0x240 folio_free_swap+0x51b/0x630 ? folio_free_swap+0x2e6/0x630 try_to_unuse+0x216d/0x2470 ? try_to_unuse+0xbc9/0x2470 __se_sys_swapoff+0x3fb/0x8e0 do_syscall_64+0xfa/0x990 ? irqentry_exit+0x102/0x770 ? trace_irq_disable+0x64/0x1c0 ? entry_SYSCALL_64_after_hwframe+0x4b/0x53 entry_SYSCALL_64_after_hwframe+0x4b/0x53 RIP: 0033:0x7fab996ac08b Code: 0f 1e fa 48 83 fe 01 48 8b 15 89 ad 0c 00 19 c0 83 e0 f0 83 c0 26 = 64 89 02 b8 ff ff ff ff c3 f3 0f 1e fa b8 a8 00 00 00 0f 05 <48> 3d 01 f0 f= f ff 73 01 c3 48 8b 0d 5d ad 0c 00 f7 d8 64 89 01 48 RSP: 002b:00007fff9cde2488 EFLAGS: 00000202 ORIG_RAX: 00000000000000a8 RAX: ffffffffffffffda RBX: 00007fff9cde3e98 RCX: 00007fab996ac08b RDX: 0000000000000001 RSI: 0000000000000c00 RDI: 000055bfaf2199b0 RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000001 R10: 00000000000000bf R11: 0000000000000202 R12: 0000000000000000 R13: 000055bfaf211479 R14: 000055bfaf212b00 R15: 000055bfaf212ad8 irq event stamp: 0 hardirqs last enabled at (0): [<0000000000000000>] 0x0 hardirqs last disabled at (0): [] copy_process+0x833/0= x32b0 softirqs last enabled at (0): [] copy_process+0x833/0= x32b0 softirqs last disabled at (0): [<0000000000000000>] 0x0 Decodeding the stack, I see the following file:lines (against the same commit as above (74fe02ce122a6103f20)) swap_cluster_assert_empty+0x1b6 mm/swapfile.c:471 WARN: nr =3D=3D SWA= PFILE_CLUSTER && ci->extend_table __free_cluster+0x2f mm/swapfile.c:585 (return from swap_c= luster_assert_empty) then swap_cluster_free_table at lin= e 586 swap_cache_del_folio+0x120 mm/swap_state.c:298 __swap_cache_del_fo= lio() (chain __swap_cluster_free_entries = =E2=86=92 free_cluster =E2=86=92 __free_cluster all inlined) folio_free_swap+0x51b mm/swapfile.c:2037 swap_cache_del_foli= o(folio) folio_free_swap+0x2e6 mm/swapfile.c:2034 if (folio_maybe_swa= pped(folio)) try_to_unuse+0x216d mm/swapfile.c:2628 try_to_unuse+0xbc9 mm/swapfile.c:2592 unuse_mm() chain __se_sys_swapoff+0x3fb mm/swapfile.c:2903 do_syscall_64+0xfa arch/x86/entry/syscall_64.c Does it ring a bell? --breno