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_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 4D51AC433DF for ; Wed, 10 Jun 2020 01:38:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 068512072E for ; Wed, 10 Jun 2020 01:38:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="b7sppN8z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 068512072E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A4CBD6B0002; Tue, 9 Jun 2020 21:38:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9FE5D6B0005; Tue, 9 Jun 2020 21:38:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 93B516B0006; Tue, 9 Jun 2020 21:38:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0095.hostedemail.com [216.40.44.95]) by kanga.kvack.org (Postfix) with ESMTP id 79F366B0002 for ; Tue, 9 Jun 2020 21:38:11 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 36FC71802392A for ; Wed, 10 Jun 2020 01:38:11 +0000 (UTC) X-FDA: 76911591582.29.mask07_4b0cbbd26dc7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id 1627C1801D00C for ; Wed, 10 Jun 2020 01:38:11 +0000 (UTC) X-HE-Tag: mask07_4b0cbbd26dc7 X-Filterd-Recvd-Size: 2731 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Wed, 10 Jun 2020 01:38:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=3F+VJ7llQg7YlsIbOqQTOSpD+AGEuzKY4qvDrz+pcDo=; b=b7sppN8zHI2+EHa+QBLCEjEWUe DE4rAM2ipTmZ97VXCv7po/GpLltoOcSIwIHrIdN3vnyRVCwizdRIU3/HUO7+V7BRcUeDfOcavlb10 cISGdTB9JsjaHwJFp/e2yO9zPYfIEXzl32tiPwV4saSZdd3Q4d80q0IZNDcpXqcdc1HD9/BD8/mkA fPc5EhmWHUNWbF5yZRIaSE81Xabswr22lDSSv78Ceij8+CoSA4BFe02qGWJkH+jn46SHzMXQlVYT6 7gAx54PsEmcE1kzp4It3phT3M/jMdhLbmhkzFXb3egQ918rhyxYOVkuHkhNljuBFniSspPDUaWCaw 1ty82RTg==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jipgu-00076G-HV; Wed, 10 Jun 2020 01:38:08 +0000 Date: Tue, 9 Jun 2020 18:38:08 -0700 From: Matthew Wilcox To: Kent Overstreet 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: <20200610013808.GF19604@bombadil.infradead.org> References: <20200610001036.3904844-1-kent.overstreet@gmail.com> <20200610001036.3904844-3-kent.overstreet@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200610001036.3904844-3-kent.overstreet@gmail.com> X-Rspamd-Queue-Id: 1627C1801D00C X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000529, 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 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.