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 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 B11A2C4338F for ; Sat, 24 Jul 2021 18:14:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E985C60E8F for ; Sat, 24 Jul 2021 18:14:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E985C60E8F 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 839D36B0033; Sat, 24 Jul 2021 14:14:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7EA2F6B005D; Sat, 24 Jul 2021 14:14:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6D8B56B006C; Sat, 24 Jul 2021 14:14:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0076.hostedemail.com [216.40.44.76]) by kanga.kvack.org (Postfix) with ESMTP id 509946B0033 for ; Sat, 24 Jul 2021 14:14:30 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id DC56A824999B for ; Sat, 24 Jul 2021 18:14:29 +0000 (UTC) X-FDA: 78398281458.24.96439C9 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf13.hostedemail.com (Postfix) with ESMTP id 2C668100CFAD for ; Sat, 24 Jul 2021 18:14:29 +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=w8yKGTD/K4w2fC7pZFl5Bs3NRSbkCF/Y0TLmM7Sde20=; b=l3twtMHxEoCrMzv/WZ2WQYxlgE fFExxVJhEit1ghlINmX1ue8wIBc8CaCq7YziFHUe1MKap/XZje8Ujcu9UDuSkwSLPdirHlV/NYxGE i0m7iM8fyMOt6/+Hvc0qquHlEWDf0lUGtavMG2C2+piXlkftDYnEM0CcstMNz4AU1m0MrFq5YTcXP YBFh2cfXasMuHxQVznQyudJdMs19qOIIxR6E9LwWo9ZT6aPP/laK8BB+01sIUGzOFsz1qX2cxUrEu fMJIKVYr/+CD7S1eLHXVYGY+j+Iv2zEgjSMvORafDqSjhr++LlwuTg+th23/0nX3Bp7PzEEQKkXPn 3L7E02ww==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m7MAA-00CSBO-B0; Sat, 24 Jul 2021 18:14:15 +0000 Date: Sat, 24 Jul 2021 19:14:14 +0100 From: Matthew Wilcox To: James Bottomley Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Linus Torvalds , Andrew Morton , "Darrick J. Wong" , Christoph Hellwig , Andres Freund , Michael Larabel Subject: Re: Folios give an 80% performance win Message-ID: References: <20210715033704.692967-1-willy@infradead.org> <1e48f7edcb6d9a67e8b78823660939007e14bae1.camel@HansenPartnership.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1e48f7edcb6d9a67e8b78823660939007e14bae1.camel@HansenPartnership.com> X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 2C668100CFAD Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=l3twtMHx; dmarc=none; spf=none (imf13.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Stat-Signature: ub96nfhx4hi8919dyd3ms3ngwzpcfech X-HE-Tag: 1627150469-717994 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 Sat, Jul 24, 2021 at 11:09:02AM -0700, James Bottomley wrote: > On Sat, 2021-07-24 at 18:27 +0100, Matthew Wilcox wrote: > > 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. > > Since none of the other tested databases showed more than a 3% > improvement, this looks like an anomalous result specific to something > in postgres ... although the next biggest db: mariadb wasn't part of > the tests so I'm not sure that's definitive. Perhaps the next step > should be to test mariadb? Since they're fairly similar in domain > (both full SQL) if mariadb shows this type of improvement, you can > safely assume it's something in the way SQL databases handle paging and > if it doesn't, it's likely fixing a postgres inefficiency. I think the thing that's specific to PostgreSQL is that it's a heavy user of the page cache. My understanding is that most databases use direct IO and manage their own page cache, while PostgreSQL trusts the kernel to get it right. Regardless of whether postgres is "doing something wrong" or not, do you not think that an 80% performance win would exert a certain amount of pressure on distros to do the backport?