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 5C1C3C43334 for ; Tue, 28 Jun 2022 11:27:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DDFF78E0002; Tue, 28 Jun 2022 07:27:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D90248E0001; Tue, 28 Jun 2022 07:27:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C7E268E0002; Tue, 28 Jun 2022 07:27:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id BA3528E0001 for ; Tue, 28 Jun 2022 07:27:53 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 7D147D4A for ; Tue, 28 Jun 2022 11:27:53 +0000 (UTC) X-FDA: 79627420026.16.2718F48 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf15.hostedemail.com (Postfix) with ESMTP id 2039EA0027 for ; Tue, 28 Jun 2022 11:27:48 +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=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> ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=I19DyBBV; dmarc=none; spf=none (imf15.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=1656415669; 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=dsxZmxpcDr/FXePgtiCyPC1Y/0j2en5t6KCqa++zGIA=; b=gKisqXp/daUGoMdAdHlgb7UhQcTEcAPFTTEqN09/4lbA6WWzrv/Oa+OWMlYI8IrO3QbaFF vooehCV28wtes9p6qSyn20mja1sYuyd9tvqTCeL+q0C2RrO0rzMt4L10Bd4lsZZUjLBlAl ZfWy55sot0MzCg9zoMqwWX+lXPzCENM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656415669; a=rsa-sha256; cv=none; b=L41Dy6jFceYSqix7mO/cMfVOWRl7cAVq6be9ljF9rw1MIHggAlGkEyB2SuYWnPz8ZJDsUg rEm/yYpqrT88B2ifOJphBZj5PSvGccn+p+CnfSVIe58HkN3GAIUeNrVvCThU6Z33JkKv+I DzUDjEXbqSDMMbLo+0nH9SBFMFy1AP0= X-Stat-Signature: stx8ft3aury7u3did3788kz8xwypptdz X-Rspamd-Queue-Id: 2039EA0027 X-Rspam-User: Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=I19DyBBV; dmarc=none; spf=none (imf15.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspamd-Server: rspam12 X-HE-Tag: 1656415668-213625 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 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,