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 B0E50C433EF for ; Tue, 28 Jun 2022 11:32:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3CF6F8E0002; Tue, 28 Jun 2022 07:32:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 358488E0001; Tue, 28 Jun 2022 07:32:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1FA018E0002; Tue, 28 Jun 2022 07:32:06 -0400 (EDT) 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 0BB308E0001 for ; Tue, 28 Jun 2022 07:32:06 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id C0A0660EC8 for ; Tue, 28 Jun 2022 11:32:05 +0000 (UTC) X-FDA: 79627430610.08.B887B85 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf25.hostedemail.com (Postfix) with ESMTP id 362A0A002D for ; Tue, 28 Jun 2022 11:32:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=LHmUJFtDqFG/TnygpQr9QZ7x+BR8FiYTOOeMbaSiyrE=; b=hLpD8fYq8VTbM191ROYc4ygG2N NX6G9oz89GXYNbnbWLDzTleQ+i4rwD5nX9uPV/xn1asyhIbiCgUC3dH3KhyM541+nBHA4WWjI/RRF XMvWCW2jDgiA49M/naqW5xtwKuHzz8yREeXGrLeU6KTuVaZUbNelfIHnFuSMZcc6J0O7Zm8aHCoG6 cP174iuaEA80kB7dogLX8QdMWj3oyNYWAxiQki5O9kt+T71+TMGDyZTcvg4iJEcWD6hUsEbyTkZVz T/HA2zoNx0CqSOr5TJzZYdHOAveb9xwiQXlFN2PpmSYGDw9eo5KgHDX+zcAzVYGd6C0so4kwxS0Xp fY7uMeVA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1o69Rj-00CFdG-9V; Tue, 28 Jun 2022 11:31:55 +0000 Date: Tue, 28 Jun 2022 12:31:55 +0100 From: Matthew Wilcox To: Dave Chinner Cc: "Darrick J. Wong" , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Christoph Hellwig , linux-mm@kvack.org Subject: Re: Multi-page folio issues in 5.19-rc4 (was [PATCH v3 25/25] xfs: Support large folios) Message-ID: References: <20211216210715.3801857-1-willy@infradead.org> <20211216210715.3801857-26-willy@infradead.org> <20220628073120.GI227878@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656415920; a=rsa-sha256; cv=none; b=K7HDaA5t4Jj5lDjKPju8af7zkJi5Quzzv4nN4L8ar37foZr3K90d4JSnZdSbKONNIsTmgU DOf2E16Cg3fodQdjxcLrsHjfKbeG3kL6XWLMBVvNW/ay293BD9uJoeKY7HALHNJkOSsKYn 53ayTjbj3piCQciXcvQ8mEXzUjxSODI= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=hLpD8fYq; dmarc=none; spf=none (imf25.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656415920; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=LHmUJFtDqFG/TnygpQr9QZ7x+BR8FiYTOOeMbaSiyrE=; b=UDohFb6iP4YiuSSiEOZrgnRhOjBtdHvDPtXgSpim8IUNfCqywBLrJvYcowepVZ6sZ4rDeA ySqIRUrxemvB0GRRM0zx4Gbzc1dDVkVggB8v7V41hTywOgZIQRk6/NGEHZ6iZouqmbSn5z P0jN9H7XJqgi2U7o0craKWHiJV7BoHo= X-Stat-Signature: hftj4sqrby1uc6koythdzayadeoenh4t X-Rspam-User: X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 362A0A002D Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=hLpD8fYq; dmarc=none; spf=none (imf25.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-HE-Tag: 1656415920-391121 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: On Tue, Jun 28, 2022 at 12:27:40PM +0100, Matthew Wilcox wrote: > On Tue, Jun 28, 2022 at 05:31:20PM +1000, Dave Chinner wrote: > > So using this technique, I've discovered that there's a dirty page > > accounting leak that eventually results in fsx hanging in > > balance_dirty_pages(). > > Alas, I think this is only an accounting error, and not related to > the problem(s) that Darrick & Zorro are seeing. I think what you're > seeing is dirty pages being dropped at truncation without the > appropriate accounting. ie this should be the fix: Argh, try one that actually compiles. diff --git a/mm/huge_memory.c b/mm/huge_memory.c index f7248002dad9..0553ae90509f 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -2443,6 +2444,9 @@ static void __split_huge_page(struct page *page, struct list_head *list, __delete_from_page_cache(head + i, NULL); if (shmem_mapping(head->mapping)) shmem_uncharge(head->mapping->host, 1); + else + folio_account_cleaned(page_folio(head + i), + inode_to_wb(folio->mapping->host)); put_page(head + i); } else if (!PageAnon(page)) { __xa_store(&head->mapping->i_pages, head[i].index,