Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1026509pxf; Thu, 18 Mar 2021 18:28:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/7Fow3YGywuw+JlhYgQ6CNzQx43BAS59/qOSW3Acs+HmcS30UQVT9f84ZsHdXkXnF/tmx X-Received: by 2002:a17:906:52d0:: with SMTP id w16mr1619338ejn.172.1616117283751; Thu, 18 Mar 2021 18:28:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616117283; cv=none; d=google.com; s=arc-20160816; b=Nuof3inYIXKRG0J5QtwpDhpV/4/B1MxePBnOTc2l6g7ljvzqaQQF4QBFq1GSVL/Os3 h0HwjPXfRQt9TchrGtSgLUIu+yehniYk6zsk9wqaV+2wgGqtZVNjZwFBMQ2YRcA0kLuZ ep43UL8Ktp11fHe6IDZIzZKxwui5AtyuH29kNlxilSnotayNI+QCdghfQ4Qrn8w5f/1v IeLcavXGPRouD312zLONixvXX6seHNWQOtBIzRQTBgZzrUcfltegS4DrIghKIMzyDJQM CFf5OQMbIOQkkT32Z0dX42R0lEQUo945J7jqm2XIr9Gq+m6Lk+SbbbfGyWO6Dvh1KRLX z14A== 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=epBGpvSKb5BDsLBUPy9iK8A8YY2xiMLqJ0JDHh+J84k=; b=OcYAFOSBszwCPywE0KGAL+qGD6eid1EDOqpa7xk8dX2paMfCXc+Zk2Ot9AWGzuEq/P Z+4qyd+4gBJHrne9znf+I2Q+367g8Ohoun7PCyXFQ22xrzjud8Qm1WKXJKWNjly0AE7q GAy4w+SMuOEy6knFgAqoXQ78IabrQajv1vHCP0I8ejqSJkMDZlWYfxYJlupPnkS/5DlW ZpYB9HyeHeDy6went8rHp0Ir0NpIpDcRc7Kzjv28D1yr8DnQHaTxTKOrEVcM4KqrU+uh lV/emaCtgG7cB6P5uGtjvsoOYx3wffFd20I99wwjN+A4ODegyUX5c0a+Fy4+Ilxbjg4P D4cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="XW4/4Znj"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g16si3010619ejf.292.2021.03.18.18.27.41; Thu, 18 Mar 2021 18:28:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="XW4/4Znj"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231222AbhCSB0S (ORCPT + 99 others); Thu, 18 Mar 2021 21:26:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230507AbhCSBZ7 (ORCPT ); Thu, 18 Mar 2021 21:25:59 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23ED5C06174A; Thu, 18 Mar 2021 18:25:59 -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=epBGpvSKb5BDsLBUPy9iK8A8YY2xiMLqJ0JDHh+J84k=; b=XW4/4ZnjAQWR2NFfKClgD4ZoY2 PJuV2K+Y/67OJuM7CtWJFtFESWrV+JySdZFUEhNiM9v3CB7NbORoUpKrqC0U+vn56u+Kkwbt9nkwh aizAHFmrE6htQAFPOc6PR7x1V7yjZ0yTkiZwxSfihm42sLR1saFEXmCGIYyUimzLx39yz8BPsQfmC VUNpuRAguPJDAeISfRleO2cZ1mJmd3Wa999ryMFw40fMOFlPnIeo+TmhCh6NiNw+3u/sNghoUfDDM FeaVq4f+rABkPUkse9K1LezlIo9yz9YMn7dXgruKU6kv20P4Vamt9MmVcSFhHl2hEg6GeTQD4vGgo aTyR5bQw==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lN3tH-003k0x-JB; Fri, 19 Mar 2021 01:25:30 +0000 Date: Fri, 19 Mar 2021 01:25:27 +0000 From: Matthew Wilcox To: Balbir Singh Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v4 01/25] mm: Introduce struct folio Message-ID: <20210319012527.GX3420@casper.infradead.org> References: <20210305041901.2396498-1-willy@infradead.org> <20210305041901.2396498-2-willy@infradead.org> <20210318235645.GB3346@balbir-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210318235645.GB3346@balbir-desktop> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 19, 2021 at 10:56:45AM +1100, Balbir Singh wrote: > On Fri, Mar 05, 2021 at 04:18:37AM +0000, Matthew Wilcox (Oracle) wrote: > > A struct folio refers to an entire (possibly compound) page. A function > > which takes a struct folio argument declares that it will operate on the > > entire compound page, not just PAGE_SIZE bytes. In return, the caller > > guarantees that the pointer it is passing does not point to a tail page. > > > > Is this a part of a larger use case or general cleanup/refactor where > the split between page and folio simplify programming? The goal here is to manage memory in larger chunks. Pages are now too small for just about every workload. Even compiling the kernel sees a 7% performance improvement just by doing readahead using relatively small THPs (16k-256k). You can see that work here: https://git.infradead.org/users/willy/pagecache.git/shortlog/refs/heads/master I think Kirill, Hugh and others have done a fantastic job stretching the page struct to work in shmem, but we really need a different type to avoid people writing code that _looks_ right but is actually buggy. So I'm starting again, this time with the folio metaphor.