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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 66722C4320A for ; Sat, 24 Jul 2021 18:23:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0EA1460EAF for ; Sat, 24 Jul 2021 18:23:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0EA1460EAF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=HansenPartnership.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 8F38F6B006C; Sat, 24 Jul 2021 14:23:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8A3DB6B005D; Sat, 24 Jul 2021 14:23:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 76C316B006C; Sat, 24 Jul 2021 14:23:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0080.hostedemail.com [216.40.44.80]) by kanga.kvack.org (Postfix) with ESMTP id 5AE186B0033 for ; Sat, 24 Jul 2021 14:23:29 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 144EF181AF5FA for ; Sat, 24 Jul 2021 18:23:29 +0000 (UTC) X-FDA: 78398304138.13.5355628 Received: from bedivere.hansenpartnership.com (bedivere.hansenpartnership.com [96.44.175.130]) by imf13.hostedemail.com (Postfix) with ESMTP id 89D2F1012C4F for ; Sat, 24 Jul 2021 18:23:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 5670212804B8; Sat, 24 Jul 2021 11:23:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1627151007; bh=fbGrVZPpfO8ojqmcjNkXJzHQko3i7pa0hWwlLZqllMc=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References:From; b=YEEPxFlAmgXca92ncaVcjFkyPKS01sYb+gMbVo7x3mbWicxMdAhchlx6CBixALUKD KnYKz1LqGLUFhci2nJleUkzImqNvH9FTMRnwv5+F3nJlMHkllbfT/pgsYVdiawbqOC 3x4HLMbzZDTugEWFjRPDwZBz6RbFvgxdod9wbjW4= Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uixCSrnBnUCL; Sat, 24 Jul 2021 11:23:27 -0700 (PDT) Received: from jarvis.int.hansenpartnership.com (unknown [IPv6:2601:600:8280:66d1::527]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id B3AC212804A3; Sat, 24 Jul 2021 11:23:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1627151007; bh=fbGrVZPpfO8ojqmcjNkXJzHQko3i7pa0hWwlLZqllMc=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References:From; b=YEEPxFlAmgXca92ncaVcjFkyPKS01sYb+gMbVo7x3mbWicxMdAhchlx6CBixALUKD KnYKz1LqGLUFhci2nJleUkzImqNvH9FTMRnwv5+F3nJlMHkllbfT/pgsYVdiawbqOC 3x4HLMbzZDTugEWFjRPDwZBz6RbFvgxdod9wbjW4= Message-ID: Subject: Re: Folios give an 80% performance win From: James Bottomley To: Matthew Wilcox 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 Date: Sat, 24 Jul 2021 11:23:25 -0700 In-Reply-To: References: <20210715033704.692967-1-willy@infradead.org> <1e48f7edcb6d9a67e8b78823660939007e14bae1.camel@HansenPartnership.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 89D2F1012C4F Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=hansenpartnership.com header.s=20151216 header.b=YEEPxFlA; dkim=pass header.d=hansenpartnership.com header.s=20151216 header.b=YEEPxFlA; dmarc=pass (policy=none) header.from=HansenPartnership.com; spf=pass (imf13.hostedemail.com: domain of James.Bottomley@HansenPartnership.com designates 96.44.175.130 as permitted sender) smtp.mailfrom=James.Bottomley@HansenPartnership.com X-Stat-Signature: y9aux7ka79znq96gdwxosum9ourmsgjb X-HE-Tag: 1627151008-508257 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, 2021-07-24 at 19:14 +0100, Matthew Wilcox wrote: > 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 t > > est 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. That's testable with mariadb, at least for the innodb engine since the flush_method is settable. > 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? Well, I cut the previous question deliberately, but if you're going to force me to answer, my experience with storage tells me that one test being 10x different from all the others usually indicates a problem with the benchmark test itself rather than a baseline improvement, so I'd wait for more data. James