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=-0.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 84F01C433DF for ; Wed, 10 Jun 2020 01:46:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3769D20734 for ; Wed, 10 Jun 2020 01:46:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="oWrZ6e9T" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3769D20734 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C6CFD6B0002; Tue, 9 Jun 2020 21:46:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C1D866B0005; Tue, 9 Jun 2020 21:46:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B0CCF6B0006; Tue, 9 Jun 2020 21:46:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0072.hostedemail.com [216.40.44.72]) by kanga.kvack.org (Postfix) with ESMTP id 9529F6B0002 for ; Tue, 9 Jun 2020 21:46:33 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 56B22801C633 for ; Wed, 10 Jun 2020 01:46:33 +0000 (UTC) X-FDA: 76911612666.12.grade79_190c6f426dc7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id 21EDA1800973C for ; Wed, 10 Jun 2020 01:46:33 +0000 (UTC) X-HE-Tag: grade79_190c6f426dc7 X-Filterd-Recvd-Size: 4600 Received: from mail-qv1-f65.google.com (mail-qv1-f65.google.com [209.85.219.65]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Wed, 10 Jun 2020 01:46:32 +0000 (UTC) Received: by mail-qv1-f65.google.com with SMTP id y9so350709qvs.4 for ; Tue, 09 Jun 2020 18:46:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=zjEvUKOGeP0/F79VG1tPkbwEfkdJVyvg8ywjx9GcPQU=; b=oWrZ6e9TU/rbxhNWPbfMhXLTZg4xruWGGcVXQ9mktslLgYxx48qz2u8cxBC7tYpZEI LjwR5+JS+p7Ozd4E7Z8TmuyFDeUKg8BmeYxwQ5Xujc3rQdN/bVAoOQMS8yneUlItWdbq RTOmEb+XnvIzVsivjlo9ToRTaJXrUR1s0C70dq0ZD/PxyJR60nsZERnoH5fAsiFRdY/J tDPAvye0ZiFEvAUtVPWey5Uxadlp6FE2/Gahxn7PVIeHFPMzL2SwgEPf+D6LvrhVget/ QrcVlKQ948U1HHCDQrCBksA5G6F1NMZ+jghXW4+52PCudnWeiEizDuM+7HAsi+IICcil blTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=zjEvUKOGeP0/F79VG1tPkbwEfkdJVyvg8ywjx9GcPQU=; b=KBkNOgsUaQyQDl21FUorCz1oGvQ7/LQU3GufZK7co3svjdGpUpt+HhfPc5SxfGpX+j 1uDYv9Feerxd02Df8kYeeoA6ZJg87NgnpyjF4ud3SBAbhj7RNoJc/M3oxvxmWeEPnLRW gN0XnBVugUBABGwMPv2jEJ4xtfot5QcqJL3vmuQxzgDM6UGmYeXjM3OlVp5ywQRmXiT+ WqYWIOsCCZUzio3/167slo7tbNEtjzpI9pmLUkORBTzTS6l2KmBaojZJ9rWpjjnKHXUc +m1WvxqJiCdkEXKMYb70It1bY01luDMFhFvQ52NnjPLJwVSwlJKc2kVEeEG2E+N4FGoz xtRQ== X-Gm-Message-State: AOAM5334a0BJACx7VmYBt3z0hf1yJH7Xb1luD0aG7WdG3qLjzkMRV7HF VxBOjFtoxV+wOKKC+uo4UA== X-Google-Smtp-Source: ABdhPJxQK5SqvejKrGmt9+oKevPj0d2I8q7utJ10aM3gzSAilCgpJsFS1MwbI2P61HEUKMFoX6J21g== X-Received: by 2002:ad4:42a6:: with SMTP id e6mr1002783qvr.170.1591753591894; Tue, 09 Jun 2020 18:46:31 -0700 (PDT) Received: from moria.home.lan ([2601:19b:c500:a1:7285:c2ff:fed5:c918]) by smtp.gmail.com with ESMTPSA id g28sm11233434qts.88.2020.06.09.18.46.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2020 18:46:31 -0700 (PDT) Date: Tue, 9 Jun 2020 21:46:29 -0400 From: Kent Overstreet To: Matthew Wilcox Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, viro@zeniv.linux.org.uk, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 2/2] fs: generic_file_buffered_read() now uses find_get_pages_contig Message-ID: <20200610014629.GB4070152@moria.home.lan> References: <20200610001036.3904844-1-kent.overstreet@gmail.com> <20200610001036.3904844-3-kent.overstreet@gmail.com> <20200610013808.GF19604@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200610013808.GF19604@bombadil.infradead.org> X-Rspamd-Queue-Id: 21EDA1800973C X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000103, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Jun 09, 2020 at 06:38:08PM -0700, Matthew Wilcox wrote: > On Tue, Jun 09, 2020 at 08:10:36PM -0400, Kent Overstreet wrote: > > Convert generic_file_buffered_read() to get pages to read from in > > batches, and then copy data to userspace from many pages at once - in > > particular, we now don't touch any cachelines that might be contended > > while we're in the loop to copy data to userspace. > > > > This is is a performance improvement on workloads that do buffered reads > > with large blocksizes, and a very large performance improvement if that > > file is also being accessed concurrently by different threads. > > Hey, you're stealing my performance improvements! :) > Granted, I haven't got to doing performance optimisations (certainly > not in this function), but this is one of the places where THP in the > page cache will have a useful performance improvement. > > I'm not opposed to putting this in, but I may back it out as part of > the THP work because the THPs will get the same performance improvements > that you're seeing here with less code. I'm an _enthusiastic_ supporter of the THP stuff (as you know), but my feeling is that it's going to be a long time before hugepages are everywhere - and I think even with the pagevec stuff generic_file_buffered_read() is somewhat easier to read and deal with after this series than before it. Though I could see the pagevec stuff making hugepage support a pain, so there is that. Eh.