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.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 6423AC432BE for ; Sat, 24 Jul 2021 17:28:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7988D60E91 for ; Sat, 24 Jul 2021 17:28:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7988D60E91 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id A43606B0033; Sat, 24 Jul 2021 13:28:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9F3136B005D; Sat, 24 Jul 2021 13:28:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8E1436B006C; Sat, 24 Jul 2021 13:28:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0148.hostedemail.com [216.40.44.148]) by kanga.kvack.org (Postfix) with ESMTP id 71CCE6B0033 for ; Sat, 24 Jul 2021 13:28:11 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 0BF628249980 for ; Sat, 24 Jul 2021 17:28:11 +0000 (UTC) X-FDA: 78398164782.28.702DFFB Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf03.hostedemail.com (Postfix) with ESMTP id 16BDD300CD1A for ; Sat, 24 Jul 2021 17:28:09 +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=R/q2OUFHGHnNOj2YWSRkzWiiQH0hVUMtLRqj4jzPJgI=; b=gky8adROBWilg+idqPXV+hW/r0 G/T/24vDtwXzirAYXoSMJL0OFgxbeHHb9dBijq4Hdx5aE6ruopVRBxiNXg2Ru35hosdK1HjAHxn/L joFlAgkSTuo3tM9QI2DL+fMGt/rqtTCt10rMHmMv2Ze0SqKAqsm66VYhMw0/sCZmm7L6yObMp6Qfr /GrFP39f5wcfT8XHXRgyZRasl1YekSlNMRiLjuKPKh23854ciMhfGFy+3C8SeaFYhPyWbChjaQMNY SfiprTA4hFxIL3DoJyBPydDPdFdnOpj5u5AXMLIbMVm50LnUiwZe204L/IG6oW/40+uEkeuSnX2gr rtbRNriA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m7LRB-00CQK6-H6; Sat, 24 Jul 2021 17:28:00 +0000 Date: Sat, 24 Jul 2021 18:27:45 +0100 From: Matthew Wilcox To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Linus Torvalds , Andrew Morton , "Darrick J. Wong" , Christoph Hellwig , Andres Freund , Michael Larabel Subject: Folios give an 80% performance win Message-ID: References: <20210715033704.692967-1-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210715033704.692967-1-willy@infradead.org> Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=gky8adRO; spf=none (imf03.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspamd-Server: rspam02 X-Stat-Signature: byyef4b5ghmg8o3mq5u8x6oaysop4qux X-Rspamd-Queue-Id: 16BDD300CD1A X-HE-Tag: 1627147689-216539 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, Jul 15, 2021 at 04:34:46AM +0100, Matthew Wilcox (Oracle) wrote: > Managing memory in 4KiB pages is a serious overhead. Many benchmarks > benefit from a larger "page size". As an example, an earlier iteration > of this idea which used compound pages (and wasn't particularly tuned) > got a 7% performance boost when compiling the kernel. I want to thank Michael Larabel for his benchmarking effort: https://www.phoronix.com/scan.php?page=news_item&px=Folios-v14-Testing-AMD-Linux I'm not too surprised by the lack of performance change on the majority of benchmarks. This patch series is only going to change things for heavy users of the page cache (ie it'll do nothing for anon memory users), and it's only really a benefit for programs that have good locality. What blows me away is the 80% performance improvement for PostgreSQL. I know they use the page cache extensively, so it's plausibly real. I'm a bit surprised that it has such good locality, and the size of the win far exceeds my expectations. We should probably dive into it and figure out exactly what's going on. Should we accelerate inclusion of this patchset? Right now, I have 89 mm patches queued up for the 5.15 merge window. My plan was to get the 17 iomap + block patches, plus another 18 page cache patches into 5.16 and then get the 14 multi-page folio patches into 5.17. But I'm mindful of the longterm release coming up "soon", and I'm not sure we're best served by multiple distros trying to backport the multi-page folio patches to either 5.15 or 5.16.