[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y1bqpYNvnxmZL+KW@casper.infradead.org>
Date: Mon, 24 Oct 2022 20:42:29 +0100
From: Matthew Wilcox <willy@...radead.org>
To: "Vishal Moola (Oracle)" <vishal.moola@...il.com>
Cc: linux-fsdevel@...r.kernel.org, linux-afs@...ts.infradead.org,
linux-kernel@...r.kernel.org, linux-btrfs@...r.kernel.org,
ceph-devel@...r.kernel.org, linux-cifs@...r.kernel.org,
linux-ext4@...r.kernel.org, linux-f2fs-devel@...ts.sourceforge.net,
cluster-devel@...hat.com, linux-nilfs@...r.kernel.org,
linux-mm@...ck.org
Subject: Re: [PATCH v3 02/23] filemap: Added filemap_get_folios_tag()
On Mon, Oct 17, 2022 at 01:24:30PM -0700, Vishal Moola (Oracle) wrote:
> This is the equivalent of find_get_pages_range_tag(), except for folios
> instead of pages.
>
> One noteable difference is filemap_get_folios_tag() does not take in a
> maximum pages argument. It instead tries to fill a folio batch and stops
> either once full (15 folios) or reaching the end of the search range.
>
> The new function supports large folios, the initial function did not
> since all callers don't use large folios.
Reviewed-by: Matthew Wilcow (Oracle) <willy@...radead.org>
> +/**
> + * filemap_get_folios_tag - Get a batch of folios matching @tag.
> + * @mapping: The address_space to search
> + * @start: The starting page index
> + * @end: The final page index (inclusive)
> + * @tag: The tag index
> + * @fbatch: The batch to fill
> + *
> + * Same as filemap_get_folios, but only returning folios tagged with @tag
If you add () after filemap_get_folios, it turns into a nice link in
the html documentation.
> + *
> + * Return: The number of folios found
Missing full stop at the end of this line.
> + * Also update @start to index the next folio for traversal
Ditto.
> + */
> +unsigned filemap_get_folios_tag(struct address_space *mapping, pgoff_t *start,
> + pgoff_t end, xa_mark_t tag, struct folio_batch *fbatch)
> +{
> + XA_STATE(xas, &mapping->i_pages, *start);
> + struct folio *folio;
> +
> + rcu_read_lock();
> + while ((folio = find_get_entry(&xas, end, tag)) != NULL) {
> + /* Shadow entries should never be tagged, but this iteration
> + * is lockless so there is a window for page reclaim to evict
> + * a page we saw tagged. Skip over it.
> + */
For multiline comments, the "/*" should be on a line by itself.
Powered by blists - more mailing lists