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 CDD6DC02192 for ; Wed, 5 Feb 2025 06:38:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F18D0280005; Wed, 5 Feb 2025 01:38:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EC69C280004; Wed, 5 Feb 2025 01:38:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DB5C3280005; Wed, 5 Feb 2025 01:38:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id BEBDB280004 for ; Wed, 5 Feb 2025 01:38:49 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 451C9C07DC for ; Wed, 5 Feb 2025 06:38:49 +0000 (UTC) X-FDA: 83084937978.14.2696BA1 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by imf25.hostedemail.com (Postfix) with ESMTP id 54A57A0004 for ; Wed, 5 Feb 2025 06:38:45 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=NzWy81eY; spf=pass (imf25.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.133 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1738737527; 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=rXJPx/6YVFVcgvdCjt0biSyMkWzlix+vmTcNZ6Qc0pc=; b=lN1PyxLsDEqO/S7yotbcnnaC5n9TJC67qZgRXqB5fE4I8jRopzmfu2q2l91Gh/ytUXfhJa DmSB+QgHIQegADLRTPy0+u9QONGcqiJZin7eoac4vczoed6JKwVGQS7FGvRl9H5gaI1Q+7 qR7snqvitrJFxummy8sIfTmUNCtfXIY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1738737527; a=rsa-sha256; cv=none; b=mCk69gGlEEmbx8OlrIxIMcXV/Kx7DJRaxTVbmMnfmgKurCIUZ0CEQclxVaesMJ7tuEZvhD /THunAsgJRe2SaHEaR5l7/PGX+0lFTNIhL0TKnP7oQAekSs0bO+RroekscgqfYOFSEuOtG EAEZTSezTST4+QGAjfqczqLROtZ72yo= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=NzWy81eY; spf=pass (imf25.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.133 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1738737520; h=Message-ID:Date:MIME-Version:Subject:From:To:Content-Type; bh=rXJPx/6YVFVcgvdCjt0biSyMkWzlix+vmTcNZ6Qc0pc=; b=NzWy81eYK/krHAXs6rMwx8q7zBYhio3wVQq9Dg06YmJg7agiKHR/JOMrdhPvCaEB7SAwCiUwJNIMtaQkHra98yoIRrN/K6VD6QCoqVg48VtGXMr2tSfzKHfwHyVoHsq28kBg3v1AhNIH6csUqguvJtVBejhFbvYCKv2jaS1ScQ8= Received: from 30.74.144.115(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0WOoNxun_1738737517 cluster:ay36) by smtp.aliyun-inc.com; Wed, 05 Feb 2025 14:38:37 +0800 Message-ID: <5dd39b03-c40e-4f34-bf89-b3e5a12753dc@linux.alibaba.com> Date: Wed, 5 Feb 2025 14:38:36 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Hang when swapping huge=within_size tmpfs from zram From: Baolin Wang To: "Alex Xu (Hello71)" , linux-mm@kvack.org, Daniel Gomez Cc: Barry Song , David Hildenbrand , Hugh Dickins , Kefeng Wang , Lance Yang , Matthew Wilcox , Ryan Roberts , linux-kernel@vger.kernel.org, Andrew Morton References: <1738717785.im3r5g2vxc.none.ref@localhost> <1738717785.im3r5g2vxc.none@localhost> <25e2d5e4-8214-40de-99d3-2b657181a9fd@linux.alibaba.com> In-Reply-To: <25e2d5e4-8214-40de-99d3-2b657181a9fd@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Stat-Signature: z67gw4hngbwuu83cnhktaq5ajowycz68 X-Rspam-User: X-Rspamd-Queue-Id: 54A57A0004 X-Rspamd-Server: rspam03 X-HE-Tag: 1738737525-4466 X-HE-Meta: U2FsdGVkX1+sTvbsD5DuS+1XAi4YU2AnaLrsXhhMqSt7oAJwWS3JUIC+1erU/6C/POedSL8g1vcxdmcvti4jxsFcHZtqD5u8r498FJjlPa2cosMOKaDPZ0uaxw0X9AwyV6YJivpwUY+YM6bpRliAp2ANBf/0IIFQB9FDfkTatUWbLkgF49x03hw14T1L2BjjYKyA2eufhZ3PeEfrNwOGSxkpUv9OeALgLvueyiVTOSMq04DNHp9JyI1ai0QraDlysQQad0ZBuF8Wva/IfUdZGqNjqT1ZkCJ+jH7N9Kxry4nhBDBsx7UtB/WTr/jQuAn3PlAftRpotL3l6kRs3Jnt0k3J64Ia+aQn32M9voWkSn2Aec31Iecz29XN+3ULUu5GDKGChqh2MDd0s6jDiW1JXq0GOKG25OB6cWZEoy230MBeW8vLAoj1eV1a5QTbQL1eyeZVo1lUzHGgTPIDIAzisAf1sdzABF1X+4d30WWREqVZ5t+vjLhn/STgTVnl8JXSINsCgOJZanchm7hT68BJ1l5SS/hg+dWpSxG2O4t0bS4dSllNL7IrZ1jw0NFU0l+Rb3EtxOHQF6o379DBA9J3w+bEtHNJC1VSoHqBH/cur1lCBmHG5Yl41T+4Q8saUT2/xS73BOzcsmLNbZixZU3fIoThN/xAAgssOrKb3/Dy+qkqfXV2J2JiWjKSVgy8R4lzJtMRhxxvK40zKwh9Zam2We2N0GAYP03QmGvVD7bw8cZvUMcLeLuT4chIWyQl/OJFTlGSNzLJZxDMBeCqIG5r1sx+mS+bac0djPupiC02f0D9eHE6u1+Uwye5azOLZRZHM+2vnZ6EflV/GTOvJiFfsM8tawYQ5LcOyhTgczdBGaHj7Vg8cJm7SXCtf7QkzQHJTY0YjoxKhfznZnOAZXFE+KCwuMsuiAAEzPGB+1ZAuJAi+3Obn8ZKXVhn6gKJBAcjczVfKeeYqA0455H/2w+ TKMHj9qh QouEs0/vECeR/vcm1EJCuS+tA8wmy8Xvod0Pfir35kQcOkT7gr11GTQm7cCNzHE8ywNMoCMLj/HXiyKBSuzd7dfOiSTkA77I+CYhzwzDNhr/p9hit2OJi8PZYoMwUBVOcnnj8sKXnpNTq6oL1tWU2jWi1qBqr6NbYdYUwlRv8IPJLd1ENdFct+ION6vPAnxj2+eUvAMYo2FnMiT3K3KZ/J8zDSrxOwT5eAb9Qwhge8vTqmrDuT7Sa0v7bGsPl/HQCcmRUQGYig+QRKmqyuk+/bp54NxQ05sFEp/NEqWwToyAH0kb7XVXdi+KK0nPERt1q/JAi X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, 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 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 deleting >> them reliably hangs when tmpfs is mounted with huge=within_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=2102 jiffies, g=532677, q=4997 ncpus=12) >> 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=within_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 Do you have any reproduction scripts or reproduction steps guide? Thanks.