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=-11.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 D8B8AC4346E for ; Tue, 29 Sep 2020 09:13:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3C2142076D for ; Tue, 29 Sep 2020 09:13:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3C2142076D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5FB486B0068; Tue, 29 Sep 2020 05:13:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5AB5C6B006C; Tue, 29 Sep 2020 05:13:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 471656B006E; Tue, 29 Sep 2020 05:13:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0115.hostedemail.com [216.40.44.115]) by kanga.kvack.org (Postfix) with ESMTP id 2D8B26B0068 for ; Tue, 29 Sep 2020 05:13:51 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id D69A0DB2F for ; Tue, 29 Sep 2020 09:13:50 +0000 (UTC) X-FDA: 77315536620.03.wool72_270b7da27189 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id B4FE628A4EA for ; Tue, 29 Sep 2020 09:13:50 +0000 (UTC) X-HE-Tag: wool72_270b7da27189 X-Filterd-Recvd-Size: 3594 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Tue, 29 Sep 2020 09:13:50 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 1FC37AC3C; Tue, 29 Sep 2020 09:13:49 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id C86D31E12E9; Tue, 29 Sep 2020 11:13:48 +0200 (CEST) Date: Tue, 29 Sep 2020 11:13:48 +0200 From: Jan Kara To: "Matthew Wilcox (Oracle)" Cc: linux-mm@kvack.org, Andrew Morton , Hugh Dickins , William Kucharski , Johannes Weiner , Jan Kara , Yang Shi , Dave Chinner , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 01/12] mm: Make pagecache tagged lookups return only head pages Message-ID: <20200929091348.GI10896@quack2.suse.cz> References: <20200914130042.11442-1-willy@infradead.org> <20200914130042.11442-2-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200914130042.11442-2-willy@infradead.org> User-Agent: Mutt/1.10.1 (2018-07-13) 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 Mon 14-09-20 14:00:31, Matthew Wilcox (Oracle) wrote: > Pagecache tags are used for dirty page writeback. Since dirtiness is > tracked on a per-THP basis, we only want to return the head page rather > than each subpage of a tagged page. All the filesystems which use huge > pages today are in-memory, so there are no tagged huge pages today. > > Signed-off-by: Matthew Wilcox (Oracle) Looks good to me. You can add: Reviewed-by: Jan Kara Honza > --- > mm/filemap.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/mm/filemap.c b/mm/filemap.c > index f5fda3038782..7d8cf1a25628 100644 > --- a/mm/filemap.c > +++ b/mm/filemap.c > @@ -1968,7 +1968,7 @@ unsigned find_get_pages_contig(struct address_space *mapping, pgoff_t index, > EXPORT_SYMBOL(find_get_pages_contig); > > /** > - * find_get_pages_range_tag - find and return pages in given range matching @tag > + * find_get_pages_range_tag - Find and return head pages matching @tag. > * @mapping: the address_space to search > * @index: the starting page index > * @end: The final page index (inclusive) > @@ -1976,8 +1976,8 @@ EXPORT_SYMBOL(find_get_pages_contig); > * @nr_pages: the maximum number of pages > * @pages: where the resulting pages are placed > * > - * Like find_get_pages, except we only return pages which are tagged with > - * @tag. We update @index to index the next page for the traversal. > + * Like find_get_pages(), except we only return head pages which are tagged > + * with @tag. We update @index to index the next page for the traversal. > * > * Return: the number of pages which were found. > */ > @@ -2011,9 +2011,9 @@ unsigned find_get_pages_range_tag(struct address_space *mapping, pgoff_t *index, > if (unlikely(page != xas_reload(&xas))) > goto put_page; > > - pages[ret] = find_subpage(page, xas.xa_index); > + pages[ret] = page; > if (++ret == nr_pages) { > - *index = xas.xa_index + 1; > + *index = page->index + thp_nr_pages(page); > goto out; > } > continue; > -- > 2.28.0 > -- Jan Kara SUSE Labs, CR