From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7B3CC02192 for ; Wed, 5 Feb 2025 14:39:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 31F996B0095; Wed, 5 Feb 2025 09:39:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2CEC06B0096; Wed, 5 Feb 2025 09:39:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 16F52280001; Wed, 5 Feb 2025 09:39:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id E61D86B0095 for ; Wed, 5 Feb 2025 09:39:40 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 9821E1A0D5C for ; Wed, 5 Feb 2025 14:39:40 +0000 (UTC) X-FDA: 83086149720.02.89DA494 Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) by imf04.hostedemail.com (Postfix) with ESMTP id A96F64000D for ; Wed, 5 Feb 2025 14:39:38 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=fjU6QtgI; spf=pass (imf04.hostedemail.com: domain of ioworker0@gmail.com designates 209.85.208.42 as permitted sender) smtp.mailfrom=ioworker0@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1738766378; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=yg6Tg4DF+QuWwfNfh/wFRO7JO+rdVERpEIIZMGAFCL8=; b=VfXBtecPGc1m5JgEQMhbMrYS9TmchB23HeM2O96Eaa93xpzuZmfU7BBg9/9kGOfogu8dbZ 3MZd9efMfCz8LO3S4z5bcAEDw+1phNw+KulTykEkC754n1FdJllIHSh3Bf2e3tlyN74tqK 3OuAtSmqRXHcIww8WWhuV/vt8ndTXI4= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=fjU6QtgI; spf=pass (imf04.hostedemail.com: domain of ioworker0@gmail.com designates 209.85.208.42 as permitted sender) smtp.mailfrom=ioworker0@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1738766378; a=rsa-sha256; cv=none; b=ri0xavmlv7CSdEOLqCtXgVzgW/8bxjwwvzKGEaclzjOC6pNqBlKmA7Ws+oBMDfBK955exL 4VElCWOQQ5Lf+st08UNQQg2aV90A6Re/eISBIWLR7SAfrZlTA4FNbgZt9bbqeHQqeZh69B u7T4EEGVdROBpwM4JmDjVoZIo9JBfsE= Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-5dc0522475eso14000407a12.1 for ; Wed, 05 Feb 2025 06:39:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738766377; x=1739371177; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=yg6Tg4DF+QuWwfNfh/wFRO7JO+rdVERpEIIZMGAFCL8=; b=fjU6QtgI6qHpSfXwFXjzCgZNOuUhho2+Yni+isQgs+8Op6NXPKOtDIlf4+vdLmHYEZ scabW1GAVFXKiEXtX/oWKcs4UHa4R/jlVOt/N1eyWJ9zkj02D2LhX+Tzf7tFPcZcmFgg fjlUVjxfX5OU8GFF4RtYcLuWEBHkDa5iO4ljA6x8PKLS6wyHVXblOC2Hr52X5itPtwqZ TjuMQmcAWRD5yXYdFPY+Zkkxh5hSsrYeFv2wnqpljKLUrotqE2BJxjK8J4yzv+j1iDOi Gle2x0t+dt0MZ4+IR62G2qUck44o4V1/BhQ5min9pf4K3TFe21r3pS67tUZ4hq2E3x7C 3/bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738766377; x=1739371177; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yg6Tg4DF+QuWwfNfh/wFRO7JO+rdVERpEIIZMGAFCL8=; b=wWwhnLXn4EDTnzAFfZxRV1DvQlfvVcrVfDoi8vHIZ3qL5BYk9VmD+Lf8wiMg5amvqw pwtx7JJtIvIlvJ4AxdzYC3tvpYXK2szb834lCa9+XKIrNILjwUs6GHThteFjCipB86CT biYGfk3SiugJvMZs8Fd3BycahSFZ3HWwgRC9bwy5yugCK4381Gx22x/rGvMb2Esb0rXP RA+15qKsN3rgl6j/ltiwtSrgZTeZuIjWQZ0nSRrNbomH56oVjjfDtI6woM4NQaXhLaFq +JYuoZJKONqNpkRM/fkX2IQ+qIfWGMxff+QwTCLLJOAQ86ScEpfpfFO+/R0blvhOJm2c CpVQ== X-Forwarded-Encrypted: i=1; AJvYcCUJZs7UOdqEL8A4sY5O9+ZoEklZgMWCU1M56xba2lDlWctHKYOn1PdlOw/VQ+EngFK4cS6JwMwq4w==@kvack.org X-Gm-Message-State: AOJu0Yzj0ZAdpC1uxC6X58Ll3ty1TETIojCkZ/4GEHYLxcELcPTn23Ej ullil1PPvTX1AuwpUrrMBjGeiCeGTF/q+PFJXHhgVbKCoDj2PjizCSHVs+hQumAWTbAw2VHUie3 /4MXLSPRtAx7wx5KSKummTP6TONg= X-Gm-Gg: ASbGncuFqTbUrAL4XkYdZQZEb/Z2gyGrFl1nkBYI5tl/Nlcq6ards3diHKm3KfhCZbf HGlF8j1OiB7Yk1kKCg4qiJD2UyH4pHwti0G9iit4i/h9qMJBXEObi/UHVHZUH3p4Bq1DOk2zk X-Google-Smtp-Source: AGHT+IEQJEOMLKLa01xt1xRmixXdCYk2PgZrzjG46Q/rviLbmu9ckrktfQst6PD6k8Qvh8O53LejRbNmJlM31b9I9Cc= X-Received: by 2002:a05:6402:13c8:b0:5d0:81af:4a43 with SMTP id 4fb4d7f45d1cf-5dcdb5873damr3534222a12.0.1738766376802; Wed, 05 Feb 2025 06:39:36 -0800 (PST) MIME-Version: 1.0 References: <1738717785.im3r5g2vxc.none.ref@localhost> <1738717785.im3r5g2vxc.none@localhost> <25e2d5e4-8214-40de-99d3-2b657181a9fd@linux.alibaba.com> <5dd39b03-c40e-4f34-bf89-b3e5a12753dc@linux.alibaba.com> In-Reply-To: <5dd39b03-c40e-4f34-bf89-b3e5a12753dc@linux.alibaba.com> From: Lance Yang Date: Wed, 5 Feb 2025 22:39:00 +0800 X-Gm-Features: AWEUYZlm0TareJhuDBCQ5cF_oL3r7WkbrBn6iLTvPxztLLi0FHnOGoQFyEPYfG8 Message-ID: Subject: Re: Hang when swapping huge=within_size tmpfs from zram To: Baolin Wang Cc: "Alex Xu (Hello71)" , linux-mm@kvack.org, Daniel Gomez , Barry Song , David Hildenbrand , Hugh Dickins , Kefeng Wang , Matthew Wilcox , Ryan Roberts , linux-kernel@vger.kernel.org, Andrew Morton Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: A96F64000D X-Stat-Signature: 69rm8mqbtbsetrkau9zh4ow16cdgjygm X-Rspam-User: X-HE-Tag: 1738766378-617129 X-HE-Meta: U2FsdGVkX1+nc4ZN0JN9hZwnrp3WLt/XcZtFNVdSHGLPKxB95w9/FcN0VnUbBajKwY73/pTsnNEmoHkrBKmree092RRjxM6jbtZ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sOIAmrUM9SVSLRA1JEZTLjEM7Xlo4hN7aurWGmi9VNet8XRuowodRG+M0uf6zINDpWbnoq5RaL7MsNHyM/pefYSEXoUmixdB0Tl5nxgTx9FIDSwt/S5WwD02PwuaylQH2yogvQW4mbCZVId5/E/rbWRPKe9syiOP/FVzHWXUvOPoEsdtz7V1l2iLvCh5nhrzNIx8YOu1C4n9H5JAd6cwlJ8EpoJMzbk= X-Bogosity: Ham, tests=bogofilter, spamicity=0.002316, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Wed, Feb 5, 2025 at 2:38=E2=80=AFPM Baolin Wang wrote: > > > > On 2025/2/5 09:55, Baolin Wang wrote: > > Hi Alex, > > > > On 2025/2/5 09:23, Alex Xu (Hello71) wrote: > >> Hi all, > >> > >> On 6.14-rc1, I found that creating a lot of files in tmpfs then deleti= ng > >> them reliably hangs when tmpfs is mounted with huge=3Dwithin_size, and= it > >> is swapped out to zram (zstd/zsmalloc/no backing dev). I bisected this > >> to acd7ccb284b "mm: shmem: add large folio support for tmpfs". > >> > >> When the issue occurs, rm uses 100% CPU, cannot be killed, and has no > >> output in /proc/pid/stack or wchan. Eventually, an RCU stall is > >> detected: > > > > Thanks for your report. Let me try to reproduce the issue locally and > > see what happens. > > > >> rcu: INFO: rcu_preempt detected stalls on CPUs/tasks: > >> rcu: Tasks blocked on level-0 rcu_node (CPUs 0-11): P25160 > >> rcu: (detected by 10, t=3D2102 jiffies, g=3D532677, q=3D4997 ncpus= =3D12) > >> task:rm state:R running task stack:0 pid:25160 > >> tgid:25160 ppid:24309 task_flags:0x400000 flags:0x00004004 > >> Call Trace: > >> > >> ? __schedule+0x388/0x1000 > >> ? kmem_cache_free.part.0+0x23d/0x280 > >> ? sysvec_apic_timer_interrupt+0xa/0x80 > >> ? asm_sysvec_apic_timer_interrupt+0x16/0x20 > >> ? xas_load+0x12/0xc0 > >> ? xas_load+0x8/0xc0 > >> ? xas_find+0x144/0x190 > >> ? find_lock_entries+0x75/0x260 > >> ? shmem_undo_range+0xe6/0x5f0 > >> ? shmem_evict_inode+0xe4/0x230 > >> ? mtree_erase+0x7e/0xe0 > >> ? inode_set_ctime_current+0x2e/0x1f0 > >> ? evict+0xe9/0x260 > >> ? _atomic_dec_and_lock+0x31/0x50 > >> ? do_unlinkat+0x270/0x2b0 > >> ? __x64_sys_unlinkat+0x30/0x50 > >> ? do_syscall_64+0x37/0xe0 > >> ? entry_SYSCALL_64_after_hwframe+0x50/0x58 > >> > >> > >> Let me know what information is needed to further troubleshoot this > >> issue. > > Sorry, I can't reproduce this issue, and my testing process is as follows= : > 1. Mount tmpfs with huge=3Dwithin_size > 2. Create and write a tmpfs file > 3. Swap out the large folios of the tmpfs file to zram > 4. Execute 'rm' command to remove the tmpfs file I=E2=80=99m unable to reproduce the issue as well, and am following steps s= imilar to Baolin's process: 1) Mount tmpfs with the huge=3Dwithin_size option and enable swap (using zstd/zsmalloc without a backing device). 2) Create and write over 10,000 files in the tmpfs. 3) Swap out the large folios of these tmpfs files to zram. 4) Use the rm command to delete all the files from the tmpfs. Testing with both 2MiB and 64KiB large folio sizes, and with shmem_enabled=3Dwithin_size, but everything works as expected. Thanks, Lance > > Do you have any reproduction scripts or reproduction steps guide? Thanks.