Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp5011496rdb; Fri, 15 Sep 2023 22:17:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG+2wUOApX3JSEXaK9El/aR2sEKNwwUPgJ2x3o391ikvqpu8Msaky0dOPcJs6/dvFfEgxjg X-Received: by 2002:a05:6358:248e:b0:142:f97f:7acb with SMTP id m14-20020a056358248e00b00142f97f7acbmr4080213rwc.12.1694841421508; Fri, 15 Sep 2023 22:17:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694841421; cv=none; d=google.com; s=arc-20160816; b=R7VDYSokxoiXGIEnfO72l++2pipqPzTTwrQ93ymXyvbwZZPkZ8UU1y+n3CvLPubcj+ 7n0Mr94qF6g+Hi5NTXoAPFOEXTmGURmFJaNI/FV7rFjueGO+3FmZHCYYJkiz6EAkzShn IzFBRbzEyIkwCIeslgPDxTMzA+A+CDJNykizCJ/Rq7IXiMmPEwVwxMx6URvRAHjijxTQ 3w8FOVIk4y/StAA60aJUgTR1XUgLJAxMwf0TRS5HOc/R2H5f1ciFlDbZ0Dke5tBHOsEH 4wLg/+bhI/5EoN6XBKW2Q/OmQF/paUyP+hyePxZo80Q9/oGPpRYI5OQ8Sk0IZPcnNMn0 /0Bg== 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=ynT1nLavvHmZ9Y3KmC8cEJGBrfw6nFzCLS4ybzmu8CI=; fh=yNDO9rR/P9iQlnaCxyAHoU/xsWYQu6OYifiWU+pEdCs=; b=pj53skSJN5gB7grsBJG/g3BEDCHZakr6ar37kElcLHXAaVCQOuQ//fX6RqT/P9c7XL 1Mj+OoAeDJw3I8CpAk+2tPixFL0zAeo78QbeDRneAXUWB5N0IDjKAAwBIWLXu7s8VZml z/21j2kpYIqZaHquwipw8qljut+0fagqnkJnheUSgJJYCz9j6JzECp8okLvkbPNAx8zW K4O216Mll5DYvr45FjOjk7ql6iaWVQY/Ut7yKnDk513Yme1vPahz8Fvmuu6wW+sFBvMn XbrGyJXAArOPm9lrhE/llJzKh2yDwYWM1iiwlnjxtw2MorjkyAqBNYq71lfGwuXCs3lq RBYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=LiB16jYT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id n125-20020a632783000000b00577a5196245si4385019pgn.393.2023.09.15.22.17.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 22:17:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=LiB16jYT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 65EBB83669FA; Fri, 15 Sep 2023 08:42:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236158AbjIOPlf (ORCPT + 99 others); Fri, 15 Sep 2023 11:41:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236207AbjIOPlP (ORCPT ); Fri, 15 Sep 2023 11:41:15 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BDB1E50; Fri, 15 Sep 2023 08:41:10 -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=ynT1nLavvHmZ9Y3KmC8cEJGBrfw6nFzCLS4ybzmu8CI=; b=LiB16jYTkCJkA/Ev76u4JJuDY6 L7IDRqRgcgjkVp76JL9fktoTVPA9u0sAyvGaZX8A8K/ju+OcT8pWv28oMtxf17xXvtled4yuHA3ZZ an1KyUV184vlKwtURQSshBebJwypj5jEtJfcSc5WadN1mywYPQ8rmh9oYbZTvSbBKHF4eMj3J3oFL qaJXN+M6e/cjcl8/vg5YWF3sYkvaV32MOH3mZoq9VpW6rKio9NYd/DPu5nIOgbs8vWfk2g9dpyU1l dUVn4x+OmUsHm2XZ76jXaBiSEMMkOOnrH6wVii6yIA6YTxw4nAUDJTUAqCSQcUDl1QLr4EyBmL8TR tXm4OiZA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qhAwF-00AZVJ-Q8; Fri, 15 Sep 2023 15:40:59 +0000 Date: Fri, 15 Sep 2023 16:40:59 +0100 From: Matthew Wilcox To: David Hildenbrand Cc: Daniel Gomez , "minchan@kernel.org" , "senozhatsky@chromium.org" , "axboe@kernel.dk" , "djwong@kernel.org" , "hughd@google.com" , "akpm@linux-foundation.org" , "mcgrof@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" , "linux-xfs@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-mm@kvack.org" , "gost.dev@samsung.com" , Pankaj Raghav Subject: Re: [PATCH 0/6] shmem: high order folios support in write path Message-ID: References: <20230915095042.1320180-1-da.gomez@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 15 Sep 2023 08:42:10 -0700 (PDT) On Fri, Sep 15, 2023 at 05:36:27PM +0200, David Hildenbrand wrote: > On 15.09.23 17:34, Matthew Wilcox wrote: > > No, it can't. This patchset triggers only on write, not on read or page > > fault, and it's conservative, so it will only allocate folios which are > > entirely covered by the write. IOW this is memory we must allocate in > > order to satisfy the write; we're just allocating it in larger chunks > > when we can. > > Oh, good! I was assuming you would eventually over-allocate on the write > path. We might! But that would be a different patchset, and it would be subject to its own discussion. Something else I've been wondering about is possibly reallocating the pages on a write. This would apply to both normal files and shmem. If you read in a file one byte at a time, then overwrite a big chunk of it with a large single write, that seems like a good signal that maybe we should manage that part of the file as a single large chunk instead of individual pages. Maybe. Lots of things for people who are obsessed with performance to play with ;-)