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 X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7482EC2D0A3 for ; Wed, 21 Oct 2020 23:04:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 69502221FE for ; Wed, 21 Oct 2020 23:04:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="msWwivM0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 69502221FE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6A6796B005D; Wed, 21 Oct 2020 19:04:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 655956B0062; Wed, 21 Oct 2020 19:04:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 56A986B0068; Wed, 21 Oct 2020 19:04:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0206.hostedemail.com [216.40.44.206]) by kanga.kvack.org (Postfix) with ESMTP id 27ABE6B005D for ; Wed, 21 Oct 2020 19:04:27 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id B6D09180AD802 for ; Wed, 21 Oct 2020 23:04:26 +0000 (UTC) X-FDA: 77397463332.15.cork68_130832d2724c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id 849D51814B0C1 for ; Wed, 21 Oct 2020 23:04:26 +0000 (UTC) X-HE-Tag: cork68_130832d2724c X-Filterd-Recvd-Size: 3654 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Wed, 21 Oct 2020 23:04:25 +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=TpsthbD3koAAJ+9i1h4tChG9Qdt7aV7hAviInSK0j8w=; b=msWwivM0eP4XcBH4werP4uWZ3K jfPUkLMw/LuNJevgVg0pz703Bd+YI6wtaRd7au/GBYYWIRNZqqTNHQDI8D2UJRo7I/l4TeM/pEgj8 gf5atUXz0E6iEAdi1tQmgr0fIJxybe9d+6uY+vKk02a4B636XVcIHLHcMBBDD80qI/I+CIoV4AU8k e80Ok3IdnCQA33Xhvh53ZSteZ7uBMIjDxZUAtnpzVBDkRDusQDjlIfQ6+aQCIpD6KMYpPtWmakzG7 OgqJ6BPPr6dS0/rYN32DNzgdXjM211rJVaLuPWkeT7DQ4G6xycfnjsKTevvOBfY7qB94vXsOSrMGs wPvGMEYQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kVN9a-0000Af-Bh; Wed, 21 Oct 2020 23:04:22 +0000 Date: Thu, 22 Oct 2020 00:04:22 +0100 From: Matthew Wilcox To: Dave Chinner Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org Subject: Re: Splitting a THP beyond EOF Message-ID: <20201021230422.GP20115@casper.infradead.org> References: <20201020014357.GW20115@casper.infradead.org> <20201020045928.GO7391@dread.disaster.area> <20201020112138.GZ20115@casper.infradead.org> <20201020211634.GQ7391@dread.disaster.area> <20201020225331.GE20115@casper.infradead.org> <20201021221435.GR7391@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201021221435.GR7391@dread.disaster.area> 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 Thu, Oct 22, 2020 at 09:14:35AM +1100, Dave Chinner wrote: > On Tue, Oct 20, 2020 at 11:53:31PM +0100, Matthew Wilcox wrote: > > True, we don't _have to_ split THP on holepunch/truncation/... but it's > > a better implementation to free pages which cover blocks that no longer > > have data associated with them. > > "Better" is a very subjective measure. What numbers do you have > to back that up? None. When we choose to use a THP, we're choosing to treat a chunk of a file as a single unit for the purposes of tracking dirtiness, age, membership of the workingset, etc. We're trading off reduced precision for reduced overhead; just like the CPU tracks dirtiness on a cacheline basis instead of at byte level. So at some level, we've making the assumption that this 128kB THP is all one thingand it should be tracked together. But the user has just punched a hole in it. I can think of no stronger signal to say "The piece before this hole, the piece I just got rid of and the piece after this are three separate pieces of the file". If I could split them into pieces that weren't single pages, I would. Zi Yan has a patch to do just that, and I'm very much looking forward to that being merged. But saying "Oh, this is quite small, I'll keep the rest of the THP together" is conceptually wrong. > > Splitting the page instead of throwing it away makes sense once we can > > transfer the Uptodate bits to each subpage. If we don't have that, > > it doesn't really matter which we do. > > Sounds like more required functionality... I'm not saying that my patchset is the last word and there will be no tweaking. I'm saying I think it's good enough, an improvement on the status quo, and it's better to merge it for 5.11 than to keep it out of tree for another three months while we tinker with improving it. Do you disagree?