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 D7378E7716A for ; Mon, 16 Dec 2024 02:46:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3F1196B007B; Sun, 15 Dec 2024 21:46:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 39FEF6B0082; Sun, 15 Dec 2024 21:46:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 267A36B0085; Sun, 15 Dec 2024 21:46:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 081AA6B007B for ; Sun, 15 Dec 2024 21:46:19 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 15C491C62F5 for ; Mon, 16 Dec 2024 02:46:18 +0000 (UTC) X-FDA: 82899281178.20.A307203 Received: from mail-ua1-f53.google.com (mail-ua1-f53.google.com [209.85.222.53]) by imf10.hostedemail.com (Postfix) with ESMTP id AA1A1C0004 for ; Mon, 16 Dec 2024 02:46:03 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=KCc6V3Pw; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf10.hostedemail.com: domain of yuzhao@google.com designates 209.85.222.53 as permitted sender) smtp.mailfrom=yuzhao@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734317162; a=rsa-sha256; cv=none; b=xzOsrS9bxqYvO/D8e1a2XkfG3ShtXNc8gCRmqFJXz3zEbGKAPqyTE5F8xbEfNU55QVykS3 GOk00bQ66FOHMKmUdFOMdkDo8hS5+Ea383jOb8vHg2mZi3a5AdMtWAuJvApluFMse8Ekqd Nc/jx0hwsz2Cq6GFpmeq5Cnoxtkbveo= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=KCc6V3Pw; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf10.hostedemail.com: domain of yuzhao@google.com designates 209.85.222.53 as permitted sender) smtp.mailfrom=yuzhao@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734317162; 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=fLot+HbM4BYaCqewmjaj28U0zQAIhd5TkE+/D1yxeW4=; b=ooiTeqCdXRml/XvkORWof+nO+JGKa0itSUhWoJjEq4uvOet+b6ofqVgqQhYB5myxk4x/Sg PdPCYjMRwm2F1nDECavlISOXxzjV7LO7Gh4iGCwFqkCjm8qmzqkeRt5EshpQaPmrLrV6uH PxjxaSeMmC89aEvWdYf8qElQ0rozeYw= Received: by mail-ua1-f53.google.com with SMTP id a1e0cc1a2514c-85bad7be09dso1854030241.0 for ; Sun, 15 Dec 2024 18:46:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1734317175; x=1734921975; 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=fLot+HbM4BYaCqewmjaj28U0zQAIhd5TkE+/D1yxeW4=; b=KCc6V3Pwhe2+zU12f4bMaA4oxvLpyG7kVwPX+oHRhoJe1+cCYyeD/TdNyK4Nn186jr jv36yiauK0Ox4IH5OAc4MyT6MqKg5nFnc5IDQjQVI0ZBeLbwW0sUoqwiXhb72RlEW6gU /R/grGT79fM+MhO7otxjM/XptBmNwEekDRQ6UH17td4zIQPxnSVtiiDwZhKzTY1c3OB2 DAOFd87eX6up/sSqgeSFBQ4D5FJjlvXRHo0mgv6oivyGCTCBPFAEtuXrGJsi7wT4hmUp kLsU4l2pnQw/YojYZjnli9ngdVKsdPCvhRM+WLzsbyJOQ6kyftpba5jPsxRDmbEJqnrr q3lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734317175; x=1734921975; 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=fLot+HbM4BYaCqewmjaj28U0zQAIhd5TkE+/D1yxeW4=; b=QSnD7XsMyBGJd0hoQ3amE4+hrYgpFKSdSe9aHvM1WgVFseAUuuarg2psGQ7wzvTCfz 6Ru6qyoJ2yVvtmcwuPHiiBfzxVoVz+ONlmdIIHrlVlPO26X3yVW+C8C70rmDMGSu32ug /HIlKvWrVrDBcdzZIOcpXA8hG2181QjXBzE17DMLnyZRMTUdzdrWHTvbMDMETZQyjNRb 9kR1+vocLBkrxbeRSskk3kHideMZhGFvQFrU0D+akT/HbQ35AaQqdqGVqLk7zaf9X4MM lVokEXCZfpE8qfR0FR0jjBdpOnFsc1cmjSGOpoHhxCtg/FWWh3Se8ft4579rRHGxfAjJ 95+A== X-Forwarded-Encrypted: i=1; AJvYcCWb3+39t8okb9XpvspbrEtYnHeDPeM4L+O/ILUeS1cQ2dmH/fCqbs2qevsNudzAZ7watSgO/rPQmA==@kvack.org X-Gm-Message-State: AOJu0YzYjlMG3fwT+3dHzHO7v2npQ4/okQmIyvJ6TdpHzAOANEOrUA4p 9DLUbQHN5XppVsKyFn9RLqM8p4En2RcDnsbLi/PYSHRki0h3tNp3iPhfXq75TDlALBvZtHxNc65 ItE998YOktX7ZXko9QNUNIs9Tx5dnAyKpicNC X-Gm-Gg: ASbGncubvoHUHggSG3XzC2B92YTRFos9eUwaWoEhUs2+1KJL8nBO+KCo8axyqvTP5P9 s/N1GIeHU0o50fsGabVkE+atmcTnItUvg+qNJofxWohcb+ur2nKGm17sry2A9ZA/lg4CK04o= X-Google-Smtp-Source: AGHT+IHzmN5Q/2SZLvSlTt9yiw4IXAt/Sa+yEhgGUkSl4PdZo5HjNcgcm+bmfmI4L4FXYoNCmJDrR3rG6Sn5aZjApBs= X-Received: by 2002:a05:6102:50a2:b0:4b1:1b67:6a5c with SMTP id ada2fe7eead31-4b25db3f390mr9431174137.18.1734317175094; Sun, 15 Dec 2024 18:46:15 -0800 (PST) MIME-Version: 1.0 References: <675d01e9.050a0220.37aaf.00be.GAE@google.com> In-Reply-To: From: Yu Zhao Date: Sun, 15 Dec 2024 19:45:38 -0700 Message-ID: Subject: Re: [syzbot] [mm?] WARNING in lock_list_lru_of_memcg To: Kairui Song Cc: syzkaller-bugs@googlegroups.com, syzbot , akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: AA1A1C0004 X-Stat-Signature: gggugdf3q8n6wbwjda9gotj6it6xdiia X-HE-Tag: 1734317163-935032 X-HE-Meta: U2FsdGVkX19htWS0Db4g9ZGwENskFhbWzKBMnbCGeEOdJt3YwdIoDUEp/Ev+V2JEnbyErWMXvuJ1JrjT57T9xLwWyQHjdikyrKc8uSm6Wtx9+CwqnOpYbWAoJc29T5YidgYUXe0LRYs00OVsEwTbvxondcyGXozDsWsm6UjP3CzR7/R06w25QL736XmbSsvciVBTX91Pk6So2q22jZ/LLiqaEyxezknW3pqULtPwNZpHLMdso6cUfhGa33y1V8ZqcPv6ghqjf9qAKwLrfj0yexmmJbtpD1ReFyiFM0kau9xtrh1Z/Uecs7weHlOC//6czx9/vwBuorEqun6xy0kqCo+v+rzJ9pQ2RDBM+/TWmhpQ9AW9qGIlXv4OcgWPu1HSxA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Vcq7qad7cS1k0s/ifgp36ixsChx2EZ0SpguPDIIIkbdukdXuydId0ntMg7x3UhSItfkXcXZuoqsqBv196iUHKNzOPrX0NFi4ur25VQegoOuoKmJAj12dARaPEJ7Tr6Nh/8RD52Hy6R3CVRVSQW7Be+JNVT33W0GTn8oDBV2PDxeUxsz4xavxLtqOx600aefnlBEOEg/pXttSsEg2vislXElQqBwdQylHRtWBg5Vf7XJI0pIFUltlG8AYkQgCJu/TZ8f1jiaVLXB9ENk0+3XC0HM4x3hviaSUsDFGyFa0Wf/KYTqpYuPlHN19zCu0WxeuzeayFr+wnPvMMVdRdrPRrcLcQJ+aLDlYjffXpU+XfCcU5ron05ECkiLetbVLjbrhhN+MJ4EVmZsfvutMDzZ4GFdprndH99hDAvPLuAipXUnHzL17SKQ= 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: Hi Kairui, On Sun, Dec 15, 2024 at 10:45=E2=80=AFAM Kairui Song wro= te: > > On Sun, Dec 15, 2024 at 3:43=E2=80=AFAM Kairui Song wr= ote: > > > > On Sat, Dec 14, 2024 at 2:06=E2=80=AFPM Yu Zhao wro= te: > > > > > > On Fri, Dec 13, 2024 at 8:56=E2=80=AFPM syzbot > > > wrote: > > > > > > > > Hello, > > > > > > > > syzbot found the following issue on: > > > > > > > > HEAD commit: 7cb1b4663150 Merge tag 'locking_urgent_for_v6.13_rc= 3' of g.. > > > > git tree: upstream > > > > console output: https://syzkaller.appspot.com/x/log.txt?x=3D16e96b3= 0580000 > > > > kernel config: https://syzkaller.appspot.com/x/.config?x=3Dfee25f9= 3665c89ac > > > > dashboard link: https://syzkaller.appspot.com/bug?extid=3D38a0cbd26= 7eff2d286ff > > > > compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils f= or Debian) 2.40 > > > > > > > > Unfortunately, I don't have any reproducer for this issue yet. > > > > > > > > Downloadable assets: > > > > disk image (non-bootable): https://storage.googleapis.com/syzbot-as= sets/7feb34a89c2a/non_bootable_disk-7cb1b466.raw.xz > > > > vmlinux: https://storage.googleapis.com/syzbot-assets/13e083329dab/= vmlinux-7cb1b466.xz > > > > kernel image: https://storage.googleapis.com/syzbot-assets/fe3847d0= 8513/bzImage-7cb1b466.xz > > > > > > > > IMPORTANT: if you fix the issue, please add the following tag to th= e commit: > > > > Reported-by: syzbot+38a0cbd267eff2d286ff@syzkaller.appspotmail.com > > > > > > > > ------------[ cut here ]------------ > > > > WARNING: CPU: 0 PID: 80 at mm/list_lru.c:97 lock_list_lru_of_memcg+= 0x395/0x4e0 mm/list_lru.c:97 > > > > Modules linked in: > > > > CPU: 0 UID: 0 PID: 80 Comm: kswapd0 Not tainted 6.13.0-rc2-syzkalle= r-00018-g7cb1b4663150 #0 > > > > Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-deb= ian-1.16.3-2~bpo12+1 04/01/2014 > > > > RIP: 0010:lock_list_lru_of_memcg+0x395/0x4e0 mm/list_lru.c:97 > > > > Code: e9 22 fe ff ff e8 9b cc b6 ff 4c 8b 7c 24 10 45 84 f6 0f 84 4= 0 ff ff ff e9 37 01 00 00 e8 83 cc b6 ff eb 05 e8 7c cc b6 ff 90 <0f> 0b 90= eb 97 89 e9 80 e1 07 80 c1 03 38 c1 0f 8c 7a fd ff ff 48 > > > > RSP: 0018:ffffc9000105e798 EFLAGS: 00010093 > > > > RAX: ffffffff81e891c4 RBX: 0000000000000000 RCX: ffff88801f53a440 > > > > RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 > > > > RBP: ffff888042e70054 R08: ffffffff81e89156 R09: 1ffffffff2032cae > > > > R10: dffffc0000000000 R11: fffffbfff2032caf R12: ffffffff81e88e5e > > > > R13: ffffffff9a3feb20 R14: 0000000000000000 R15: ffff888042e70000 > > > > FS: 0000000000000000(0000) GS:ffff88801fc00000(0000) knlGS:0000000= 000000000 > > > > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > > > > CR2: 0000000020161000 CR3: 0000000032d12000 CR4: 0000000000352ef0 > > > > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > > > > DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > > > > Call Trace: > > > > > > > > list_lru_add+0x59/0x270 mm/list_lru.c:164 > > > > list_lru_add_obj+0x17b/0x250 mm/list_lru.c:187 > > > > workingset_update_node+0x1af/0x230 mm/workingset.c:634 > > > > xas_update lib/xarray.c:355 [inline] > > > > update_node lib/xarray.c:758 [inline] > > > > xas_store+0xb8f/0x1890 lib/xarray.c:845 > > > > page_cache_delete mm/filemap.c:149 [inline] > > > > __filemap_remove_folio+0x4e9/0x670 mm/filemap.c:232 > > > > __remove_mapping+0x86f/0xad0 mm/vmscan.c:791 > > > > shrink_folio_list+0x30a6/0x5ca0 mm/vmscan.c:1467 > > > > evict_folios+0x3c86/0x5800 mm/vmscan.c:4593 > > > > try_to_shrink_lruvec+0x9a6/0xc70 mm/vmscan.c:4789 > > > > shrink_one+0x3b9/0x850 mm/vmscan.c:4834 > > > > shrink_many mm/vmscan.c:4897 [inline] > > > > lru_gen_shrink_node mm/vmscan.c:4975 [inline] > > > > shrink_node+0x37c5/0x3e50 mm/vmscan.c:5956 > > > > kswapd_shrink_node mm/vmscan.c:6785 [inline] > > > > balance_pgdat mm/vmscan.c:6977 [inline] > > > > kswapd+0x1ca9/0x36f0 mm/vmscan.c:7246 > > > > kthread+0x2f0/0x390 kernel/kthread.c:389 > > > > ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 > > > > ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 > > > > > > > > > > This one seems to be related to "mm/list_lru: split the lock to > > > per-cgroup scope". > > > > > > Kairui, can you please take a look? Thanks. > > > > Thanks for pinging, yes that's a new sanity check added by me. > > > > Which is supposed to mean, a list_lru is being reparented while the > > memcg it belongs to isn't dying. > > > > More concretely, list_lru is marked dead by memcg_offline_kmem -> > > memcg_reparent_list_lrus, if the function is called for one memcg, but > > now the memcg is not dying, this WARN triggers. I'm not sure how this > > is caused. One possibility is if alloc_shrinker_info() in > > mem_cgroup_css_online failed, then memcg_offline_kmem is called early? > > Doesn't seem to fit this case though.. Or maybe just sync issues with > > the memcg dying flag so the user saw the list_lru dying before seeing > > memcg dying? The object might be leaked to the parent cgroup, seems > > not too terrible though. > > > > I'm not sure how to reproduce this. I will keep looking. > > Managed to boot the image and using the kernel config provided by bot, > so far local tests didn't trigger any issue. Is there any way I can > reproduce what the bot actually did? If syzbot doesn't have a repro, it might not be productive for you to try to find one. Personally, I would analyze stacktraces and double check the code, and move on if I can't find something obviously wrong. > Or provide some patch for the bot > to test? syzbot only can try patches after it finds a repro. So in this case, no, it can't try your patches. Hope the above clarifies things for you.