Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3885391iog; Tue, 28 Jun 2022 04:59:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vMYtbTbuj6EpkACwybT9VceWkps3K515aUpHiZCfJTWs2xh9VQA2xNZ/9sbrY1oIVaQ/lB X-Received: by 2002:a17:907:d19:b0:726:c8a0:c9ef with SMTP id gn25-20020a1709070d1900b00726c8a0c9efmr4607790ejc.435.1656417550594; Tue, 28 Jun 2022 04:59:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656417550; cv=none; d=google.com; s=arc-20160816; b=X79sp90otEFDFrgx5u4FJPimbCZavgZxh0BJqW2SpxJk8TuScluLpYu9j9cIJaonAR WGcW2Qmwuk35c7tPrPC5te1hY6Et0NkKZVmZ4i1jA0OX0h9HLslipIR3da2H/kw81+z9 cRk12w9ft+wwDcZNIv2DNKDPSq/LjKboRnhRUKqjdC24HIInVrJR2yK2xP4VpjN0+z64 Lm8TFk7NzSu2rL+dPoaktvA2pSSX7gZUHjCrWfunuTGP8DYyZy2bNyUEf742HY3Y0y6D QKjuS779HXEWixTOD1pbLRi64NnT62l2TEqlQHAOqZOTh8h3dxNgkDErtjdA2y8iCcWz 0cmA== 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=dsxZmxpcDr/FXePgtiCyPC1Y/0j2en5t6KCqa++zGIA=; b=ao/cP7K86T0w6xBJUBHjPraUR0hOGsbyfpZ+nBfwGBIXqBec3bYwV3Q2LURjHQfNfT 5C2WxWsg11M8lPUedGe7oEV15ox7ECUzHUJY5hBS2TZY9xbKjx8819A0IDvBuALiub9/ 39NiSbCmTYqZmNQ/CwmweGiM01pJORKlrjwdlxGx9IxowwEaN6V/MOj9zMIokA9f8Rnp X8753cXyuZJqsr6VrRLCJ0J+yTHG74ww9QWebzIqJfRC9U/32S0HAvPKFRIG4DA1UNwr aeob35SrL8SeeJtY2kC2+tcZFeJBt9vAZE9icsXdPV9jbIKGKj8Mnh/EgO7TQ76J0TOR Kccw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=I19DyBBV; 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 f22-20020a0564021e9600b004356e6cf5aesi626162edf.363.2022.06.28.04.58.45; Tue, 28 Jun 2022 04:59:10 -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=I19DyBBV; 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 S1345235AbiF1L2Q (ORCPT + 99 others); Tue, 28 Jun 2022 07:28:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345349AbiF1L1p (ORCPT ); Tue, 28 Jun 2022 07:27:45 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5025A2CDF0; Tue, 28 Jun 2022 04:27:44 -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=dsxZmxpcDr/FXePgtiCyPC1Y/0j2en5t6KCqa++zGIA=; b=I19DyBBV06iqqCKYxqT2Vd4TKh /8NJXw4BWTSC5CQTyAebr2Cu9hdG5mOMT5hyXKh2jvA5HXNCisIFEpStl+AjkXD+OCEC6uLZzXJpx acBYZytxLXlKOWl/Infgh/Y68VOCotu4n1GlWXARikHEao8RDXgm+1o8L/A3TZrzGIIgMQYAbR/4J kZGB0qaU174zVoe20N8dtsf6OsllQ3mtnrFamQ9FzmWbfBOCqNnpMZ0ytylnFbUepNvbRE2fyHFv6 ecTA1s1ilSjb1Vby4lEX26z/jyRs8miMzTQOML3yt30EHm1PnZElrAPL0KfUb4kAT8jP5Vw3qIlGV nE3IqkQg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1o69Nc-00CFTb-S4; Tue, 28 Jun 2022 11:27:40 +0000 Date: Tue, 28 Jun 2022 12:27:40 +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: <20220628073120.GI227878@dread.disaster.area> 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 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: +++ b/mm/huge_memory.c @@ -2443,6 +2443,8 @@ 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)); put_page(head + i); } else if (!PageAnon(page)) { __xa_store(&head->mapping->i_pages, head[i].index,