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 A4EF3C4742C for ; Fri, 30 Oct 2020 01:03:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CEABC2054F for ; Fri, 30 Oct 2020 01:03:13 +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="bOx6jDmw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CEABC2054F 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 D575D6B005C; Thu, 29 Oct 2020 21:03:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D072A6B005D; Thu, 29 Oct 2020 21:03:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD6F16B0062; Thu, 29 Oct 2020 21:03:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0004.hostedemail.com [216.40.44.4]) by kanga.kvack.org (Postfix) with ESMTP id 908E36B005C for ; Thu, 29 Oct 2020 21:03:12 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 366418249980 for ; Fri, 30 Oct 2020 01:03:12 +0000 (UTC) X-FDA: 77426793024.01.frogs86_5b09cf827291 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id 133211004BE4B for ; Fri, 30 Oct 2020 01:03:12 +0000 (UTC) X-HE-Tag: frogs86_5b09cf827291 X-Filterd-Recvd-Size: 3285 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Fri, 30 Oct 2020 01:03:11 +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=3EfAuOnJDJ1asoS3XB1gO2rZ1Iw2AXrfYkZ/147UKcA=; b=bOx6jDmwzjm+7h+IY4yU/vO6HE 3JSN06lyqqujRfsTWcR75VgxRXFcgGImLDtI3mWJn53y7FmPteP4qp4nWPn1t76EfFPM1Sva9fAEH fsDks6jtR4QfvUV5yAbPTGGXUX/fzcYiqbZkTJ7BcP1iG8Sdu5yATjorI9y+eXa9TE9as5LQWht8c xBIk6OUd5juk6/eHITUdbvBniET0GYfHPTubpuvNeckchwvT7YT5IysfarbGfTV5Yuj3yzStfYODC q31XdClzEQ398oJA5YiXxMZ0J27XKqJ7rtSHslszMbZIxv65j5BYhlQicOBaAIqfV92Tzx0Nsa3Lf kTlkzMEQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kYIou-0003mL-Sz; Fri, 30 Oct 2020 01:03:09 +0000 Date: Fri, 30 Oct 2020 01:03:08 +0000 From: Matthew Wilcox To: Kent Overstreet Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 07/19] mm/filemap: Use head pages in generic_file_buffered_read Message-ID: <20201030010308.GF27442@casper.infradead.org> References: <20201029193405.29125-1-willy@infradead.org> <20201029193405.29125-8-willy@infradead.org> <20201030001909.GC2123636@moria.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201030001909.GC2123636@moria.home.lan> 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, Oct 29, 2020 at 08:19:09PM -0400, Kent Overstreet wrote: > On Thu, Oct 29, 2020 at 07:33:53PM +0000, Matthew Wilcox (Oracle) wrote: > > Add mapping_get_read_heads() which returns the head pages which > > represent a contiguous array of bytes in the file. It also stops > > when encountering a page marked as Readahead or !Uptodate (but > > does return that page) so it can be handled appropriately by > > gfbr_get_pages(). > > I don't like the _heads naming - this is like find_get_pages_contig() except it > returns compound pages instead of single pages, and the naming should reflect > that. And, working with compound pages should be the default in the future - > code working with individual pages should be considered a code smell in the > future, i.e. find_get_pages() et. all. should be considered deprecated. You're right. It should just be called mapping_get_(something)_thps. > Also - you're implementing new core functionality with a pecularity of the read > path, the two probably be split out. Perhaps find_get_cpages (compound_pages) > that can also be passed a stop condition. It isn't clear to me _how_ to do that, so in the absence of that obvious, I decided to implement what we need right now, and we can figure out how to abstract it later. So until we have a better idea, I'm going with "read" for the (something) above. > > + if (writably_mapped) { > > + int j; > > + > > + for (j = 0; j < thp_nr_pages(page); j++) > > + flush_dcache_page(page + j); > > + } > > this should be a new helper Good point. One flush_dcache_thp() coming right up!