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_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 B5254C4741F for ; Fri, 30 Oct 2020 00:19:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 09A892076B for ; Fri, 30 Oct 2020 00:19:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="atJ2k5VG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 09A892076B 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 144756B005C; Thu, 29 Oct 2020 20:19:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F43D6B005D; Thu, 29 Oct 2020 20:19:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F01976B0062; Thu, 29 Oct 2020 20:19:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0136.hostedemail.com [216.40.44.136]) by kanga.kvack.org (Postfix) with ESMTP id C3C8A6B005C for ; Thu, 29 Oct 2020 20:19:12 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 649A21EE6 for ; Fri, 30 Oct 2020 00:19:12 +0000 (UTC) X-FDA: 77426682144.05.power77_4602b5427291 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id 481EE18027676 for ; Fri, 30 Oct 2020 00:19:12 +0000 (UTC) X-HE-Tag: power77_4602b5427291 X-Filterd-Recvd-Size: 4507 Received: from mail-il1-f196.google.com (mail-il1-f196.google.com [209.85.166.196]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Fri, 30 Oct 2020 00:19:11 +0000 (UTC) Received: by mail-il1-f196.google.com with SMTP id c11so4972524iln.9 for ; Thu, 29 Oct 2020 17:19:11 -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=hbsH7zepBu84v24A4Cjn3HzupBJL/zDgRWeJ1T6CeAQ=; b=atJ2k5VGx1QuuXvSZAn5gHyA0XD0tRSCYv+qurKT98JH01NI20QBggQorhLIsyIOKz uu2IeNZvN0NXh40l4jcrzC1dKNhVxSYcB0ACJVI5PzYEtRMJ2DmYuC0ta8nxRhyTbhmy XvpFgPYTRaef6XtRR8JJSfqgZlSQOAeIU/tMRCHJq8ivGIFPjG3uLvRFo8ey49BlAEgc 0Ef47Fa1BOlie/LydvgWBkDxJ7MkZrqsKlrc5wd5ZiK3e4qgPE5D3jQnTNnQhVSJdSM3 O/t84TsH4G37QdCQ+5bnYDxyW+rlnhcA6yyz5tvExCpkkj1adDZ4UsLC1PQS+MxJvLDi bIfg== 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=hbsH7zepBu84v24A4Cjn3HzupBJL/zDgRWeJ1T6CeAQ=; b=KIaJbs5A7i/V00ctvpxUmo89g4cy0xyO25UU9ofx3DjtF5G3QpPfMGSJv5VZyrVjLt ZL1OxqNw2JwnhOKAAyHitjXiYbn2A95r6UhM0cr8AvC7AFv8FqTc88XKTEIYDWIPqW+x JHCHCpVTs+pzLBY3Ha2URpggv9dDalmZirbBWAU1yoK7krk2vlxm29/l9AYW63UTc1mJ Ztna06aYW9wbqUCll9cevONDO9Ru6R25QwPNfL3NyzU1i+cgzulsEyV0aK5AOr130eix UAAz97yOXMt2VHW4bmi6a21KOeeI7H2GnShYo0rrQ8RKhE6mPyzBp7XPScvu8qYi/NzR u4+Q== X-Gm-Message-State: AOAM530vPeuY1VkHwU07KhTf19Mo7otCm4FfGKGKDP0/6fb5Fcp+I+8N r7xpg8h6onutOjhmgl8nWg== X-Google-Smtp-Source: ABdhPJykWguXOLwgza4IKeW34eeZJ1BHEjlKdTLCjnE2wzLEFtL0Srr1sKRejtCbJ0zMisPyxKWCfA== X-Received: by 2002:a92:d302:: with SMTP id x2mr15169ila.66.1604017151365; Thu, 29 Oct 2020 17:19:11 -0700 (PDT) Received: from moria.home.lan (c-73-219-103-14.hsd1.vt.comcast.net. [73.219.103.14]) by smtp.gmail.com with ESMTPSA id v26sm3301560iot.35.2020.10.29.17.19.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 17:19:10 -0700 (PDT) Date: Thu, 29 Oct 2020 20:19:09 -0400 From: Kent Overstreet To: "Matthew Wilcox (Oracle)" 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: <20201030001909.GC2123636@moria.home.lan> References: <20201029193405.29125-1-willy@infradead.org> <20201029193405.29125-8-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201029193405.29125-8-willy@infradead.org> X-Bogosity: Ham, tests=bogofilter, spamicity=0.022969, 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 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. We have the same issue in the block layer with multi page bvecs where the naming really should be better; the more complicated name should be for the unusual case, which is not what we have now. 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. Not all of this is necessarily for this patch, but perhaps a comment indicating where we want to go in the future would be helpful. > - if (writably_mapped) > - flush_dcache_page(pages[i]); > + 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