[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200929091348.GI10896@quack2.suse.cz>
Date: Tue, 29 Sep 2020 11:13:48 +0200
From: Jan Kara <jack@...e.cz>
To: "Matthew Wilcox (Oracle)" <willy@...radead.org>
Cc: linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
Hugh Dickins <hughd@...gle.com>,
William Kucharski <william.kucharski@...cle.com>,
Johannes Weiner <hannes@...xchg.org>, Jan Kara <jack@...e.cz>,
Yang Shi <yang.shi@...ux.alibaba.com>,
Dave Chinner <dchinner@...hat.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 01/12] mm: Make pagecache tagged lookups return only
head pages
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) <willy@...radead.org>
Looks good to me. You can add:
Reviewed-by: Jan Kara <jack@...e.cz>
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 <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists