Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3884854iog; Tue, 28 Jun 2022 04:58:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sDqxKEWYf01ZfV1gwC7a6KR6yVf7aK95m8upbQgWqutWjS0nghSmf2oqiSgaN+0jJa+G5f X-Received: by 2002:a05:6402:4408:b0:435:9ed2:9be with SMTP id y8-20020a056402440800b004359ed209bemr22262462eda.81.1656417504117; Tue, 28 Jun 2022 04:58:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656417504; cv=none; d=google.com; s=arc-20160816; b=xxDOLpO82Y8rUWaB52slfNbdD3Fmaot0azyycnVvNF2/D0hHDqDq+U+q/01Z5FAP0n 3dyN55Ek1vF8oVfGyEp09xmRiOgq9594G+q7HFWkxZXdthaaBA6fSxkRKcDvqow/+9ET 06RnKqkzguRsvT8eszWRW80wMNkMb1Y9VBN+b9jyXmO/BonQGVg7kNK6ECl8u23dhFez neuvAbFS7GWsCouiXxNJNxXppgMtIPtx1CyQqpfSnXtH+QGL0dT3pUUcc2dpeHfcZfDt agUX2pqg0zR4JUO8dMppHJAtBfxUX5g6jUYZ9wm85oxH+uXQWC65YNHaloON/X+idU/K EXfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=LHmUJFtDqFG/TnygpQr9QZ7x+BR8FiYTOOeMbaSiyrE=; b=DsNJ7AxCSGMTOSqimCPmRgL7FPN3hUdRRN2/VzoOkz5kxLXcirrQqgV5PS5cYuiawp mr8UGG9oQ5RznXbOw698m8Wca5W0TlsuzJMt53r+k1M91VSyFvgA34yr4QhkL+0BCycB T4xG/HuctqO3+o5o7+J94Dp6kN5WBEDQ9t0TTCrXMhuyJlRcSgVOX948vTd6REwdkGBk cDKh98b2JDCgnh1ewaqHh+AQW7Ogq8vpEU4XZU+r28zVLtppidQzUi9M0oeinCUlIf/z 2tBXWZqtMU2CZMqxLC9Ves+zK0S0ImhC56Qp/AdyZM0b0pfeCIrcgfYcdGPVhtGJU/Wz aFQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=hLpD8fYq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm8-20020a170907948800b00711fd7e0800si17610262ejc.934.2022.06.28.04.57.57; Tue, 28 Jun 2022 04:58:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=hLpD8fYq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344399AbiF1LcG (ORCPT + 99 others); Tue, 28 Jun 2022 07:32:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245519AbiF1Lb6 (ORCPT ); Tue, 28 Jun 2022 07:31:58 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 680EE2E693; Tue, 28 Jun 2022 04:31:57 -0700 (PDT) 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: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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,