Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp838851lqb; Wed, 29 May 2024 12:01:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXABUNjpSD7droDoHP1dDU6pYUWfWEoE4RYwylxCVlD7TsRbFCM2vAL09EobqyiPpt1fTRk7Vrh0A9bUCmg72anQkVl1tyit0kh+DRoFA== X-Google-Smtp-Source: AGHT+IE3WGjjqD/j4JvZp7YgcP2fAZ+g4zwPSLa5R6bLAMafq7MfEZY0bErHTpPdyLRR4iFSsueg X-Received: by 2002:a05:6a20:1051:b0:1ad:9394:2d30 with SMTP id adf61e73a8af0-1b212d3dd65mr15579028637.37.1717009279369; Wed, 29 May 2024 12:01:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717009279; cv=pass; d=google.com; s=arc-20160816; b=uYWxeZ+EETlD3PLuBfj4csiNPxVhDaG+XTBL7BgFBNk3W77C1RKgPW2aBAaF1RuX8L /Wj6bYHch1iERAiPX//lvFqdAY/AhDPU4cbC7tTjC6fvVb6V+R0anXMXzX2rSPTRz149 /m5MAVdCyEaPrqb2e2kS2V5bmu1135TAM8FmrjDYHqtzsmuPvkqCpXNInzhzzCCrF6dz wRCKvC0qM79g8RlF8xIgjY8GGSP/Q7ehM7nec9JS7Kb3kTbHT3ysDYdvYM6gFOgDCl6b h/0rUyE7VrHr5RacVEDfsjHoKaR+sB0FavK3lHHYZ7n3xcWS3Z8Hr1wTqBTPflhZkfEt LvVg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :reply-to:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature:dkim-signature:dkim-signature; bh=iVHStC3cHDYoUi4IFL9yxFoo6Ze7RvNnT7yV6Vs3l1k=; fh=LFa+zFHA42Xd20/aBvwTf0c3RTYyYzE6e0rYG/jqd2w=; b=mVaVWz7kCyNufB7Wavqtau45agGmp4VCCWKpI2W54lvWH/DwB1Xy0NpqsR/BnkOkab Mgc/5HLGXcE/ZNqMjVSZY+ILFASRPMiMYABSXRpS4MbFuyXw8D2+MHGMJ/WexVNVkKLv 9zeGWyq29i20piVBS77ZxkMboff4hfolBGogUus+UP/3+ABhv7Q47R5F/vAZIL5TGwPu R/GptDP62z8pkv5ya3aeT+9BvzlgACTbyShIWpoU8iXCBtTGe0zHAQ2P5GKwoBaKFfVH HPi9v9uvLj5qP3ZWNE8EuKWnu1Qn78GfHo0D6HswX1B1nJf+NAu6PmtTvyMP4AcIjpO9 Wcvg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=p7pfhp7K; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=KJzs4WlY; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-194598-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194598-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-70224387ac5si940174b3a.277.2024.05.29.12.01.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 12:01:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194598-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=p7pfhp7K; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=KJzs4WlY; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-194598-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194598-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 99D3C287343 for ; Wed, 29 May 2024 19:01:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F110E187332; Wed, 29 May 2024 19:01:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="p7pfhp7K"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="Eg3uY0Bk"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="KJzs4WlY"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="k7rsWAh5" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 211B31B949; Wed, 29 May 2024 19:01:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717009270; cv=none; b=FMdQQ5fiXjt7gmzNfFRNMQzTIcUXFNwW5oYxF5qMS8DZHWoFBSSknfwhjFmwOmZniff4Mzqn4DUMal+L7MAB0HPpvxTOdtx24xDMbxtazJOOxOt2kgCWgIT3PK0uJ19Vmyy2/8TvxEEQnT5CSoYSGgHf04qTF8+3wrFg330gMuw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717009270; c=relaxed/simple; bh=+jnnZTUq6/BwkwWF5eJnUty9lyNMM5PD17zS14+zCfs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sApgm3SbNikhcVQzwDmJk+kr1yd/DuWa7fBfsgnQK0U1KY6frnbnDxs1JaDuelZtbThL1FNUwN8BaCjR7wr2Xfri2sk+kafDdFw/b7btQi7tgYqjhIi2CaBmNOyCVBVcHJhe6EyS7t76+jeNiI+b7UMfAbgcb41HFhO+aDWFbms= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=p7pfhp7K; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=Eg3uY0Bk; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=KJzs4WlY; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=k7rsWAh5; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id E2187205F7; Wed, 29 May 2024 19:01:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1717009265; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iVHStC3cHDYoUi4IFL9yxFoo6Ze7RvNnT7yV6Vs3l1k=; b=p7pfhp7KON88hEEUVxjiwW0/T4tVa6HXAVcZK+5aapYPR9A7J5cMUo2GLdAxx5QaXxIKO3 HFp8JcQY3bfEBLlYFIo/TjbBBP0nyjSsrvCJd2BBL+VWRg0cmloyUr+dCOl0Um34sy6SRQ LBm6sQWGKEtEmwdNRUTLGTgoIQitMwQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1717009265; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iVHStC3cHDYoUi4IFL9yxFoo6Ze7RvNnT7yV6Vs3l1k=; b=Eg3uY0Bkveqcm7j9TLET/Ba0FSmBScwEvz2tW/D6I1tk/Bx4KvOPeI3SpQ5QrBtaOEZgIo JVWLsuw2uF/2JhAw== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=KJzs4WlY; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=k7rsWAh5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1717009264; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iVHStC3cHDYoUi4IFL9yxFoo6Ze7RvNnT7yV6Vs3l1k=; b=KJzs4WlY22W7gZ61jZo/UAJz9efmNyoKI9cKQQ9CajuivVV3DDv1+JtdKjRJvlb4SCde3c 3XHBAt/9OePpqsHyIi/a2Irtb0gzmiVtgsHHa6oBeZIUZbzHy3rfyVvZbDAHrABNY/cGOs UBmsRhhS8Mq4TCTV452N54x0MyZpWfc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1717009264; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iVHStC3cHDYoUi4IFL9yxFoo6Ze7RvNnT7yV6Vs3l1k=; b=k7rsWAh5im9Nq6lEscR9Fj003HuhJbCX74kPWK+PDG0UBlw+OrMdWiEYM5x8409AZllUIw k8veQoeQFIJZuGCw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id C6AC013A6B; Wed, 29 May 2024 19:01:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id CSZXMHB7V2ZeMgAAD6G6ig (envelope-from ); Wed, 29 May 2024 19:01:04 +0000 Date: Wed, 29 May 2024 21:00:59 +0200 From: David Sterba To: David Hildenbrand Cc: Mikhail Gavrilov , Chris Mason , Josef Bacik , David Sterba , Linux List Kernel Mailing , Linux Memory Management List , Matthew Wilcox , linux-btrfs Subject: Re: 6.9/BUG: Bad page state in process kswapd0 pfn:d6e840 Message-ID: <20240529190059.GM8631@suse.cz> Reply-To: dsterba@suse.cz References: <0672f0b7-36f5-4322-80e6-2da0f24c101b@redhat.com> <6b42ad9a-1f15-439a-8a42-34052fec017e@redhat.com> <162cb2a8-1b53-4e86-8d49-f4e09b3255a4@redhat.com> <209ff705-fe6e-4d6d-9d08-201afba7d74b@redhat.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=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) X-Spam-Flag: NO X-Spam-Score: -2.71 X-Rspamd-Action: no action X-Rspamd-Queue-Id: E2187205F7 X-Spam-Level: X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-2.71 / 50.00]; BAYES_HAM(-3.00)[100.00%]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; HAS_REPLYTO(0.30)[dsterba@suse.cz]; R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FUZZY_BLOCKED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.cz:+]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,fb.com,toxicpanda.com,suse.com,vger.kernel.org,kvack.org,infradead.org]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCPT_COUNT_SEVEN(0.00)[9]; RCVD_VIA_SMTP_AUTH(0.00)[]; TAGGED_RCPT(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.cz:dkim,suse.cz:replyto] On Wed, May 29, 2024 at 08:57:48AM +0200, David Hildenbrand wrote: > On 28.05.24 16:24, David Hildenbrand wrote: > > Hmm, your original report mentions kswapd, so I'm getting the feeling someone > > does one folio_put() too much and we are freeing a pageache folio that is still > > in the pageache and, therefore, has folio->mapping set ... bisecting would > > really help. > > A little bird just told me that I missed an important piece in the dmesg > output: "aops:btree_aops ino:1" from dump_mapping(): > > This is btrfs, i_ino is 1, and we don't have a dentry. Is that > BTRFS_BTREE_INODE_OBJECTID? Yes, that's right, inode with number 1 is representing metadata. > Summarizing what we know so far: > (1) Freeing an order-0 btrfs folio where folio->mapping > is still set > (2) Triggered by kswapd and kcompactd; not triggered by other means of > page freeing so far > > Possible theories: > (A) folio->mapping not cleared when freeing the folio. But shouldn't > this also happen on other freeing paths? Or are we simply lucky to > never trigger that for that folio? > (B) Messed-up refcounting: freeing a folio that is still in use (and > therefore has folio-> mapping still set) > > I was briefly wondering if large folio splitting could be involved. We do not have large folios enabled for btrfs, the conversion from pages to folios is still ongoing. With increased number of strange reports either from syzbot or others, it seems that something got wrong in the 6.10-rc update or maybe earlier.