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=-12.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 A1E90C433E2 for ; Mon, 14 Sep 2020 13:01:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 463EC206B2 for ; Mon, 14 Sep 2020 13:01:10 +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="FRF15Cbm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 463EC206B2 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 CE5B5900003; Mon, 14 Sep 2020 09:00:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C6FA96B005C; Mon, 14 Sep 2020 09:00:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B5F48900004; Mon, 14 Sep 2020 09:00:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0067.hostedemail.com [216.40.44.67]) by kanga.kvack.org (Postfix) with ESMTP id 8D879900003 for ; Mon, 14 Sep 2020 09:00:57 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 2CFE2F034 for ; Mon, 14 Sep 2020 13:00:57 +0000 (UTC) X-FDA: 77261676954.30.horn24_2412e5427108 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id 576BF1801272D for ; Mon, 14 Sep 2020 13:00:54 +0000 (UTC) X-HE-Tag: horn24_2412e5427108 X-Filterd-Recvd-Size: 3765 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf16.hostedemail.com (Postfix) with ESMTP for ; Mon, 14 Sep 2020 13:00:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=Pg1I1M+L0Ys2evtsmU1Fe0vXAju57Ok+EiNjdCZkzBo=; b=FRF15Cbm4BW3gtZLIzi8zigIVn tSobNvruc9L4hznRDowLYloHoD17tu1AiLkm6e4t4vfdeYw/OF01862uBArg84UqiVU/r7dUgSxgm giJm8qvU3aG5p+lYK/1zOJZVNrYkm2Cv5wBWVKECZNRcO8QiSKizG+St5EUbjX1+w0+pU2j+1RKPk npYvL12q1MIM/pauissEBWOn+7De/VxfTI6Jw9BsVXVIHVc0XjSj/hchZ5h91vQFFFlQ6Wq/fcRVe fagai1tjp2GZvod8WxmOHyJF08EiJeFlXgv0QjJCHj88Ps689EgBNKy8UcMNlw9NI2Pb8qQGMBTkL lOvqDpNA==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHo68-0002zi-G6; Mon, 14 Sep 2020 13:00:44 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , Andrew Morton , Hugh Dickins , William Kucharski , Johannes Weiner , Jan Kara , Yang Shi , Dave Chinner , linux-kernel@vger.kernel.org Subject: [PATCH v2 01/12] mm: Make pagecache tagged lookups return only head pages Date: Mon, 14 Sep 2020 14:00:31 +0100 Message-Id: <20200914130042.11442-2-willy@infradead.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200914130042.11442-1-willy@infradead.org> References: <20200914130042.11442-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 576BF1801272D X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 Content-Transfer-Encoding: quoted-printable 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: 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) --- 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); =20 /** - * find_get_pages_range_tag - find and return pages in given range match= ing @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 wit= h - * @tag. We update @index to index the next page for the traversal. + * Like find_get_pages(), except we only return head pages which are tag= ged + * with @tag. We update @index to index the next page for the traversa= l. * * Return: the number of pages which were found. */ @@ -2011,9 +2011,9 @@ unsigned find_get_pages_range_tag(struct address_sp= ace *mapping, pgoff_t *index, if (unlikely(page !=3D xas_reload(&xas))) goto put_page; =20 - pages[ret] =3D find_subpage(page, xas.xa_index); + pages[ret] =3D page; if (++ret =3D=3D nr_pages) { - *index =3D xas.xa_index + 1; + *index =3D page->index + thp_nr_pages(page); goto out; } continue; --=20 2.28.0