[<prev] [next>] [day] [month] [year] [list]
Message-ID: <820e29bb-38ee-447e-b77b-9ca2bf46b2f6@gmail.com>
Date: Fri, 16 Jan 2026 18:21:58 +0100
From: John Smith <barrdetwix@...il.com>
To: linux-ext4@...r.kernel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: WARN_ON_ONCE: (PF_MEMALLOC && nofail) in __alloc_pages_slowpath via
ext4, iput, kswapd
Hi list,
I don't have a reproducer for this WARN, but it made itself known by freezing my desktop for ~5s, so I thought I'd write home.
In __alloc_pages_slowpath, I hit:
if (unlikely(nofail)) {
<... snip ...>
/*
* PF_MEMALLOC request from this context is rather bizarre
* because we cannot reclaim anything and only can loop waiting
* for somebody to do a work for us.
*/
WARN_ON_ONCE(current->flags & PF_MEMALLOC);
}
I do have bcachefs loaded via DKMS with a mix of filesystems mounted, so this is maybe not the ideal bug report.
But here it is, just in case.
[82941.014770] ------------[ cut here ]------------
[82941.014777] WARNING: CPU: 13 PID: 152 at mm/page_alloc.c:4660 __alloc_pages_slowpath.constprop.0+0xb76/0xe20
[82941.014788] Modules linked in: bcachefs(OE) lz4hc_compress lz4_compress uas usb_storage uinput nvidia_uvm(OE) snd_seq_dummy snd_hrtimer rfcomm snd_seq snd_seq_device xt_conntrack nft_chain_nat xt_MASQUERADE nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 bridge xfrm_user xfrm_algo xt_addrtype nft_compat x_tables qrtr overlay cmac algif_hash algif_skcipher af_alg bnep 8021q garp stp llc mrp sunrpc binfmt_misc nvidia_drm(OE) nvidia_modeset(OE) nls_ascii nls_cp437 vfat fat nvidia(OE) amd_atl intel_rapl_msr intel_rapl_common edac_mce_amd kvm_amd snd_hda_codec_alc662 snd_hda_codec_realtek_lib snd_hda_codec_nvhdmi kvm snd_hda_codec_generic snd_hda_codec_hdmi snd_hda_intel snd_hda_codec btusb wireguard snd_hda_core btmtk btrtl libcurve25519 snd_intel_dspcfg btbcm libchacha20poly1305 snd_intel_sdw_acpi drm_ttm_helper irqbypass btintel snd_hwdep libchacha ttm ghash_clmulni_intel ip6_udp_tunnel battery snd_pcm aesni_intel udp_tunnel drm_client_lib bluetooth libpoly1305 rapl drm_kms_helper snd_timer wmi_bmof snd joydev ccp
[82941.014870] video ee1004 soundcore acpi_cpufreq k10temp ecdh_generic cfg80211 sg evdev rfkill drm nf_tables dm_mod parport_pc lp ppdev parport i2c_dev msr configfs efi_pstore nfnetlink autofs4 ext4 crc16 mbcache jbd2 crc32c_cryptoapi btrfs blake2b_generic raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq raid1 raid0 md_mod hid_logitech_hidpp hid_logitech_dj hid_generic usbhid hid sd_mod ahci libahci xhci_pci xhci_hcd nvme libata nvme_core sp5100_tco usbcore watchdog scsi_mod r8169 nvme_keyring nvme_auth i2c_piix4 realtek gpio_amdpt scsi_common usb_common hkdf wmi i2c_smbus gpio_generic button efivarfs
[82941.014935] CPU: 13 UID: 0 PID: 152 Comm: kswapd0 Tainted: G OE 6.18.3+deb14-amd64 #1 PREEMPT(lazy) Debian 6.18.3-1
[82941.014941] Tainted: [O]=OOT_MODULE, [E]=UNSIGNED_MODULE
[82941.014942] Hardware name: Micro-Star International Co., Ltd. MS-7A34/B350 PC MATE (MS-7A34), BIOS A.J0 01/23/2019
[82941.014945] RIP: 0010:__alloc_pages_slowpath.constprop.0+0xb76/0xe20
[82941.014950] Code: ff 83 fe 01 0f 87 17 02 00 00 44 8b 7c 24 24 45 85 ff 0f 84 4a 02 00 00 65 48 8b 05 6c 27 58 02 f6 40 2d 08 0f 84 e3 f4 ff ff <0f> 0b e9 dc f4 ff ff 8b 44 24 60 83 c8 60 65 66 f7 05 63 27 58 02
[82941.014953] RSP: 0018:ffffd010806c3508 EFLAGS: 00010202
[82941.014956] RAX: ffff88ffc22c0000 RBX: 0000000000148c48 RCX: 0000000000000002
[82941.014958] RDX: ffffd010806c3600 RSI: 0000000000000000 RDI: 0000000000008000
[82941.014960] RBP: 0000000000000000 R08: 0000000000000801 R09: 0000000000000000
[82941.014962] R10: 0000000000000000 R11: ffffd010806c3600 R12: ffffd010806c3600
[82941.014964] R13: 0000000000148c48 R14: 0000000000000000 R15: 0000000000000400
[82941.014966] FS: 0000000000000000(0000) GS:ffff89033cf0c000(0000) knlGS:0000000000000000
[82941.014968] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[82941.014970] CR2: 000056296c20d098 CR3: 00000001dc48b000 CR4: 00000000003506f0
[82941.014972] Call Trace:
[82941.014975] <TASK>
[82941.014979] ? __alloc_frozen_pages_noprof+0x321/0x340
[82941.014984] ? alloc_iova+0x34/0x2a0
[82941.014990] ? iommu_v1_map_pages+0x348/0x910
[82941.014995] __alloc_frozen_pages_noprof+0x321/0x340
[82941.015001] alloc_pages_mpol+0x86/0x190
[82941.015006] folio_alloc_noprof+0x5e/0xf0
[82941.015009] __filemap_get_folio+0x1f9/0x580
[82941.015016] __getblk_slow+0x7d/0x200
[82941.015023] __ext4_get_inode_loc+0x155/0x510 [ext4]
[82941.015086] ? ext4_get_inode_loc+0x3f/0xa0 [ext4]
[82941.015142] ext4_get_inode_loc+0x3f/0xa0 [ext4]
[82941.015198] ext4_reserve_inode_write+0x4d/0x100 [ext4]
[82941.015254] __ext4_mark_inode_dirty+0x72/0x240 [ext4]
[82941.015311] ? jbd2__journal_start+0xfc/0x210 [jbd2]
[82941.015324] ext4_dirty_inode+0x5b/0x80 [ext4]
[82941.015380] __mark_inode_dirty+0x5a/0x350
[82941.015386] iput+0x1dc/0x260
[82941.015390] ? dentry_unlink_inode+0x8b/0x110
[82941.015395] __dentry_kill+0x6b/0x190
[82941.015399] shrink_dentry_list+0x68/0xe0
[82941.015404] prune_dcache_sb+0x59/0x80
[82941.015409] super_cache_scan+0x129/0x1e0
[82941.015413] do_shrink_slab+0x147/0x3c0
[82941.015417] shrink_slab+0x275/0x380
[82941.015421] shrink_one+0x121/0x1f0
[82941.015426] shrink_node+0xb13/0xce0
[82941.015432] balance_pgdat+0x550/0xac0
[82941.015437] ? finish_task_switch.isra.0+0x97/0x2c0
[82941.015444] kswapd+0x1d9/0x370
[82941.015449] ? __pfx_autoremove_wake_function+0x10/0x10
[82941.015455] ? __pfx_kswapd+0x10/0x10
[82941.015459] kthread+0xfc/0x240
[82941.015463] ? __pfx_kthread+0x10/0x10
[82941.015467] ret_from_fork+0x1cc/0x200
[82941.015472] ? __pfx_kthread+0x10/0x10
[82941.015475] ret_from_fork_asm+0x1a/0x30
[82941.015480] </TASK>
[82941.015482] ---[ end trace 0000000000000000 ]---
Powered by blists - more mailing lists