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=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 7060EC4363A for ; Wed, 28 Oct 2020 07:51:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8B71D24181 for ; Wed, 28 Oct 2020 07:51:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="hmj1uJtQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B71D24181 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A21836B006C; Wed, 28 Oct 2020 03:51:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9D2A86B006E; Wed, 28 Oct 2020 03:51:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 90F3B6B0070; Wed, 28 Oct 2020 03:51:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0068.hostedemail.com [216.40.44.68]) by kanga.kvack.org (Postfix) with ESMTP id 7DC136B006C for ; Wed, 28 Oct 2020 03:51:06 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 2A4031EE6 for ; Wed, 28 Oct 2020 07:51:06 +0000 (UTC) X-FDA: 77420563332.14.food14_0e014fc27283 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id 0E21318229818 for ; Wed, 28 Oct 2020 07:51:06 +0000 (UTC) X-HE-Tag: food14_0e014fc27283 X-Filterd-Recvd-Size: 4022 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Wed, 28 Oct 2020 07:51:05 +0000 (UTC) Received: from kernel.org (unknown [87.70.96.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5AEB92417E; Wed, 28 Oct 2020 07:51:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603871464; bh=5CnDlGXayyFOYH2dTVvk7eaghhMV+C1UUuCxwi3GGmQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hmj1uJtQNt65yUTovMQ4dJtCggiEI7V3Zy82V7yP1FafK6pDVaJ0fiEufCDAlOHTE +3b0rRDzZ8PRRUQDHCGs4VrfSqcCuYGSQxlBScO6OFwHl/PsYnMDdv4JeLDFb30A3E hku2SGt0DoF6SoB48S1+utefLVjVMbDI4KQ03fn4= Date: Wed, 28 Oct 2020 09:50:56 +0200 From: Mike Rapoport To: "Matthew Wilcox (Oracle)" Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Andrew Morton , Hugh Dickins , Johannes Weiner , Yang Shi , Dave Chinner , linux-kernel@vger.kernel.org, Jan Kara , William Kucharski Subject: Re: [PATCH v3 01/12] mm: Make pagecache tagged lookups return only head pages Message-ID: <20201028075056.GB1362354@kernel.org> References: <20201026041408.25230-1-willy@infradead.org> <20201026041408.25230-2-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201026041408.25230-2-willy@infradead.org> 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, Oct 26, 2020 at 04:13:57AM +0000, 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) > Reviewed-by: Jan Kara > Reviewed-by: William Kucharski > --- > mm/filemap.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/mm/filemap.c b/mm/filemap.c > index d5e7c2029d16..edde5dc0d28f 100644 > --- a/mm/filemap.c > +++ b/mm/filemap.c > @@ -2066,7 +2066,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) > @@ -2074,8 +2074,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. Nit: ^ next head page > * > * Return: the number of pages which were found. > */ > @@ -2109,9 +2109,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 > > -- Sincerely yours, Mike.